結果

問題 No.250 atetubouのzetubou
ユーザー nasadigitalnasadigital
提出日時 2015-07-24 23:46:47
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 48 ms / 5,000 ms
コード長 815 bytes
コンパイル時間 563 ms
コンパイル使用メモリ 65,352 KB
実行使用メモリ 21,176 KB
最終ジャッジ日時 2023-09-22 23:54:59
合計ジャッジ時間 2,273 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
21,144 KB
testcase_01 AC 44 ms
21,172 KB
testcase_02 AC 46 ms
21,172 KB
testcase_03 AC 48 ms
21,088 KB
testcase_04 AC 47 ms
21,080 KB
testcase_05 AC 47 ms
21,156 KB
testcase_06 AC 47 ms
21,156 KB
testcase_07 AC 45 ms
21,060 KB
testcase_08 AC 46 ms
21,176 KB
testcase_09 AC 46 ms
21,096 KB
testcase_10 AC 45 ms
21,172 KB
testcase_11 AC 46 ms
21,152 KB
testcase_12 AC 46 ms
21,084 KB
testcase_13 AC 43 ms
21,136 KB
testcase_14 AC 40 ms
21,136 KB
testcase_15 AC 11 ms
21,072 KB
testcase_16 AC 11 ms
21,072 KB
testcase_17 AC 11 ms
21,120 KB
testcase_18 AC 11 ms
21,072 KB
testcase_19 AC 11 ms
21,076 KB
testcase_20 AC 7 ms
21,012 KB
testcase_21 AC 9 ms
21,064 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <cmath>
#include <utility>
#include <algorithm>
#include <vector>
#include <cstring>

#define _P(x) printf(x)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> ii;
typedef long long ll;

ll comb[1503][1503];

ll rek(int d,int x){
if(d<0 || x<0)
return 0;
if(d==0 && x==0)
	return 1;
if(comb[d][x]==-1){
comb[d][x]=rek(d-1,x)+rek(d,x-1);
if(comb[d][x]>1e15+2)
comb[d][x]=1e15+2;
}
return comb[d][x];
}


int main(){
ios::sync_with_stdio(false);
memset(comb,-1,sizeof(comb));
int q;
cin>>q;
while(q--){
ll d,x,t;
cin>>d>>x>>t;
//cout<<"REZ HERE IS:"<<rek(d-1,x)<<endl;
if(rek(d-1,x)<=t) _P("AC\n");
else _P("ZETUBOU\n");
}
return 0;
}
0