結果
問題 | No.863 計算量 |
ユーザー |
![]() |
提出日時 | 2019-08-17 10:31:53 |
言語 | Nim (2.2.0) |
結果 |
CE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,472 bytes |
コンパイル時間 | 865 ms |
コンパイル使用メモリ | 70,980 KB |
最終ジャッジ日時 | 2024-11-14 21:34:27 |
合計ジャッジ時間 | 1,244 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
stack trace: (most recent call last) Main.nim(7, 9) unpack /home/judge/data/code/Main.nim(33, 17) template/generic instantiation of `input` from here /home/judge/data/code/Main.nim(13, 44) template/generic instantiation of `unpack` from here /home/judge/data/code/Main.nim(7, 9) Error: index 1 not in 0 .. 0
ソースコード
#import algorithm, future, macros, math, sequtils, sets, strutils, tablesimport algorithm, sugar, macros, math, sequtils, sets, strutils, tablesmacro unpack(rhs: seq, cnt: static[int]): auto =let t = genSym(); result = quote do:(let `t` = `rhs`;())if NimMinor <= 17:for i in 0..<cnt: result[0][1].add(quote do:`t`[`i`])else:for i in 0..<cnt: result[1].add(quote do:`t`[`i`])template input(T: typedesc, cnt: Natural = 1): untyped =let line = stdin.readLine.split(" ")when T is int: line.map(parseInt).unpack(cnt)elif T is float: line.map(parseFloat).unpack(cnt)elif T is string: line.unpack(cnt)elif T is char: line.mapIt(it[0]).unpack(cnt)elif T is seq[int]: line.map(parseint)elif T is seq[float]: line.map(parseFloat)elif T is seq[string]: lineelif T is seq[char]: line.mapIt(it[0])proc `%=`(n: var int, m: int) = n = n mod mproc `//=`(n: var int, m: int) = n = n div mproc `<<=`(n: var int, m: int) = n = n shl mproc `>>=`(n: var int, m: int) = n = n shr mproc `<?=`(n: var SomeNumber, m: SomeNumber) = n = min(n, m)proc `>?=`(n: var SomeNumber, m: SomeNumber) = n = max(n, m)proc newSeq2[T](n1, n2: Natural): seq[seq[T]] = newSeqWith(n1, newSeq[T](n2))proc newSeq3[T](n1, n2, n3: Natural): seq[seq[seq[T]]] = newSeqWith(n1, newSeqWith(n2, newSeq[T](n3)))# -------------------------------------------------- #var A, B = input(int)if B div A < 100:echo 1else:echo 2