# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
830321 | mindiyak | Horses (IOI15_horses) | C++17 | 471 ms | 524288 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 <vector>
using namespace std;
typedef long long ll;
vector<ll> x;
vector<ll> y;
vector<ll> num_h;
int n;
int calc(){
for(int i=0;i<n;i++)num_h.push_back(x[i]*((i==0)?1:num_h[i-1]));
ll MX = 0;
for(int i=0;i<n;i++){
MX = max(MX,num_h[i]*y[i]);
}
int ans = MX%((int)1e9+7);
return ans;
}
int init(int N, int X[], int Y[]) {
n = N;
for(int i=0;i<N;i++)x.push_back(X[i]);
for(int i=0;i<N;i++)y.push_back(Y[i]);
return calc();
}
int updateX(int pos, int val) {
x[pos]=val;
return calc();
}
int updateY(int pos, int val) {
y[pos]=val;
return calc();
}
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... |