Submission #1047414

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10474142024-08-07 12:42:21PagodePaivaReal Mountains (CCO23_day1problem2)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
#define resp1 resp
#define int long long
using namespace std;
const int N = 1000010;
int res[N];
const int mod = 1e6+3;
int main(){
int n;
cin >> n;
vector <int> v;
int idxmax = 0;
int mxval = 0;
for(int i = 0;i < n;i++){
int x;
cin >> x;
mxval = max(mxval, x);
v.push_back(x);
if(x > v[idxmax]) idxmax = i;
}
int pref = 0;
for(int i = 0;i < idxmax;i++){
pref = max(pref, v[i]);
res[i] = pref;
}
pref = 0;
for(int i = n-1;i > idxmax;i--){
pref = max(pref, v[i]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

cc1plus: error: '::main' must return 'int'