結果
問題 | No.250 atetubouのzetubou |
ユーザー |
![]() |
提出日時 | 2016-01-16 18:29:18 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 73 ms / 5,000 ms |
コード長 | 792 bytes |
コンパイル時間 | 408 ms |
コンパイル使用メモリ | 60,332 KB |
実行使用メモリ | 119,936 KB |
最終ジャッジ日時 | 2024-09-19 20:14:20 |
合計ジャッジ時間 | 2,615 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 |
ソースコード
#include <iostream>#include <vector>#include <string>#include <algorithm>using namespace std;typedef long long ll;const int SIZE = 5000;const ll MAX = ll(1e15);ll c[SIZE][SIZE];int main(){cin.tie(0);ios::sync_with_stdio(false);c[0][0] = 1;for(int i = 1; i < SIZE; i++) {for(int j = 0; j <= i; j++) {if(j == 0 || i == j) {c[i][j] = 1;}else if(c[i - 1][j - 1] == -1 || c[i - 1][j] == -1) {c[i][j] = -1;}else {c[i][j] = c[i - 1][j - 1] + c[i - 1][j];if(c[i][j] >= MAX)c[i][j] = -1;}}}ll q;cin >> q;for(int loop = 0; loop < q; loop++) {ll d, x, t;cin >> d >> x >> t;if(c[x + d - 1][d - 1] > t || c[x + d - 1][d - 1] == -1) {cout << "ZETUBOU" << endl;}else {cout << "AC" << endl;}}}