結果

問題 No.250 atetubouのzetubou
ユーザー te-shte-sh
提出日時 2017-05-25 17:22:45
言語 D
(dmd 2.107.1)
結果
AC  
実行時間 2,739 ms / 5,000 ms
コード長 645 bytes
コンパイル時間 1,731 ms
コンパイル使用メモリ 159,864 KB
実行使用メモリ 24,752 KB
最終ジャッジ日時 2023-09-03 13:35:40
合計ジャッジ時間 31,149 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,579 ms
23,020 KB
testcase_01 AC 277 ms
13,396 KB
testcase_02 AC 2,429 ms
23,016 KB
testcase_03 AC 2,739 ms
24,136 KB
testcase_04 AC 2,406 ms
24,752 KB
testcase_05 AC 2,482 ms
23,216 KB
testcase_06 AC 1,911 ms
23,028 KB
testcase_07 AC 929 ms
20,856 KB
testcase_08 AC 2,263 ms
23,292 KB
testcase_09 AC 1,723 ms
23,896 KB
testcase_10 AC 2,455 ms
24,204 KB
testcase_11 AC 1,472 ms
23,048 KB
testcase_12 AC 2,239 ms
24,148 KB
testcase_13 AC 1,223 ms
22,488 KB
testcase_14 AC 20 ms
10,120 KB
testcase_15 AC 55 ms
10,116 KB
testcase_16 AC 55 ms
8,736 KB
testcase_17 AC 55 ms
8,264 KB
testcase_18 AC 54 ms
8,500 KB
testcase_19 AC 55 ms
8,260 KB
testcase_20 AC 1 ms
4,380 KB
testcase_21 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.algorithm, std.conv, std.range, std.stdio, std.string;
import std.bigint;    // BigInt

void main()
{
  auto q = readln.chomp.to!size_t;
  auto di = new int[](q), xi = new int[](q), ti = new long[](q);
  foreach (i; 0..q) {
    auto rd = readln.split;
    di[i] = rd[0].to!int; xi[i] = rd[1].to!int; ti[i] = rd[2].to!long;
  }

  auto maxXD = zip(di, xi).map!"a[0] + a[1]".maxElement;
  auto facts = new BigInt[](maxXD);
  facts[0] = 1;
  foreach (i; 1..maxXD)
    facts[i] = facts[i-1] * i;

  foreach (d, x, t; lockstep(di, xi, ti)) {
    auto c = facts[x+d-1] / facts[x] / facts[d-1];
    writeln(c <= t ? "AC" : "ZETUBOU");
  }
}
0