Submission #1051768
Source Code Expand
#include<cstdio> #include<algorithm> #include<cstring> #include<iostream> #include<vector> #include<set> #include<map> #include<bitset> #include<cmath> #include<string> #define ls (t<<1) #define rs ((t<<1)+1) #define mid ((l+r)>>1) #define fi first #define se second #define mk make_pair #define pb push_back #define N 100005 #define M 200005 #define seed 23333 #define Mo 1000000007 using namespace std; int i,j,m,n,p,k,a,b,c,ans,fac[N],inv[N]; int C(int x,int y) { if (x<y) return 0; return 1ll*fac[x]*inv[y]%Mo*inv[x-y]%Mo; } int power(int x,int y) { int s=1; for (;y;y>>=1) { if (y&1) s=1ll*s*x%Mo; x=1ll*x*x%Mo; } return s; } void jia(int &x,int y) { x+=y; if (x>=Mo) x-=Mo; } int main() { scanf("%d%d%d%d",&n,&a,&b,&c); fac[0]=inv[0]=1; for (i=1;i<N;++i) fac[i]=1ll*fac[i-1]*i%Mo,inv[i]=power(fac[i],Mo-2); if (b&1) for (;;); else { b/=2; for (i=0;i<=a;++i) for (j=0;i+j<=c;++j) if ((c-i-j)%3==0) { jia(ans,1ll*C(a+b,a)*C(a,i)%Mo*C(b+j-1,j)%Mo*C(a+b+1+(c-i-j)/3-1,(c-i-j)/3)%Mo); } printf("%d\n",ans); } }
Submission Info
Submission Time | |
---|---|
Task | J - 123 Pairs |
User | qiaoranliqu |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1152 Byte |
Status | WA |
Exec Time | 2102 ms |
Memory | 1024 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:48:31: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d%d%d%d",&n,&a,&b,&c); ^
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 1500 | ||||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example0.txt, example1.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, 044.txt, 045.txt, 046.txt, 047.txt, 048.txt, 049.txt, example0.txt, example1.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
000.txt | AC | 37 ms | 1024 KB |
001.txt | AC | 19 ms | 1024 KB |
002.txt | AC | 19 ms | 1024 KB |
003.txt | AC | 19 ms | 1024 KB |
004.txt | AC | 20 ms | 1024 KB |
005.txt | AC | 19 ms | 1024 KB |
006.txt | AC | 19 ms | 1024 KB |
007.txt | WA | 20 ms | 1024 KB |
008.txt | AC | 19 ms | 1024 KB |
009.txt | AC | 19 ms | 1024 KB |
010.txt | WA | 19 ms | 1024 KB |
011.txt | AC | 19 ms | 1024 KB |
012.txt | WA | 19 ms | 1024 KB |
013.txt | AC | 19 ms | 1024 KB |
014.txt | AC | 19 ms | 1024 KB |
015.txt | AC | 49 ms | 1024 KB |
016.txt | AC | 21 ms | 1024 KB |
017.txt | AC | 27 ms | 1024 KB |
018.txt | AC | 21 ms | 1024 KB |
019.txt | AC | 29 ms | 1024 KB |
020.txt | AC | 22 ms | 1024 KB |
021.txt | AC | 45 ms | 1024 KB |
022.txt | AC | 22 ms | 1024 KB |
023.txt | AC | 25 ms | 1024 KB |
024.txt | AC | 45 ms | 1024 KB |
025.txt | AC | 23 ms | 1024 KB |
026.txt | AC | 35 ms | 1024 KB |
027.txt | AC | 43 ms | 1024 KB |
028.txt | AC | 28 ms | 1024 KB |
029.txt | AC | 31 ms | 1024 KB |
030.txt | AC | 43 ms | 1024 KB |
031.txt | AC | 45 ms | 1024 KB |
032.txt | AC | 21 ms | 1024 KB |
033.txt | TLE | 2102 ms | 1024 KB |
034.txt | AC | 29 ms | 1024 KB |
035.txt | AC | 32 ms | 1024 KB |
036.txt | AC | 21 ms | 1024 KB |
037.txt | AC | 19 ms | 1024 KB |
038.txt | AC | 56 ms | 1024 KB |
039.txt | TLE | 2102 ms | 1024 KB |
040.txt | TLE | 2102 ms | 1024 KB |
041.txt | AC | 26 ms | 1024 KB |
042.txt | AC | 19 ms | 1024 KB |
043.txt | AC | 19 ms | 1024 KB |
044.txt | AC | 19 ms | 1024 KB |
045.txt | AC | 19 ms | 1024 KB |
046.txt | WA | 19 ms | 1024 KB |
047.txt | WA | 19 ms | 1024 KB |
048.txt | AC | 19 ms | 1024 KB |
049.txt | AC | 19 ms | 1024 KB |
example0.txt | AC | 19 ms | 1024 KB |
example1.txt | AC | 20 ms | 1024 KB |