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>
#include <bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
const int tam =1005;
int x[tam];
int y[tam];
int n;
int solve(){
int num=1;
int res=0;
for(int i=0;i<n;i++){
num*=x[i];
num=(num+mod)%mod;
res=max(res,(y[i]+mod)%mod*(num+mod)%mod);
}
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();
}
# | 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... |