結果
問題 | No.250 atetubouのzetubou |
ユーザー |
|
提出日時 | 2020-04-13 11:41:26 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 91 ms / 5,000 ms |
コード長 | 919 bytes |
コンパイル時間 | 826 ms |
コンパイル使用メモリ | 75,080 KB |
最終ジャッジ日時 | 2025-01-09 17:55:47 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 |
ソースコード
#include <iostream> #include <vector> template <class T> std::vector<T> vec(int len, T elem) { return std::vector<T>(len, elem); } using lint = long long; constexpr int X = 3000; constexpr lint INF = 1LL << 50; std::vector<std::vector<lint>> comb; void init() { comb = vec(X + 1, vec(X + 1, 0LL)); comb[0][0] = 1; for (int x = 1; x <= X; ++x) { for (int y = 0; y <= x; ++y) { comb[x][y] = (y > 0 ? comb[x - 1][y - 1] : 0) + (y < x ? comb[x - 1][y] : 0); comb[x][y] = std::min(comb[x][y], INF); } } } void solve() { int d, x; lint t; std::cin >> d >> x >> t; std::cout << (comb[x + d - 1][d - 1] <= t ? "AC" : "ZETUBOU") << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); init(); int q; std::cin >> q; while (q--) solve(); return 0; }