# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
827652 | Supersonic | Horses (IOI15_horses) | C++14 | 1555 ms | 18292 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"
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
ll h[500001];
ll x[500001];
ll y[500001];
int n;
int init(int N, int X[], int Y[]) {
n=N;
h[0]=X[0];
for(int i=0;i<n;i++){
x[i]=X[i];
y[i]=Y[i];
if(i>0)h[i]=(h[i-1]*x[i])%((ll)1e9);
}
ll m=0;
for(int i=0;i<n;i++){
m=max(m,h[i]*y[i]);
}
return m;
}
int updateX(int pos, int val) {
x[pos]=val;
h[0]=x[0];
for(int i=1;i<n;i++){
if(i<pos)continue;
h[i]=(h[i-1]*x[i])%((ll)1e9);
}
ll m=0;
for(int i=0;i<n;i++){
m=max(m,h[i]*y[i]);
}
return m;
}
int updateY(int pos, int val) {
y[pos]=val;
ll m=0;
for(int i=0;i<n;i++){
m=max(m,h[i]*y[i]);
}
return m;
}
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... |