/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 324.0 KiB
#2 Accepted 26ms 3.223 MiB
#3 Accepted 25ms 3.195 MiB
#4 Accepted 26ms 3.199 MiB
#5 Accepted 26ms 3.129 MiB
#6 Accepted 27ms 3.227 MiB

Code

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <limits>
#include <cstring>
using namespace std;

void solve() {

  int n; cin >> n;
  std::vector<int> a(n);
  map<int, int> mp;
  for(int i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  for(auto& e : mp) {
    if(e.second == 1) {
      cout << e.first << endl;
      break;
    }
  }
  
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    int t = 1; 
    //cin >> t;  
    for (int i = 1; i <= t; i++) {
        solve();  
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1095 Uncovering the Lone Heart
Contest
Brain Booster #6
Language
C++17 (G++ 13.2.0)
Submit At
2024-10-03 16:06:07
Judged At
2024-11-11 02:49:16
Judged By
Score
100
Total Time
27ms
Peak Memory
3.227 MiB