/ SeriousOJ /

Record Detail

Runtime Error


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 540.0 KiB
#2 Runtime Error 9ms 760.0 KiB
#3 Runtime Error 8ms 764.0 KiB
#4 Runtime Error 7ms 756.0 KiB
#5 Runtime Error 8ms 756.0 KiB
#6 Runtime Error 7ms 796.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-10-03 16:30:36
Judged By
Score
10
Total Time
9ms
Peak Memory
796.0 KiB