# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
830325 | mindiyak | Horses (IOI15_horses) | C++14 | 1562 ms | 20176 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 M = 1e9+7;
ll multi(ll a,ll b){
return ((a%M)*(b*M))%M;
}
int calc(){
num_h = vector<ll>();
for(int i=0;i<n;i++)num_h.push_back(multi(x[i],((i==0)?1:num_h[i-1])));
ll MX = 0;
for(int i=0;i<n;i++){
MX = max(MX,multi(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... |