結果
問題 | No.250 atetubouのzetubou |
ユーザー |
|
提出日時 | 2022-10-04 19:33:06 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 58 ms / 5,000 ms |
コード長 | 683 bytes |
コンパイル時間 | 1,816 ms |
コンパイル使用メモリ | 197,512 KB |
最終ジャッジ日時 | 2025-02-07 21:21:45 |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); vector<vector<ll>> table(1501, vector<ll>(1501, -1)); const ll INF = 1e15+1; auto f = [&table](ll D, ll X) { if(table[D][X] != -1) return table[D][X]; ll ans = 1; for(ll i = 1; i < D; i++) { ans *= X + i; ans /= i; if(ans >= INF) return INF; } return table[D][X] = ans; }; int Q; cin >> Q; rep(_,Q) { ll D,X,T; cin >> D >> X >> T; cout << (f(D, X) <= T ? "AC" : "ZETUBOU") << "\n"; } }