結果

問題 No.250 atetubouのzetubou
ユーザー aa
提出日時 2016-07-09 05:25:42
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 636 bytes
コンパイル時間 605 ms
コンパイル使用メモリ 37,364 KB
実行使用メモリ 55,236 KB
最終ジャッジ日時 2024-04-21 09:14:19
合計ジャッジ時間 3,050 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 60 ms
51,072 KB
testcase_16 AC 63 ms
51,072 KB
testcase_17 AC 65 ms
51,072 KB
testcase_18 AC 69 ms
51,072 KB
testcase_19 AC 63 ms
51,072 KB
testcase_20 AC 63 ms
51,072 KB
testcase_21 AC 61 ms
51,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>

using namespace std;

typedef long long ll;

double dp[3333][3333];

int main(void) {
  int q;
  scanf("%d", &q);
  dp[0][0] = 1;

  for (int i = 0; i < 2222; i++) {
    for (int j = 0; j < 2222; j++) {
      if (dp[i][j] >= 1e15) {
        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];
      }
    }
  }
  
  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