結果
| 問題 |
No.250 atetubouのzetubou
|
| コンテスト | |
| ユーザー |
femto
|
| 提出日時 | 2016-01-16 18:28:12 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 764 bytes |
| コンパイル時間 | 503 ms |
| コンパイル使用メモリ | 61,400 KB |
| 実行使用メモリ | 198,628 KB |
| 最終ジャッジ日時 | 2024-09-19 20:14:17 |
| 合計ジャッジ時間 | 2,815 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 1 |
| other | AC * 5 WA * 15 |
ソースコード
#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) {
cout << "AC" << endl;
}
else {
cout << "ZETUBOU" << endl;
}
}
}
femto