/ SeriousOJ /

Record Detail

Runtime Error


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 484.0 KiB
#2 Runtime Error 7ms 1.02 MiB
#3 Runtime Error 7ms 832.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define print(v) for(auto &u:v) cout << u << " "
#define printp(v) for(auto e:v) cout<<e.first<<" "<<e.second<<endl;
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
#define pb push_back
 
void solve()
{
    int n; cin >> n;
    vector <ll> v((n/2)+2,0);
    int arr[n];
    for(int i=0; i<n; i++) {
        ll e; cin >> e;
        v[e]++;
    }
    auto ix = find(v.begin(), v.end(), 1);
    cout << ix - v.begin() << endl;

}
 
int main()
{   
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t = 1;
    while(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 16:33:29
Judged At
2024-12-17 11:34:31
Judged By
Score
10
Total Time
7ms
Peak Memory
1.02 MiB