/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 320.0 KiB
#2 Accepted 26ms 2.82 MiB
#3 Accepted 26ms 2.672 MiB
#4 Accepted 26ms 2.809 MiB
#5 Accepted 26ms 2.715 MiB
#6 Accepted 26ms 2.609 MiB

Code

//                 بِسْمِ ٱللَّٰهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ
//                اللَّهُمَّ إِنِّي أَسْأَلُكَ عِلْمًا نَافِعًا وَرِزْقًا طَيِّبًا وَعَمَلاً مُتَقَبَّلاً 



#include<bits/stdc++.h>
#define ll                  long long
#define pb                  push_back
#define ppb                 pop_back
#define checkmate           return 0
#define yes                 cout<<"YES"<<endl
#define no                  cout<<"NO"<<endl
#define gcd(a,b)            __gcd(a,b)
#define lcm(a,b)            (a*b)/gcd(a,b)
#define for1(i , y)         for(ll i = y ; i<n ; i++) 
#define for2(i , y)         for(ll i = y ; i<m ; i++) 
#define vi(n)               vector<int> v(n)
#define vll                 vector<ll>
#define vcin(v)             for(ll i = 0; i<n ; i++) cin>>v[i] 
#define MOD                 1000000007
#define f                   first
#define s                   second
#define all(v)              v.begin(),v.end() 
#define allr(v)             v.rbegin(),v.rend()          
#define setpr               cout<<fixed<<setprecision(1)<< x <<endl
#define vmax                *max_element(v.begin(),v.end())
#define vmin                *min_element(v.begin(),v.end())
#define fast()              ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl                '\n'
#define dbg(...)
//             T   B   L   R    TL  TR   BL  BR
int dx[10] = {-1 , 1 , 0 , 0 , -1 , -1 , 1 , 1};
int dy[10] = { 0 , 0 ,-1 , 1 , -1 ,  1 ,-1 , 1};
//            -------------    ----------------
//              side move       diagonal move
const int N = 1e5 + 7;
int a[1000+5];
using namespace std;

void file(){
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
}

double wasted(pair<double,double>p1 , pair<double,double> p2)
{
    return sqrtl((p1.f-p2.f)*(p1.f-p2.f)+(p1.s-p2.s)*(p1.s-p2.s));
}

bool isBalanced(char c1 , char c2){
   return (c1 == '(' && c2 == ')' || c1 == '[' && c2 == ']');
}

bool isVowel(char c){
    return (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u');
}

bool isPrime(int n) {
    if (n <= 1) return false;
    if (n <= 3) return true;
    if (n % 2 == 0 || n % 3 == 0) return false;
    for (int i = 5; i * i <= n; i += 6) {
        if (n % i == 0 || n % (i + 2) == 0) return false;
    }
    return true;

}
ll sum(ll n){
    ll ans = 0;
    while(n){
        ans += n % 10;
        n /= 10;
    }
    return ans;
}


//----------------   Solution Here   ----------------/

void solve(){
    int n,val;  cin>>n;
    map<int,int> mp;
    for(int i = 0; i<n ; i++){
        int x;    cin>>x;
        mp[x]++;
    }
    for(auto &u : mp){
        if(u.s == 1){
           cout << u.f << endl;
           break;
        }
    }
}

int main()
{
     fast();
    //file();
    /*ll t ; cin>>t;
    //int tt=1;
    while(t--) 
    {
      //cout<<"Case "<<tt<<": ";
     // tt++;
     solve();
    }*/
    solve();
   checkmate;
}

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:55:34
Judged At
2024-11-11 02:49:37
Judged By
Score
100
Total Time
26ms
Peak Memory
2.82 MiB