結果

問題 No.634 硬貨の枚数1
ユーザー むらためむらため
提出日時 2019-01-24 05:22:57
言語 Nim
(2.0.2)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 610 bytes
コンパイル時間 2,398 ms
コンパイル使用メモリ 66,320 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-14 02:41:52
合計ジャッジ時間 5,926 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 2 ms
4,380 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 2 ms
4,376 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 2 ms
4,376 KB
testcase_12 WA -
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 5 ms
4,376 KB
testcase_15 AC 24 ms
4,376 KB
testcase_16 AC 11 ms
4,380 KB
testcase_17 AC 14 ms
4,376 KB
testcase_18 AC 12 ms
4,380 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 28 ms
4,376 KB
testcase_22 AC 24 ms
4,376 KB
testcase_23 AC 10 ms
4,380 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 1 ms
4,376 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 2 ms
4,376 KB
testcase_31 AC 2 ms
4,376 KB
testcase_32 AC 2 ms
4,380 KB
testcase_33 AC 2 ms
4,380 KB
testcase_34 AC 3 ms
4,376 KB
testcase_35 AC 9 ms
4,376 KB
testcase_36 AC 18 ms
4,376 KB
testcase_37 AC 13 ms
4,380 KB
testcase_38 AC 4 ms
4,376 KB
testcase_39 AC 24 ms
4,380 KB
testcase_40 AC 17 ms
4,376 KB
testcase_41 AC 15 ms
4,380 KB
testcase_42 AC 22 ms
4,380 KB
testcase_43 AC 10 ms
4,380 KB
testcase_44 WA -
testcase_45 AC 2 ms
4,376 KB
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 AC 29 ms
4,376 KB
testcase_51 AC 5 ms
4,376 KB
testcase_52 WA -
testcase_53 AC 2 ms
4,380 KB
testcase_54 AC 2 ms
4,376 KB
testcase_55 AC 28 ms
4,380 KB
testcase_56 AC 28 ms
4,376 KB
testcase_57 AC 28 ms
4,380 KB
testcase_58 AC 28 ms
4,376 KB
testcase_59 AC 28 ms
4,380 KB
testcase_60 AC 26 ms
4,380 KB
testcase_61 AC 28 ms
4,376 KB
testcase_62 AC 28 ms
4,376 KB
testcase_63 AC 27 ms
4,380 KB
testcase_64 AC 28 ms
4,380 KB
testcase_65 AC 27 ms
4,380 KB
testcase_66 AC 29 ms
4,376 KB
testcase_67 AC 28 ms
4,380 KB
testcase_68 AC 28 ms
4,376 KB
testcase_69 AC 28 ms
4,376 KB
testcase_70 AC 28 ms
4,376 KB
testcase_71 AC 27 ms
4,376 KB
testcase_72 AC 27 ms
4,380 KB
testcase_73 AC 27 ms
4,380 KB
testcase_74 AC 27 ms
4,376 KB
testcase_75 AC 26 ms
4,376 KB
testcase_76 AC 1 ms
4,376 KB
testcase_77 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]

ソースコード

diff #

import sequtils,math
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

let n = scan()
const INF = 1000_0010
const C = (proc():seq[int] =
  result = @[]
  for i in 1..INF:
    let c = i * (i + 1) div 2
    if c > INF : break
    result &= c
)()
block:
  let nsq = (n*2).float.sqrt.int
  if nsq * (nsq + 1) div 2 == n: quit "1", 0
for i in 0..<C.len:
  for j in i..<C.len:
    let c = C[i] + C[j]
    if n == c: quit "2",0
    if c > n : break
echo 3
0