結果
| 問題 |
No.250 atetubouのzetubou
|
| コンテスト | |
| ユーザー |
koyumeishi
|
| 提出日時 | 2015-07-24 23:40:47 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 786 bytes |
| コンパイル時間 | 693 ms |
| コンパイル使用メモリ | 78,096 KB |
| 実行使用メモリ | 128,384 KB |
| 最終ジャッジ日時 | 2024-07-16 00:26:38 |
| 合計ジャッジ時間 | 4,172 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 6 WA * 14 |
ソースコード
#include <iostream>
#include <vector>
#include <cstdio>
#include <sstream>
#include <map>
#include <string>
#include <algorithm>
#include <queue>
#include <cmath>
#include <set>
using namespace std;
int main(){
int q;
cin >> q;
vector<vector<long long>> dp(4000, vector<long long>(4000,0));
dp[0][0] = 1;
for(int i=1; i<4000; i++){
for(int j=0; j<=i; j++){
if((dp[i-1][j] < 0) || (j>0 && dp[i-1][j] < 0) ){
dp[i][j] = -1;
continue;
}
dp[i][j] = dp[i-1][j] + (j>0?dp[i-1][j-1]:0);
if(dp[i][j] >= 1e16) dp[i][j] = -1;
}
}
while(q--){
long long d,x;
long long t;
cin >> d >> x >> t;
//cerr << dp[d+x-1][x] << endl;
if(dp[d+x-1][x] >= 0 && dp[d+x-1][x] <= t){
cout << "AC" << endl;
}else{
cout << "ZETUBOU" << endl;
}
}
return 0;
}
koyumeishi