結果
問題 | No.318 学学学学学 |
ユーザー | yuppe19 😺 |
提出日時 | 2015-12-11 15:58:06 |
言語 | Nim (2.0.0) |
結果 |
CE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 518 bytes |
コンパイル時間 | 1,553 ms |
コンパイル使用メモリ | 58,936 KB |
最終ジャッジ日時 | 2023-09-11 22:44:13 |
合計ジャッジ時間 | 4,716 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
/home/judge/data/code/Main.nim(7, 14) Error: type mismatch: got <int> but expected one of: proc `<`(x, y: int): bool first type mismatch at position: 2 missing parameter: y proc `<`(x, y: int64): bool first type mismatch at position: 2 missing parameter: y 19 other mismatching symbols have been suppressed; compile with --showAllMismatches:on to see them expression: <n
ソースコード
import strutils, sequtils, tables var n = stdin.readLine.parseInt a = stdin.readLine.split.map(parseInt) dic = initOrderedTable[int, seq[int]]() for i in 0.. <n: var x: int var y: int if dic.hasKey(a[i]): var val = dic[a[i]] x = val[0] y = val[1] else: x = n y = -1 x = min(x, i) y = max(y, i) dic[a[i]] = @[x, y] dic.sort(proc (x,y:(int,seq[int])):int = cmp(x[0],y[0])) var b = newSeqWith(n, 0) for k, v in dic: for i in v[0]..v[1]: b[i] = k echo b.mapIt($it).join(" ")