/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 28ms 3.543 MiB
#3 Accepted 27ms 3.387 MiB
#4 Accepted 29ms 3.426 MiB
#5 Accepted 26ms 3.52 MiB
#6 Accepted 27ms 3.57 MiB

Code

#include <bits/stdc++.h>

using namespace std;

typedef long long LL;
typedef pair<long long,long long> PLL;

#define int long long
#define all(v) v.begin(),v.end()
#define faster {ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);}  

const LL mod = 1e9 + 7;
const int N = 2e5 + 10;
const LL inf = 1e9;

void solve(int test){
    int n; cin>>n;
    map<int, int> mp;
    int ans = 0;
    for(int i = 0, u; i < n; i++){
        cin>>u;
        mp[u]++;
    }
    for(auto [u, v]:mp) if(v == 1) ans = u;
    cout<<ans<<'\n';
}

signed main(){
    faster
    int t = 1; 
    // cin>>t;
    for(int i = 1; i <= t; i++){
        solve(i);
    }
    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:35:46
Judged At
2024-10-03 15:35:46
Judged By
Score
100
Total Time
29ms
Peak Memory
3.57 MiB