結果

問題 No.138 化石のバージョン
コンテスト
ユーザー yoza
提出日時 2015-02-25 19:32:10
言語 Nim
(2.2.8)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 410 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 989 ms
コンパイル使用メモリ 65,152 KB
最終ジャッジ日時 2026-05-10 04:11:24
合計ジャッジ時間 1,854 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
/home/judge/data/code/Main.nim(14, 38) Error: type mismatch
Expression: mapIt(split(readLine(stdin), '.', -1), int, it.parseInt)
  [1] split(readLine(stdin), '.', -1): seq[string]
  [2] int: typedesc[int]
  [3] it.parseInt: untyped

Expected one of (first mismatch at [position]):
[3] template mapIt(s: typed; op: untyped): untyped
  extra argument given

ソースコード

diff #
raw source code

import strutils, sequtils, math

proc judge(a, b: openArray[int]; depth: int): string =
  if depth == 3:
    return "YES"
  if a[depth] > b[depth]:
    return "YES"
  elif a[depth] < b[depth]:
    return "NO"
  else:
    return judge(a, b, depth + 1)

var
  a_seq = split(readLine(stdin), '.').mapIt(int, it.parseInt)
  b_seq = split(readLine(stdin), '.').mapIt(int, it.parseInt)

echo(judge(a_seq, b_seq, 0))
0