# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1004537 | ayankarimova | Horses (IOI15_horses) | C++14 | 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 "horses.h"
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
const ll mod=1e9+7;
/*
{} []
*/
int init(int n, int x[], int y[]) {
ll num=1, ans=0;
for(int i=0; i<n; i++){
num*=x[i];
ans=max(ans, num*y[i]%mod);
num%=mod;
}
return ans;
}
int updateX(int pos, int val) {
x[pos]=val;
ll num=1, ans=0;
for(int i=0; i<n; i++){
num*=x[i];
ans=max(ans, num*y[i]%mod);
num%=mod;
}
return ans;
}
int updateY(int pos, int val) {
y[pos]=val;
ll num=1, ans=0;
for(int i=0; i<n; i++){
num*=x[i];
ans=max(ans, num*y[i]%mod);
num%=mod;
}
return ans;
}