結果
| 問題 |
No.250 atetubouのzetubou
|
| コンテスト | |
| ユーザー |
どらら
|
| 提出日時 | 2015-09-27 04:04:01 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,184 bytes |
| コンパイル時間 | 527 ms |
| コンパイル使用メモリ | 79,928 KB |
| 実行使用メモリ | 55,168 KB |
| 最終ジャッジ日時 | 2024-07-19 10:47:16 |
| 合計ジャッジ時間 | 13,318 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 2 |
| other | TLE * 1 -- * 19 |
ソースコード
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <iostream>
#include <queue>
#include <list>
#include <stack>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
ll f[5000][5000];
ll Comb(int n, int k){
if(n-k<k) k = n-k;
if(k==0) return 1;
if(k==1) return n;
for(int i=0; i<n+1; i++) f[0][i] = f[i][0] = 1;
for(int i=1; i<n+1; i++) for(int j=1; j<n+1; j++){
f[i][j] = f[i-1][j]+f[i][j-1];
if(f[i][j]>1000000000000000LL||f[i-1][j]<0||f[i][j-1]<0) f[i][j]=-1LL;
if(i+j==n && j==k) return f[i][j];
}
return 1;
}
bool calc(ll D, ll X, ll T){
ll res = Comb(X+D-1, D-1);
if(res == -1) return false;
return res <= T;
}
int main(){
int Q;
cin >> Q;
rep(i,Q){
ll D, X, T;
cin >> D >> X >> T;
if(calc(D, X, T)) cout << "AC" << endl;
else cout << "ZETUBOU" << endl;
}
return 0;
}
どらら