# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
89886 | vex | Mate (COCI18_mate) | C++14 | 1810 ms | 51480 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 maxn 2005
#define MOD 1000000007
using namespace std;
int n,q;
string s;
long long bc[maxn][maxn];
long long poj[maxn][26];
long long sol[maxn][26][26];
long long f[maxn];
long long invf[maxn];
long long ste(long long x,long long y)
{
if(y==0)return 1LL;
if(y%2==0)
{
long long res=ste(x,y/2);
return (res*res)%MOD;
}
return (x*ste(x,y-1))%MOD;
}
long long inv(long long x){return ste(x,MOD-2);}
void resi()
{
f[0]=1LL;
for(int i=1;i<=n;i++)f[i]=(f[i-1]*i)%MOD;
for(int i=0;i<=n;i++)invf[i]=inv(f[i]);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |