# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1240716 | happydavid | Horses (IOI15_horses) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int init(int N, vector<int>& X, vector<int>& Y){
vector<int> horses(N);
for(int i =0; i < N; i++){
if(i ==0 ){
horses[i] = X[i];
} else {
horses[i] = (horses[i-1] * X[i]) % MOD;
}
}
int ma = 0;
for(int i =0; i < N; i++){
ma = max(ma, horses[i] * Y[i]);
}
return ma;
}
int updateX(int pos, int val){
pos = pos;
val = val;
return 0;
}
int updateY(int pos, int val){
pos = pos;
val = val;
return 0;
}