結果

問題 No.269 見栄っ張りの募金活動
ユーザー nouka28nouka28
提出日時 2023-03-08 06:41:52
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 10 ms / 5,000 ms
コード長 863 bytes
コンパイル時間 2,914 ms
コンパイル使用メモリ 248,620 KB
実行使用メモリ 20,532 KB
最終ジャッジ日時 2023-10-18 05:50:23
合計ジャッジ時間 4,129 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,676 KB
testcase_01 AC 2 ms
5,688 KB
testcase_02 AC 2 ms
5,676 KB
testcase_03 AC 4 ms
13,920 KB
testcase_04 AC 5 ms
12,316 KB
testcase_05 AC 2 ms
7,744 KB
testcase_06 AC 5 ms
20,032 KB
testcase_07 AC 10 ms
20,532 KB
testcase_08 AC 3 ms
7,740 KB
testcase_09 AC 2 ms
5,680 KB
testcase_10 AC 3 ms
7,740 KB
testcase_11 AC 3 ms
8,144 KB
testcase_12 AC 2 ms
5,680 KB
testcase_13 AC 4 ms
10,040 KB
testcase_14 AC 3 ms
5,992 KB
testcase_15 AC 4 ms
10,084 KB
testcase_16 AC 2 ms
5,680 KB
testcase_17 AC 2 ms
5,680 KB
testcase_18 AC 6 ms
18,244 KB
testcase_19 AC 4 ms
12,016 KB
testcase_20 AC 3 ms
7,940 KB
testcase_21 AC 3 ms
6,072 KB
testcase_22 AC 3 ms
9,952 KB
testcase_23 AC 3 ms
9,808 KB
testcase_24 AC 3 ms
8,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<omp.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define reps(i,a,b) for(int i=a;i<b;++i)
#define repnega(i,a,b) for(int i=b;i>a;i--)
#define mod 1000000007
#define endl '\n'
#define AC ios_base::sync_with_stdio(false);cin.tie(0);
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

int dp[109][20009];
signed main(){
    int n,m,k;
    cin>>n>>m>>k;
    rep(i,n)m-=k*i;
    if(m<0){
        cout<<0<<endl;
        return 0;
    }
    dp[0][0]=1;
    rep1(i,n)rep(j,m+1){
        if(j-i>=0){
            dp[i][j]=(dp[i-1][j]+dp[i][j-i])%mod;
        }else{
            dp[i][j]=dp[i-1][j];
        }
    }
    cout<<dp[n][m]<<endl;
}
0