# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
268677 | mayhoubsaleh | Relativnost (COCI15_relativnost) | C++14 | 4000 ms | 24268 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 ll long long
#define pb push_back
#define left 2*i+1
#define righ 2*i+2
#define mid (l+r)/2
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
const int maxn=1e5+100;
const int inf=1e9+10;
const int mod=1e4+7;
int n,a[maxn],b[maxn],c,q;
int st[4*maxn][22];
void build(int i,int l,int r){
if(l==r){
st[i][0]=b[r]%mod;
st[i][1]=a[r]%mod;
return;
}
build(left,l,mid);
build(righ,mid+1,r);
for(int j=0;j<=c;j++){
for(int k=0;k<=c;k++){
st[i][min(j+k,c)]=(st[i][min(j+k,c)]+(st[left][j]*st[righ][k])%mod)%mod;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |