Submission #136026

#TimeUsernameProblemLanguageResultExecution timeMemory
136026amiratouHorses (IOI15_horses)C++14
17 / 100
1588 ms10360 KiB
#pragma GCC optimize("O3") #include "horses.h" #include <bits/stdc++.h> #define ll long long using namespace std; const int MOD = (int)(1e9)+7; int x[500005],y[500005],n; ll solve(){ ll nb=1,ans=0; for (int i = 0; i < n; ++i) { nb=((nb%MOD)*(x[i]%MOD))%MOD; ans=max(ans,((nb%MOD)*(y[i]%MOD))%MOD); } return ans%MOD; } 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]; return (int)solve(); } int updateX(int pos, int val) { x[pos]=val; return (int)solve(); } int updateY(int pos, int val) { y[pos]=val; return (int)solve(); }
#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...