結果

問題 No.2562 数字探しゲーム(緑以下コンver.)
ユーザー ngng628ngng628
提出日時 2023-12-02 15:09:24
言語 Crystal
(1.11.2)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 320 bytes
コンパイル時間 11,801 ms
コンパイル使用メモリ 292,872 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-12-02 15:09:43
合計ジャッジ時間 12,935 ms
ジャッジサーバーID
(参考情報)
judge11 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,548 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 26 ms
6,676 KB
testcase_05 AC 26 ms
6,676 KB
testcase_06 AC 25 ms
6,676 KB
testcase_07 AC 25 ms
6,676 KB
testcase_08 AC 26 ms
6,676 KB
testcase_09 AC 26 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

t = read_line.to_i64
t.times do
  m = read_line.to_i64
  d = read_line.split.map &.to_i64

  now = 0_i64
  d.each_with_index(1) do |num, i|
    num.times do
      now = 10_i64 * now + i
    end
  end
  now *= 10_i64**9
  added = m - now % m
  if added % m == 0
    added = 0_i64
  end
  ans = now + added
  puts ans
end
0