結果
問題 | No.250 atetubouのzetubou |
ユーザー |
![]() |
提出日時 | 2016-02-21 14:55:05 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 28 ms / 5,000 ms |
コード長 | 696 bytes |
コンパイル時間 | 680 ms |
コンパイル使用メモリ | 56,164 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-22 12:33:52 |
合計ジャッジ時間 | 1,569 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 |
ソースコード
#include <iostream>using namespace std;typedef unsigned long long int64;int main(void){int q;cin >> q;for(int i = 0; i < q; i++) {int64 d, x, t;cin >> d >> x >> t;int64 m = d - 1;int64 n = x + m;m=min(m,n-m);int64 p = 1,bf=0;bool is_out = false;for(int64 j = 1; j <= m; j++) {p *= n - j + 1;p/=j;if(p > t||bf>p) {is_out = true;break;}bf=p;}if(m==0)is_out=t<p;if(!is_out)cout << "AC" << endl;elsecout << "ZETUBOU" << endl;}return 0;}