Submission #387644

#TimeUsernameProblemLanguageResultExecution timeMemory
387644Pichon5Horses (IOI15_horses)C++17
17 / 100
17 ms8284 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%=mod; res=max(res,y[i]*num%mod); } return res; } 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...