Submission #789386

#TimeUsernameProblemLanguageResultExecution timeMemory
7893861075508020060209tcSequence (APIO23_sequence)C++17
Compilation error
0 ms0 KiB
int l=1;int r=n; while(l<r){ int mi=l+(r-l+1)/2; if(ok(mi)){ l=mi; }else{ r=mi-1; } } // cout<<l<<endl; return l; } int sequence(int N, std::vector<int> A) { n=N; for(int i=0;i<n;i++){ ar[i+1]=A[i]; vpl[i+1].clear(); } return fslv(); return 0; } /* signed main() { cin>>n; for(int i=1;i<=n;i++){ cin>>ar[i]; vpl[ar[i]].push_back(i); } int l=1;int r=n; while(l<r){ int mi=l+(r-l+1)/2; if(ok(mi)){ l=mi; }else{ r=mi-1; } } cout<<l<<endl; return 0; } */

Compilation message (stderr)

sequence.cpp:2:19: error: 'n' was not declared in this scope
    2 |     int l=1;int r=n;
      |                   ^
sequence.cpp:3:5: error: expected unqualified-id before 'while'
    3 |     while(l<r){
      |     ^~~~~
sequence.cpp:12:5: error: expected unqualified-id before 'return'
   12 |     return l;
      |     ^~~~~~
sequence.cpp:14:1: error: expected declaration before '}' token
   14 | }
      | ^
sequence.cpp:16:21: error: 'std::vector' has not been declared
   16 | int sequence(int N, std::vector<int> A) {
      |                     ^~~
sequence.cpp:16:32: error: expected ',' or '...' before '<' token
   16 | int sequence(int N, std::vector<int> A) {
      |                                ^
sequence.cpp: In function 'int sequence(int, int)':
sequence.cpp:17:5: error: 'n' was not declared in this scope
   17 |     n=N;
      |     ^
sequence.cpp:19:9: error: 'ar' was not declared in this scope; did you mean 'r'?
   19 |         ar[i+1]=A[i];
      |         ^~
      |         r
sequence.cpp:19:17: error: 'A' was not declared in this scope
   19 |         ar[i+1]=A[i];
      |                 ^
sequence.cpp:20:9: error: 'vpl' was not declared in this scope
   20 |         vpl[i+1].clear();
      |         ^~~
sequence.cpp:22:8: error: 'fslv' was not declared in this scope
   22 | return fslv();
      |        ^~~~