Submission #1995144
Source Code Expand
#include<bits/stdc++.h> using namespace std; const int MX=4005,md=1000000007; int n,m,k,f[MX][MX],s[MX]; int main(){ int i,j; cin>>n>>m>>k; f[0][0]=1; for(i=1;i<n+m;i++){ memcpy(s,f[i-1],sizeof(int)*(m+1)); for(j=1;j<=m;j++)s[j]=(s[j-1]+s[j])%md; for(j=0;j<=m;j++)f[i][j]=(md+(j>=k?s[j]:0))%md; } int ans=0; while(m){ ans=(ans+f[(n+m-1)/(k-1)][m])%md; m-=k-1; } cout<<ans<<endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | E - Eternal Average |
User | CommonAnts |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 434 Byte |
Status | RE |
Exec Time | 168 ms |
Memory | 62080 KB |
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 1600 | ||||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt, s3.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, s1.txt, s2.txt, s3.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | WA | 1 ms | 256 KB |
02.txt | WA | 73 ms | 62080 KB |
03.txt | WA | 1 ms | 256 KB |
04.txt | WA | 1 ms | 256 KB |
05.txt | RE | 168 ms | 62080 KB |
06.txt | WA | 38 ms | 32512 KB |
07.txt | RE | 103 ms | 31488 KB |
08.txt | RE | 102 ms | 11392 KB |
09.txt | RE | 168 ms | 62080 KB |
10.txt | RE | 168 ms | 62080 KB |
11.txt | RE | 163 ms | 62080 KB |
12.txt | WA | 65 ms | 62080 KB |
13.txt | RE | 163 ms | 59136 KB |
14.txt | RE | 132 ms | 44416 KB |
15.txt | RE | 160 ms | 57088 KB |
16.txt | RE | 111 ms | 31744 KB |
17.txt | RE | 146 ms | 54784 KB |
18.txt | WA | 45 ms | 38656 KB |
19.txt | WA | 9 ms | 33536 KB |
20.txt | RE | 152 ms | 56960 KB |
21.txt | RE | 96 ms | 256 KB |
22.txt | RE | 168 ms | 61952 KB |
23.txt | RE | 154 ms | 56960 KB |
24.txt | RE | 151 ms | 54912 KB |
s1.txt | WA | 1 ms | 256 KB |
s2.txt | WA | 1 ms | 256 KB |
s3.txt | RE | 99 ms | 4992 KB |