結果
| 問題 | 
                            No.269 見栄っ張りの募金活動
                             | 
                    
| コンテスト | |
| ユーザー | 
                             hogeover30
                         | 
                    
| 提出日時 | 2016-04-10 23:22:54 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 361 bytes | 
| コンパイル時間 | 630 ms | 
| コンパイル使用メモリ | 57,460 KB | 
| 実行使用メモリ | 9,856 KB | 
| 最終ジャッジ日時 | 2024-10-04 05:58:15 | 
| 合計ジャッジ時間 | 7,294 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 1 WA * 1 TLE * 1 -- * 19 | 
ソースコード
#include <iostream>
#include <algorithm>
using namespace std;
const int mod=1e9+7;
long dp[101][22010];
int main()
{
    int n, s, k;
    cin>>n>>s>>k;
    for(int j=s; j>=0; j-=n*k) dp[0][j]=1;
    for(int i=0; i<n; ++i) {
        for(int j=s; j>=0; --j)
            dp[i+1][j]=(dp[i+1][j+(n-i-1)]+dp[i][j+k*(n-i-1)])%mod;
    }
    cout<<dp[n][0]<<endl;
}
            
            
            
        
            
hogeover30