Submission #795756

#TimeUsernameProblemLanguageResultExecution timeMemory
795756Username4132Horses (IOI15_horses)C++14
17 / 100
12 ms8288 KiB
#include "horses.h" #include<iostream> #include<cmath> using namespace std; using ll = long long; using ld = long double; #define forn(i, n) for(int i=0; i<(int)n; ++i) const int MAXN = 1010, MOD = 1000000007; int n, arr[MAXN], brr[MAXN]; int calc(){ int prod=1, mx=0; forn(i, n) prod*=arr[i], mx=max(mx, prod*brr[i]); return mx; } int init(int N, int X[], int Y[]) { n=N; forn(i, n) arr[i]=X[i], brr[i]=Y[i]; return calc(); } int updateX(int pos, int val) { arr[pos]=val; return calc(); } int updateY(int pos, int val) { brr[pos]=val; return calc(); }
#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...