結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 109 ms
90,308 KB
testcase_16 AC 109 ms
90,444 KB
testcase_17 AC 100 ms
90,348 KB
testcase_18 AC 104 ms
90,340 KB
testcase_19 AC 102 ms
90,356 KB
testcase_20 AC 96 ms
90,500 KB
testcase_21 AC 99 ms
90,500 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] >= 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];
      }
    }
  }
  
  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