結果
問題 | No.250 atetubouのzetubou |
ユーザー |
![]() |
提出日時 | 2015-09-25 09:10:22 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 23 ms / 5,000 ms |
コード長 | 607 bytes |
コンパイル時間 | 435 ms |
コンパイル使用メモリ | 57,428 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-19 09:11:01 |
合計ジャッジ時間 | 1,345 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 |
ソースコード
#include<iostream>#include<algorithm>const long long INF = 1e15 + 1;long long combination(int n, int r) {r = std::min(r, n - r);long long val = 1;for (int i = 1; i <= r; i++) {val *= n + 1 - i;val /= i;if (val >= INF) {return INF;}}return val;}int main() {int query_num;std::cin >> query_num;for (int i = 0; i < query_num; i++) {long long loop, value, limit;std::cin >> loop >> value >> limit;loop--;if (combination(loop + value, value) > limit) {std::cout << "ZETUBOU" << std::endl;} else {std::cout << "AC" << std::endl;}}return 0;}