結果
問題 | No.269 見栄っ張りの募金活動 |
ユーザー |
![]() |
提出日時 | 2015-12-11 17:55:24 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 4,520 ms / 5,000 ms |
コード長 | 452 bytes |
コンパイル時間 | 557 ms |
コンパイル使用メモリ | 55,256 KB |
実行使用メモリ | 18,944 KB |
最終ジャッジ日時 | 2024-07-16 01:54:32 |
合計ジャッジ時間 | 23,798 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
#include <iostream>#define FOR(i,a,b) for(int i=(a);i<(b);i++)#define REP(i,b) FOR(i,0,b)using namespace std;typedef long long LL;LL DP[101][20001];const LL p=7+1e+9;int main() {LL N,S,K;cin >> N >> S >> K;DP[0][0]=1;LL c=0;FOR(i,1,N+1){REP(j,S+1){FOR(k,c,S+1){if(j-k*(N-i+1) < 0) break;DP[i][j]+=DP[i-1][j-k*(N-i+1)];DP[i][j]%=p;}}c=K;}cout << DP[N][S] << endl;// your code goes herereturn 0;}