/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 320.0 KiB
#2 Accepted 24ms 2.605 MiB
#3 Accepted 24ms 2.816 MiB
#4 Accepted 24ms 2.73 MiB
#5 Accepted 25ms 2.812 MiB
#6 Accepted 25ms 2.836 MiB

Code

#include<bits/stdc++.h>
using namespace std;
using ll = long long;

void solve() {
     
    int n;
    cin >> n;

    map<int, int> mp;
    for (int i = 0; i < n; i++) {
    	int x;
    	cin >> x;
    	mp[x]++;
    }

    for (auto [x, y] : mp) {
    	if (y == 1) {
    		cout << x << '\n';
    		return;
    	}
    }
}

int32_t main() {
	ios_base::sync_with_stdio(false);
    cin.tie(0);

    int tc = 1;
    //cin >> tc;

    while(tc--) {
    	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 15:33:02
Judged At
2024-11-11 02:51:06
Judged By
Score
100
Total Time
25ms
Peak Memory
2.836 MiB