# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
164321 | beso123 | Relativnost (COCI15_relativnost) | C++14 | 4017 ms | 65532 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 <bits/stdc++.h>
#define int long long
#define mod 10007
using namespace std;
int n,m,Q,a[100005],b[100005],t[400005][30],sum;
void update(int v){
for(int k=0;k<=m;k++)
t[v][k]=0;
for(int i=0;i<=m;++i)
for(int j=0;j<=m;++j){
t[v][min(i+j,m)]+=((t[v*2][i]%mod)*(t[v*2+1][j])%mod);
t[v][min(i+j,m)]%=mod;
}
}
void Build(int v,int i,int j){
if(i==j){
t[v][0]=b[i]%mod;
t[v][1]=a[i]%mod;
return;
}
int mid=(i+j)/2;
Build(v*2,i,mid);
Build(v*2+1,mid+1,j);
update(v);
}
void UPD(int v,int i,int j,int pos){
if(i==j){
t[v][0]=b[i]%mod;
t[v][1]=a[i]%mod;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |