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 <vector>
#include <algorithm>
#define v vector
#define MOD 1000000007
using namespace std;
v<int> xs;
v<int> ys;
int n;
// Subtask 1
int solve() {
int ma = 0;
int pop = 1;
for(int i=0; i<n; i++) {
pop*=xs[i];
ma = max(ma, pop*ys[i]);
}
return ma%MOD;
}
int init(int N, int X[], int Y[]) {
n = N;
for (int i=0; i<n; i++) {
xs.push_back(X[i]);
ys.push_back(Y[i]);
}
return solve();
}
int updateX(int pos, int val) {
xs[pos] = val;
return solve();
}
int updateY(int pos, int val) {
ys[pos] = val;
return solve();
}
// Subtask 2
// int updateX(int pos, int val) {
// return 0;
// }
// int updateY(int pos, int val) {
// return 0;
// }
# | 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... |