結果
| 問題 |
No.250 atetubouのzetubou
|
| コンテスト | |
| ユーザー |
walkre
|
| 提出日時 | 2015-08-01 16:26:28 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 84 ms / 5,000 ms |
| コード長 | 1,240 bytes |
| コンパイル時間 | 1,478 ms |
| コンパイル使用メモリ | 160,492 KB |
| 実行使用メモリ | 81,024 KB |
| 最終ジャッジ日時 | 2024-07-18 00:31:31 |
| 合計ジャッジ時間 | 3,450 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,x,y) for(int i=(x);i<(y);++i)
#define mp(a,b) make_pair((a),(b))
#define debug(x) #x << "=" << (x)
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define dump(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define dump(x)
#endif
typedef long long int ll;
typedef pair<int,int> pii;
//template<typename T> using vec=std::vector<T>;
const int INF=1<<30;
const long long int INFLL=1LL<<58;
const double EPS=1e-9;
const int dx[]={1,0,-1,0},dy[]={0,1,0,-1};
template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec){
os << "[";
for (const auto &v : vec) {
os << v << ",";
}
os << "]";
return os;
}
void Solve(){
static ll comb[4000][4000];
const ll maxi=1e15+1;
rep(i,0,4000) comb[i][0]=1;
rep(i,0,4000) comb[i][i]=1;
rep(i,1,4000){
rep(j,1,i+1){
if(comb[i-1][j-1]>=maxi||comb[i-1][j]>=maxi){
comb[i][j]=maxi;
continue;
}
comb[i][j]=comb[i-1][j-1]+comb[i-1][j];
}
}
int q;
cin >> q;
rep(i,0,q){
ll d,x,t;
cin >> d >> x >> t;
if(comb[x+d-1][d-1]<=t) cout << "AC" << endl;
else cout << "ZETUBOU" << endl;
}
}
int main(){
std::ios::sync_with_stdio(false);
std::cin.tie(0);
Solve();
return 0;
}
walkre