# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1110152 | vjudge1 | Žarulje (COI15_zarulje) | C++17 | 356 ms | 191816 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>
using namespace std;
#define int long long
#define Ls l.top()
#define Rs r.top()
#define calc(x) (fac[mp1[x]+mp2[x]]*inv[mp2[x]]%M*inv[mp1[x]]%M)
const int M=1e9+7,N=1<<18;
int H[N],fac[N],inv[N],res[N],mp1[N],mp2[N];
stack<int>bad[N],l,r;
int qp(int x,int k=M-2){
if(!k) return 1;
int y=qp(x,k/2);
y=y*y%M;
if(k&1)y=y*x%M;
return y;
}
signed main(){
l.push(0),r.push(0);
cin.tie(0)->sync_with_stdio(0);
fac[0]=1;
for(int i=1;i<N;i++)
fac[i]=fac[i-1]*i%M;
inv[N-1]=qp(fac[N-1]);
res[1]=1;
for(int i=N;--i;)
inv[i-1]=inv[i]*i%M;
int n,k;
cin>>n>>k;
for(int i=1;i<=n;i++)
cin>>H[i];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |