# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
432663 | daniel920712 | 말 (IOI15_horses) | C++14 | 31 ms | 15376 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"
#include <iostream>
using namespace std;
long long XX[100005];
long long YY[100005];
long long how[100005]={0};
long long MOD=1e9+7;
long long N;
int init(int N, int X[], int Y[])
{
long long ans=0,t=1,i,now=0;
::N=N;
for(i=0;i<N;i++)
{
XX[i]=(long long) X[i];
YY[i]=(long long) Y[i];
}
for(i=N-1;i>=0;i--)
{
if(Y[i]>now)
{
now=YY[i];
t=YY[i];
}
t*=XX[i];
t%=MOD;
if(now<1000000000) now*=XX[i];
}
return (int) t;
}
int updateX(int pos, int val)
{
long long ans=0,t=1,i,now=0;
XX[pos]=(long long) val;
for(i=N-1;i>=0;i--)
{
if(YY[i]>now)
{
now=YY[i];
t=YY[i];
}
t*=XX[i];
t%=MOD;
if(now<1000000000) now*=XX[i];
}
return (int) t;
}
int updateY(int pos, int val)
{
long long ans=0,t=1,i,now=0;
YY[pos]=(long long) val;
for(i=N-1;i>=0;i--)
{
if(YY[i]>now)
{
now=YY[i];
t=YY[i];
}
t*=XX[i];
t%=MOD;
if(now<1000000000) now*=XX[i];
}
return (int) t;
}
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... |