結果

問題 No.250 atetubouのzetubou
ユーザー kpinkcatkpinkcat
提出日時 2023-11-09 17:44:02
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,013 bytes
コンパイル時間 2,184 ms
コンパイル使用メモリ 206,616 KB
実行使用メモリ 79,776 KB
最終ジャッジ日時 2023-11-09 17:44:18
合計ジャッジ時間 15,151 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
#include<vector>
#include<set>
#include<list>
#include<queue>
#include<math.h>
#include<bitset>
using ll = long long;
using namespace std;

ll comb(int n, int r, int t){
    vector<vector<ll>> c(n+1, vector<ll>(n+1)); 
    for (int i = 1; i <= n; i++){
        c[i][0] = 1;
        c[i][i] = 1;
        for (int j = 1; j < i; j++){
            if (j < r && c[i][j-1] > t){
                return c[i][j-1];
            }
            if (j == 1) c[i][j] = i;
            else c[i][j] = c[i-1][j-1] + c[i-1][j];
        }
    }
    return c[n][r];
}

int main()
{
    int q;
    cin >> q;
    for (int i = 0; i < q; i++){
        ll d, x, t;
        bool ac = false;
        cin >> d >> x >> t;
        if (d == 1){
            if (t >= 1) ac = true;
        } else {
            if (t >= comb(d+x-1, d-1, t)) ac = true;
        }
        if (ac) cout << "AC" << endl;
        else cout << "ZETUBOU" << endl;
    }
}
0