Submission #387650

#TimeUsernameProblemLanguageResultExecution timeMemory
387650Pichon5Horses (IOI15_horses)C++17
0 / 100
14 ms8272 KiB
#include "horses.h" #define vi vector<int> #include <bits/stdc++.h> using namespace std; const int mod=1e9+7; const int tam =1005; int x[tam]; int y[tam]; int n; int solve(){ int num=1; int res=0; for(int i=0;i<n;i++){ num*=x[i]; num=(num+mod)%mod; res=max(res,(y[i]+mod)%mod*(num+mod)%mod); } return res%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 solve(); } int updateX(int pos, int val) { x[pos]=val; return solve(); } int updateY(int pos, int val) { y[pos]=val; return 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...