# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
387661 | Pichon5 | Horses (IOI15_horses) | C++17 | 14 ms | 8296 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"
#define vi vector<int>
#define ll long long int
#include <bits/stdc++.h>
using namespace std;
const ll mod=1e9+7;
const ll tam =1005;
ll x[tam];
ll y[tam];
ll n;
ll solve(){
ll num=1;
ll res=0;
for(int i=0;i<n;i++){
num*=x[i]%mod;
res=max(res,y[i]*num);
}
return res%mod;
}
int init(int N, int X[], int Y[]) {
n=N;
for(int i=0;i<n;i++){
x[i]=X[i];
y[i]=Y[i];
}
return solve();
}
int updateX(int pos, int val) {
x[pos]=val;
return solve();
}
int updateY(int pos, int val) {
y[pos]=val;
return solve();
}
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... |