結果
問題 | No.269 見栄っ張りの募金活動 |
ユーザー |
![]() |
提出日時 | 2019-11-28 04:35:35 |
言語 | C++11 (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,056 bytes |
コンパイル時間 | 2,137 ms |
コンパイル使用メモリ | 158,824 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-17 00:12:41 |
合計ジャッジ時間 | 50,198 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 3 |
other | WA * 1 RE * 21 |
ソースコード
#include <bits/stdc++.h>#include <set>#include <cstdio>#include <vector>#include <iostream>#include <utility>#define fir first#define sec second#define get(n) scanf("%d",&n);#define gets(s) string s;cin >> (s);#define All(s) (c).begin(), (c).end()#define chmin(x, y) x = min(x, y);#define chmax(x, y) x = max(x, y);#define rep(i, j) for (int (i)=0;(i)<(j);(i)++)#define repk(i, j, k) for(int (i)=(j);(i)<(k);(i)++)#define dump(x) cout << #x << " = " << (x) << endl;#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;using namespace std;typedef long long int ll;const ll INF = 10241024;const int MOD = 1e9 + 7;int N,S,K;void input(){cin >> N >> S >> K;}void solve(){input();int s = S - K*N*(N-1)/2;vector<int> v(s+1);v[0] = 1;rep(i,N-1){for(int j=N;i>0;j++){if(i+j> s) continue;v[i+j] += v[i];}}int ans = v[s] % MOD;cout << ans << endl;}int main () {solve();return 0;}