# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
800796 | Liudas | Horses (IOI15_horses) | C++17 | 0 ms | 0 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 <bits/stdc++.h>
#include "horses.h"
using namespace std;
vector<long long> X, Y;
int init(int N, int XX[], int YY[]){
int ans = 0;
X.resize(N);
Y.resize(N);
for(int i = 0; i < N; i ++){
X[i] = XX[i];
Y[i] = YY[i];
}
double a = 0, t = 0;
int id = 0;
for(int i = 0; i < N; i ++){
t += log(XX[i]);
if(t + log(YY[i]) > a){
a = t + log(YY[i]);
id = i;
}
}
long long ans = 1;
ans *= YY[id];
for(int i = 0; i <= id; i ++){
ans = ans * XX[i] % 1e9+7;
}
return ans;
}
int updateX(int pos, int val){
return 0;
}
int updateY(int pos, int val){
return 0;
}