# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1011344 | sadeep | Horses (IOI15_horses) | C++17 | 15 ms | 10756 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "horses.h"
#define ll long long
ll n;
ll _Y[1002];
ll _X[1002];
int MOD = 1000000000+7;
ll max(ll a,ll b) { if (a>b) return a; return b; }
int run(){
ll t = 1;
ll mx=0;
for(int i=0; i<n; i++){
t=((t%MOD)*(_X[i]%MOD)%MOD);
mx = max(mx, (t*(_Y[i]%MOD))%MOD);
}
return mx;
}
int init(int N, int X[], int Y[]) {
n = N;
for(int i=0; i <N;i++)_X[i] = X[i];
for(int i=0; i <N;i++)_Y[i] = Y[i];
return run();
}
int updateX(int pos, int val) {
_X[pos]=val;
return run();
}
int updateY(int pos, int val) {
_Y[pos]=val;
return run();
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |