結果
問題 | No.250 atetubouのzetubou |
ユーザー | irohasu_takaoka |
提出日時 | 2019-02-18 22:01:43 |
言語 | C++11 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 64 ms / 5,000 ms |
コード長 | 1,090 bytes |
コンパイル時間 | 1,581 ms |
コンパイル使用メモリ | 157,796 KB |
実行使用メモリ | 50,048 KB |
最終ジャッジ日時 | 2024-04-17 01:10:15 |
合計ジャッジ時間 | 3,845 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 46 ms
49,792 KB |
testcase_01 | AC | 29 ms
49,920 KB |
testcase_02 | AC | 58 ms
49,792 KB |
testcase_03 | AC | 64 ms
49,920 KB |
testcase_04 | AC | 58 ms
49,664 KB |
testcase_05 | AC | 60 ms
50,048 KB |
testcase_06 | AC | 52 ms
49,920 KB |
testcase_07 | AC | 38 ms
49,920 KB |
testcase_08 | AC | 57 ms
49,920 KB |
testcase_09 | AC | 48 ms
49,920 KB |
testcase_10 | AC | 58 ms
49,920 KB |
testcase_11 | AC | 46 ms
49,792 KB |
testcase_12 | AC | 55 ms
49,792 KB |
testcase_13 | AC | 43 ms
49,792 KB |
testcase_14 | AC | 26 ms
49,920 KB |
testcase_15 | AC | 61 ms
49,920 KB |
testcase_16 | AC | 61 ms
49,920 KB |
testcase_17 | AC | 63 ms
50,048 KB |
testcase_18 | AC | 63 ms
49,920 KB |
testcase_19 | AC | 62 ms
49,920 KB |
testcase_20 | AC | 26 ms
49,792 KB |
testcase_21 | AC | 26 ms
49,920 KB |
ソースコード
#include<cstdio> #include<bits/stdc++.h> typedef long long int ll; #define REP(i, n) for(int i = 0; i < (n); i++) #define FOR_IN(i, a, b) for(int i = (a); i < (b); i++) #define BETWEEN(x, a, b) ((x) >= (a) && (x) <= (b)) #define BIT(b, i) (((b) >> (i)) & 1) #define LOG_F 1 #define LOG(...) if(LOG_F) fprintf(stderr, __VA_ARGS__) using namespace std; ll pow(int x, int n){ return n == 0 ? 1 : x * pow(x, n - 1); } /* q d1 x1 t1 AC ZETUBOU */ const ll INF = pow(10,18) ; int q; ll comb[3001][3001]; void create_comb_table(){ int n = 3000; REP(i,n+1){ comb[i][0] = 1; comb[i][i] = 1; } REP(i,n){ REP(j,i){ if(comb[i][j+1] >= INF || comb[i][j] >= INF) comb[i+1][j+1] = INF; else comb[i+1][j+1] = comb[i][j+1] + comb[i][j]; if(comb[i+1][j+1] > INF) comb[i+1][j+1] = INF; } } } int main(){ create_comb_table(); cin>>q; REP(k,q){ int d,x; ll t,T; cin>>d>>x>>t; T=comb[x+d-1][d-1]; if(T>t){ cout<<"ZETUBOU\n"; } else { cout<<"AC\n"; } LOG("T=%lld\n",T); } return 0; }