# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1056208 | Muhammad_Aneeq | Horses (IOI15_horses) | C++17 | 238 ms | 72376 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 <cmath>
#include <vector>
using namespace std;
int const MAXN=5e5+10,mod=1e9+7;
vector<int>x,y;
struct node
{
long long val,maxval;
long double cnt,maxcnt;
};
node seg[4*MAXN]={};
void update(int i,int r,int st,int en)
{
if (st==en)
{
seg[i].val=seg[i].maxval=x[r];
seg[i].maxval*=y[r];
seg[i].maxval%=mod;
seg[i].cnt=log2(x[r]);
seg[i].maxcnt=seg[i].cnt+log2(y[r]);
return ;
}
int mid=(st+en)/2;
if (r<=mid)
update(i*2,r,st,mid);
else
update(i*2+1,r,mid+1,en);
int lc=i*2,rc=i*2+1;
seg[i].val=(seg[lc].val*seg[rc].val)%mod;
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... |