hiho week 238 register

Ended

Participants:93

Verdict:Accepted
Score:100 / 100
Submitted:2019-01-22 14:33:42

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<cmath>
#include<algorithm>
using namespace std;
const long long MOD=1e9+7;
const int MAXM=1e6+10;
long long fac[MAXM+10],inv[MAXM+10];
int n,m;
long long qpow(long long x,long long y) {
    long long res=1;
    while(y) {
        if (y&1LL) res=(res*x)%MOD;
        x=(x*x)%MOD;
        y=y>>1LL;
    }
    return res;
}
int main()
{
    scanf("%d%d",&n,&m);
    fac[0]=1; inv[0]=qpow(fac[0],MOD-2);
    for (int i=1;i<=n*m;i++) {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX