結果

問題 No.250 atetubouのzetubou
ユーザー aa
提出日時 2016-07-09 05:31:14
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 639 bytes
コンパイル時間 465 ms
コンパイル使用メモリ 37,504 KB
実行使用メモリ 90,544 KB
最終ジャッジ日時 2024-04-21 09:17:46
合計ジャッジ時間 4,276 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
90,488 KB
testcase_01 AC 122 ms
90,476 KB
testcase_02 AC 131 ms
90,408 KB
testcase_03 AC 120 ms
90,436 KB
testcase_04 AC 115 ms
90,348 KB
testcase_05 AC 122 ms
90,268 KB
testcase_06 AC 130 ms
90,336 KB
testcase_07 AC 118 ms
90,404 KB
testcase_08 AC 125 ms
90,224 KB
testcase_09 AC 122 ms
90,396 KB
testcase_10 AC 124 ms
90,212 KB
testcase_11 AC 123 ms
90,400 KB
testcase_12 AC 117 ms
90,384 KB
testcase_13 AC 121 ms
90,260 KB
testcase_14 AC 121 ms
90,544 KB
testcase_15 AC 131 ms
90,496 KB
testcase_16 AC 123 ms
90,296 KB
testcase_17 AC 126 ms
90,356 KB
testcase_18 AC 118 ms
90,432 KB
testcase_19 AC 121 ms
90,388 KB
testcase_20 AC 118 ms
90,412 KB
testcase_21 AC 111 ms
90,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>

using namespace std;

typedef long long ll;

double dp[3333][3333];

int main(void) {
  dp[0][0] = 1;

  for (int i = 0; i < 3332; i++) {
    for (int j = 0; j < 3332; j++) {
      if (dp[i][j] >= 1e20) {
        dp[i][j] = -1;
      }
      if (dp[i][j] < 0) {
        dp[i+1][j] = dp[i+1][j+1] = -1;
      } else {
        dp[i+1][j] += dp[i][j];
        dp[i+1][j+1] += dp[i][j];
      }
    }
  }
  
  int q;
  scanf("%d", &q);
  
  for (int iii = 0; iii < q; iii++) {
    int d, x;
    ll t;
    scanf("%d%d%lld", &d, &x, &t);
    double s = dp[d+x-1][x];
    puts((s<0||s>t) ? "ZETUBOU" : "AC");
  }
  return 0;
}
0