Submission #954252

#TimeUsernameProblemLanguageResultExecution timeMemory
954252Trisanu_DasSequence (APIO23_sequence)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "sequence.h" using namespace std; int sequence(int n, vector<int> n){ int ans = 0; for(int i = 0; i < n; i++){ int s = 0, c = 0; for(int j = i; j > -1; j--){ if(a[i] == a[j]) c++; if(a[i] > a[j]) s--; if(a[i] < a[j]) s++; if(abs(s) <= c) ans = max(ans, c); } } return ans; }

Compilation message (stderr)

sequence.cpp:5:33: error: conflicting declaration 'std::vector<int> n'
    5 | int sequence(int n, vector<int> n){
      |                     ~~~~~~~~~~~~^
sequence.cpp:5:18: note: previous declaration as 'int n'
    5 | int sequence(int n, vector<int> n){
      |              ~~~~^
sequence.cpp: In function 'int sequence(int)':
sequence.cpp:10:10: error: 'a' was not declared in this scope
   10 |       if(a[i] == a[j]) c++;
      |          ^
sequence.cpp:11:10: error: 'a' was not declared in this scope
   11 |       if(a[i] > a[j]) s--;
      |          ^
sequence.cpp:12:10: error: 'a' was not declared in this scope
   12 |       if(a[i] < a[j]) s++;
      |          ^