# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
203468 | mohammad | Horses (IOI15_horses) | C++14 | 1553 ms | 14172 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.
/*
░░░░██████████████████
░░▄███████▀▀▀▀▀▀███████▄
░▐████▀▒mohammad▒▀██████▄
░███▀▒▒▒▒alaa▒▒▒▒▒▒▀█████
░▐██▒▒▒alwrawrah▒▒▒▒▒████▌
░▐█▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████▌
░░█▒▄▀▀▀▀▀▄▒▒▄▀▀▀▀▀▄▒▐███▌
░░░▐░░░▄▄░░▌▐░░░▄▄░░▌▐███▌
░▄▀▌░░░▀▀░░▌▐░░░▀▀░░▌▒▀▒█▌
░▌▒▀▄░░░░▄▀▒▒▀▄░░░▄▀▒▒▄▀▒▌
░▀▄▐▒▀▀▀▀▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒█
░░░▀▌▒▄██▄▄▄▄████▄▒▒▒▒█▀
░░░░▄██████████████▒▒▐▌
░░░▀███▀▀████▀█████▀▒▌
░░░░░▌▒▒▒▄▒▒▒▄▒▒▒▒▒▒▐
░░░░░▌▒▒▒▒▀▀▀▒▒▒▒▒▒▒▐
*/
#include<bits/stdc++.h>
#include "horses.h"
using namespace std;
typedef long long ll ;
const ll oo = 1e13 ;
const double PI = acos(-1) ;
const ll M = 1e9 + 7 ;
ll x[500010] , y[500010] , n , co = 0 , cur = 0;
ll mod(ll x ){
co += x / M;
return x % M ;
}
ll mod1(ll x ){
cur = x / M;
return x % M;
}
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];
ll x1 = 1 , ans = 0 , c1 = 0;
for(int i = 0 ; i < N ; ++i){
x1 = mod(x1 * X[i] );
ll an = mod1(x1 * y[i] );
if((c1 == co + cur && ans < an) || (co + cur > c1))
ans = an , c1 = co + cur;
}
return ans;
}
int updateX(int pos, int val){
x[pos] = val;
co = 0;
ll x1 = 1 , ans = 0 , c1 = 0;
for(int i = 0 ; i < n ; ++i){
x1 = mod(x1 * x[i] );
ll an = mod1(x1 * y[i] );
if((c1 == co + cur && ans < an) || (co + cur > c1))
ans = an , c1 = co + cur;
}
return ans;
}
int updateY(int pos, int val){
y[pos] = val;
co = 0;
ll x1 = 1 , ans = 0 , c1 = 0;
for(int i = 0 ; i < n ; ++i){
x1 = mod(x1 * x[i]);
ll an = mod1(x1 * y[i]);
if((c1 == co + cur && ans < an) || (co + cur > c1))
ans = an , c1 = co + cur;
}
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... |