結果

問題 No.523 LED
ユーザー むらためむらため
提出日時 2019-01-25 12:00:25
言語 Nim
(2.0.0)
結果
RE  
実行時間 -
コード長 498 bytes
コンパイル時間 3,905 ms
コンパイル使用メモリ 115,172 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-14 02:44:44
合計ジャッジ時間 5,010 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 RE -
testcase_03 AC 2 ms
4,384 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 RE -
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 RE -
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "<stdio.h>" .}
proc scan(): int =
  while true:
    let k = getchar_unlocked()
    if k < '0': break
    result = 10 * result + k.ord - '0'.ord

const MOD = 1000000007
# const preCalcedNum = 1_00_0000
const results = (proc ():seq[int] =
  result = newSeq[int](1_0_0001)
  var ans = 1
  for i in 1..1_0_0000:
    let m = (i * (2 * i - 1)) mod MOD
    ans = ( ans * m ) mod MOD
    result[i] = ans
)()
let n = scan()
echo results[n]
0