/ SeriousOJ /

Record Detail

Compile Error

foo.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
foo.cc: In function 'int main()':
foo.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin>>n;
      |     ^~~
foo.cc:7:5: error: 'vector' was not declared in this scope
    7 |     vector<int>v;
      |     ^~~~~~
foo.cc:7:12: error: expected primary-expression before 'int'
    7 |     vector<int>v;
      |            ^~~
foo.cc:11:9: error: 'v' was not declared in this scope
   11 |         v.push_back(x);
      |         ^
foo.cc:13:10: error: 'v' was not declared in this scope
   13 |     sort(v.begin(),v.end());
      |          ^
foo.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |     sort(v.begin(),v.end());
      |     ^~~~
      |     short
foo.cc:19:13: error: 'cout' was not declared in this scope
   19 |             cout << v[i]<< endl;
      |             ^~~~
foo.cc:19:28: error: 'endl' was not declared in this scope
   19 |             cout << v[i]<< endl;
      |                            ^~~~

Code

include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin>>n;
    vector<int>v;
    for(int i=0;i<n;i++){
        int x;
        cin>>x;
        v.push_back(x);
    }
    sort(v.begin(),v.end());
    for(int i=0;i<n;i++){
        if(v[i]==v[i+1]){
            i++; 
        }
        else{
            cout << v[i]<< endl;
            break;
        }
    }  
}

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:50:13
Judged At
2024-12-17 11:35:52
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes