/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 328.0 KiB
#2 Accepted 26ms 2.734 MiB
#3 Accepted 25ms 2.812 MiB
#4 Accepted 26ms 2.605 MiB
#5 Accepted 26ms 2.812 MiB
#6 Accepted 26ms 2.801 MiB

Code

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
const int MODD = 998244353;

//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//
//template <typename num_t>
//using ordered_set = tree<num_t, null_type, less<num_t>, rb_tree_tag, tree_order_statistics_node_update>;



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

    map<int,int>m;

    for(int i=1;i<=n;i++){
        int x;
        cin>>x;
        m[x]++;
    }


    for(auto x:m){
        if(x.second==1){
            cout<<x.first<<'\n';
            return;
        }
    }
}

int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    // freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);


    int t = 1;
    //cin >> t;
    //int T = 0;
    while (t--)
    {
        //T++;
        //cout<<"Case "<<T<<": ";
        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:34:06
Judged At
2024-12-17 11:36:50
Judged By
Score
100
Total Time
26ms
Peak Memory
2.812 MiB