Submission #2169075
Source Code Expand
#include <bits/stdc++.h> //#include <math.h> using namespace std; #define INF 1.1e9 #define LINF 1.1e18 #define FOR(i,a,b) for (int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() #define pb push_back #define pf push_front #define fi first #define se second #define BIT(x,n) bitset<n>(x) #define PI 3.14159265358979323846 typedef long long ll; typedef pair<ll,int> P; //typedef pair<int,P> PP; //----------------------------------------------------------------------------- int r,c,x,y,d,l; const int MOD=1e9+7; ll ans,zero,one,two,three,four; ll comb[910][910]; void calc() { REP(i,910) comb[i][0]=comb[i][i]=1; FOR(i,1,910) FOR(j,1,i) comb[i][j]=(comb[i-1][j-1]+comb[i-1][j])%MOD; } ll f(ll N,ll R) { if(N<=0||R<=0||R>N) return 0; return comb[N][R]; } int main() { cin.tie(0); ios::sync_with_stdio(false); calc(); cin>>r>>c>>x>>y>>d>>l; ans=(r-x+1)*(c-y+1)%MOD; (ans*=comb[d+l][d])%=MOD; (zero+=f((x-2)*(y-2),d+l))%=MOD; (one=2*f((x-2)*(y-1),d+l)%MOD+2*f((x-1)*(y-2),d+l)%MOD)%=MOD; (two=4*f((x-1)*(y-1),d+l)%MOD+f((x-2)*y,d+l)+f(x*(y-2),d+l))%=MOD; (three=2*f((x-1)*y,d+l)%MOD+2*f(x*(y-1),d+l)%MDO)%=MOD; (four=f(x*y,d+l))%=MOD; ll tmp=(four-three+two-one+zero); while(tmp<0) tmp+=MOD; cout<<ans*tmp%MOD<<endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - AtCoder社の冬 |
User | moko_freedom |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1348 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:51:47: error: ‘MDO’ was not declared in this scope (three=2*f((x-1)*y,d+l)%MOD+2*f(x*(y-1),d+l)%MDO)%=MOD; ^