Submission #1691595
Source Code Expand
#include<bits/stdc++.h> using namespace std; template<class T> inline bool chkmax(T& a,T b){return a<b?a=b,1:0;} template<class T> inline bool chkmin(T& a,T b){return a>b?a=b,1:0;} template<typename T> inline T& read(T& x){ static char c; bool flag=0; while(!isdigit(c=getchar())) if(c=='-') flag=1; for(x=c-'0';isdigit(c=getchar());(x*=10)+=c-'0'); if(flag) x=-x; return x; } const int maxn=2010,mo=1e9+7; int n,m,C[maxn][maxn],ans; void init(){ C[0][0]=1; for(int i=1;i<=2000;i++){ C[i][0]=1; for(int j=1;j<=i;j++) C[i][j]=(C[i-1][j]+C[i-1][j-1])%mo; } } int main(){ #ifdef xffyjq freopen("exec.in","r",stdin); freopen("exec.out","w",stdout); #endif init(); read(n); read(m); ans=n+1; for(int i=1;i<m;i++) for(int j=0;j<=min(i-1,n-i);j++) ans=(1ll*ans+1ll*C[m-1][i]*C[i-1][j]%mo*C[n-i-j+2][2]%mo)%mo; printf("%d\n",ans); return 0; }
Submission Info
Submission Time | |
---|---|
Task | E - Popping Balls |
User | xffyjq |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 969 Byte |
Status | WA |
Exec Time | 16 ms |
Memory | 15104 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 1600 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example0.txt, example1.txt, example2.txt, example3.txt |
All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, 020.txt, 021.txt, 022.txt, 023.txt, 024.txt, 025.txt, 026.txt, 027.txt, 028.txt, 029.txt, 030.txt, 031.txt, 032.txt, 033.txt, 034.txt, 035.txt, 036.txt, 037.txt, 038.txt, 039.txt, 040.txt, 041.txt, 042.txt, 043.txt, example0.txt, example1.txt, example2.txt, example3.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
000.txt | WA | 16 ms | 15104 KB |
001.txt | AC | 10 ms | 15104 KB |
002.txt | AC | 10 ms | 15104 KB |
003.txt | AC | 10 ms | 15104 KB |
004.txt | AC | 15 ms | 15104 KB |
005.txt | AC | 15 ms | 15104 KB |
006.txt | AC | 15 ms | 15104 KB |
007.txt | AC | 15 ms | 15104 KB |
008.txt | AC | 15 ms | 15104 KB |
009.txt | AC | 15 ms | 15104 KB |
010.txt | AC | 16 ms | 15104 KB |
011.txt | AC | 16 ms | 15104 KB |
012.txt | AC | 15 ms | 15104 KB |
013.txt | AC | 15 ms | 15104 KB |
014.txt | AC | 10 ms | 15104 KB |
015.txt | AC | 12 ms | 15104 KB |
016.txt | AC | 10 ms | 15104 KB |
017.txt | AC | 10 ms | 15104 KB |
018.txt | AC | 10 ms | 15104 KB |
019.txt | AC | 10 ms | 15104 KB |
020.txt | AC | 11 ms | 15104 KB |
021.txt | AC | 10 ms | 15104 KB |
022.txt | AC | 12 ms | 15104 KB |
023.txt | AC | 10 ms | 15104 KB |
024.txt | AC | 12 ms | 15104 KB |
025.txt | AC | 10 ms | 15104 KB |
026.txt | AC | 12 ms | 15104 KB |
027.txt | AC | 10 ms | 15104 KB |
028.txt | AC | 13 ms | 15104 KB |
029.txt | AC | 10 ms | 15104 KB |
030.txt | AC | 11 ms | 15104 KB |
031.txt | AC | 10 ms | 15104 KB |
032.txt | AC | 10 ms | 15104 KB |
033.txt | AC | 13 ms | 15104 KB |
034.txt | AC | 10 ms | 15104 KB |
035.txt | AC | 10 ms | 15104 KB |
036.txt | AC | 10 ms | 15104 KB |
037.txt | AC | 10 ms | 15104 KB |
038.txt | AC | 10 ms | 15104 KB |
039.txt | AC | 10 ms | 15104 KB |
040.txt | AC | 10 ms | 15104 KB |
041.txt | AC | 10 ms | 15104 KB |
042.txt | AC | 10 ms | 15104 KB |
043.txt | AC | 10 ms | 15104 KB |
example0.txt | AC | 10 ms | 15104 KB |
example1.txt | AC | 10 ms | 15104 KB |
example2.txt | AC | 10 ms | 15104 KB |
example3.txt | AC | 16 ms | 15104 KB |