結果
問題 | No.8041 なんとかのはなうらない |
ユーザー |
![]() |
提出日時 | 2019-04-01 21:08:21 |
言語 | Nim (2.2.0) |
結果 |
CE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,045 bytes |
コンパイル時間 | 1,228 ms |
コンパイル使用メモリ | 80,324 KB |
最終ジャッジ日時 | 2024-11-14 21:22:38 |
合計ジャッジ時間 | 1,772 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
stack trace: (most recent call last) Main.nim(6, 9) unpack /home/judge/data/code/Main.nim(25, 14) template/generic instantiation of `input` from here /home/judge/data/code/Main.nim(18, 43) template/generic instantiation of `unpack` from here /home/judge/data/code/Main.nim(6, 9) Error: index 1 not in 0 .. 0
ソースコード
import algorithm, hashes, macros, math, sequtils, sets, strutils, tables, times, unicodemacro 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*(typ: typedesc, cnt: Natural = 0): untyped =let line = stdin.readLine.split(" ")when cnt == 0:when typ is int: line.map(parseInt)elif typ is float: line.map(parseFloat)elif typ is string: lineelif typ is char: line.mapIt(it[0])else:when typ is int: line.map(parseInt).unpack(cnt)elif typ is float: line.map(parseFloat).unpack(cnt)elif typ is string: line.unpack(cnt)elif typ is char: line.mapIt(it[0]).unpack(cnt)# -------------------------------------------------- #var N = input(int, 1)if N mod 2 == 0:if N mod 4 == 1:echo "No"else:echo "Yes"else:if N mod 4 == 0:echo "No"else:echo "Yes"