/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Accepted 27ms 3.223 MiB
#3 Accepted 24ms 3.176 MiB
#4 Accepted 27ms 3.191 MiB
#5 Accepted 26ms 3.098 MiB
#6 Accepted 32ms 3.145 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-10-03 16:06:07
Judged By
Score
100
Total Time
32ms
Peak Memory
3.223 MiB