/ SeriousOJ /

Record Detail

Runtime Error


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 320.0 KiB
#2 Runtime Error 7ms 580.0 KiB
#3 Runtime Error 7ms 760.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 <int> v((n/2)+2,0);
    int arr[n];
    for(int i=0; i<n; i++) {
        int 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:30:36
Judged At
2024-11-11 02:48:19
Judged By
Score
10
Total Time
7ms
Peak Memory
760.0 KiB