結果

問題 No.269 見栄っ張りの募金活動
ユーザー momotaros300momotaros300
提出日時 2019-12-10 14:21:00
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 995 bytes
コンパイル時間 751 ms
コンパイル使用メモリ 89,728 KB
実行使用メモリ 19,264 KB
最終ジャッジ日時 2023-09-06 07:08:13
合計ジャッジ時間 1,873 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 WA -
testcase_02 AC 2 ms
4,380 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 9 ms
12,640 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 6 ms
11,012 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 4 ms
7,724 KB
testcase_17 AC 3 ms
4,380 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <tuple>
#include <sstream>
#include <vector>
#include <cmath>
#include <ctime>
#include <cassert>
#include <cstdio>
#include <queue>
#include <set>
#include <map>
#include <fstream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>
using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define range(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define _GLIBCXX_DEBUG
typedef long long ll;
typedef double db;
typedef string str;
// head

int main(){
    int n,s,k;
    cin >> n >> s >> k;
    ll dp[101][20000];
    int maxs = s-k*(k-1)/2*n;
    range(i,1,n+1){
        range(j,maxs+1){
            if (j-i>=0){
                dp[i][j]=dp[i-1][j];
            }
            else{
                dp[i][j]=dp[i-1][j]+dp[i][j-i];
            }

        }
    }
    cout << dp[n][maxs];
}
0