Submission #946973

#TimeUsernameProblemLanguageResultExecution timeMemory
946973Nika533Horses (IOI15_horses)C++17
17 / 100
1532 ms12884 KiB
#pragma GCC diagnostic warning "-std=c++11" #include <bits/stdc++.h> #include "horses.h" #define pb push_back #define f first #define s second #define MOD 1000000007 #define flush fflush(stdout) #define all(x) (x).begin(),(x).end() #define allr(x) (x).rbegin(), (x).rend() #define pii pair<int,int> using namespace std; const int N=5e5+5; int n,m,T,k,arr[N],x[N],y[N]; int init(int N, int X[], int Y[]) { n=N; for (int i=0; i<n; i++) { x[i]=X[i]; y[i]=Y[i]; } arr[0]=x[0]; for (int i=1; i<n; i++) { arr[i]=arr[i-1]*x[i]; arr[i]%=MOD; } for (int i=0; i<n; i++) { arr[i]*=y[i]; arr[i]%=MOD; } int ans=0; for (int i=0; i<n; i++) ans=max(ans,arr[i]); return ans; } int updateX(int pos, int val) { for (int i=pos; i<n; i++) { arr[i]*=val; arr[i]/=x[pos]; } x[pos]=val; int ans=0; for (int i=0; i<n; i++) ans=max(ans,arr[i]); return ans; } int updateY(int pos, int val) { arr[pos]*=val; arr[pos]/=y[pos]; y[pos]=val; int ans=0; for (int i=0; i<n; i++) ans=max(ans,arr[i]); return ans; }

Compilation message (stderr)

horses.cpp:1:32: warning: '-std=c++11' is not an option that controls warnings [-Wpragmas]
    1 | #pragma GCC diagnostic warning "-std=c++11"
      |                                ^~~~~~~~~~~~
horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:16:14: warning: declaration of 'N' shadows a global declaration [-Wshadow]
   16 | int init(int N, int X[], int Y[]) {
      |          ~~~~^
horses.cpp:13:11: note: shadowed declaration is here
   13 | const int N=5e5+5;
      |           ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...