# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
946973 | Nika533 | Horses (IOI15_horses) | C++17 | 1532 ms | 12884 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.
#pragma GCC diagnostic warning "-std=c++11"
#include <bits/stdc++.h>
#include "horses.h"
#define pb push_back
#define f first
#define s second
#define MOD 1000000007
#define flush fflush(stdout)
#define all(x) (x).begin(),(x).end()
#define allr(x) (x).rbegin(), (x).rend()
#define pii pair<int,int>
using namespace std;
const int N=5e5+5;
int n,m,T,k,arr[N],x[N],y[N];
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];
}
arr[0]=x[0];
for (int i=1; i<n; i++) {
arr[i]=arr[i-1]*x[i];
arr[i]%=MOD;
}
for (int i=0; i<n; i++) {
arr[i]*=y[i];
arr[i]%=MOD;
}
int ans=0;
for (int i=0; i<n; i++) ans=max(ans,arr[i]);
return ans;
}
int updateX(int pos, int val) {
for (int i=pos; i<n; i++) {
arr[i]*=val; arr[i]/=x[pos];
}
x[pos]=val;
int ans=0;
for (int i=0; i<n; i++) ans=max(ans,arr[i]);
return ans;
}
int updateY(int pos, int val) {
arr[pos]*=val; arr[pos]/=y[pos];
y[pos]=val;
int ans=0;
for (int i=0; i<n; i++) ans=max(ans,arr[i]);
return ans;
}
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... |