結果

問題 No.138 化石のバージョン
ユーザー yozayoza
提出日時 2015-02-25 19:32:10
言語 Nim
(2.0.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 410 bytes
コンパイル時間 802 ms
コンパイル使用メモリ 56,636 KB
最終ジャッジ日時 2023-09-11 07:49:29
合計ジャッジ時間 1,358 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
/home/judge/data/code/Main.nim(14, 50) Error: undeclared identifier: 'it'
candidates (edit distance, scope distance); see '--spellSuggest': 
 (1, 2): 'in' [template declared in /nim-1.6.12/lib/system.nim(825, 10)]
 (1, 2): 'int' [type declared in /nim-1.6.12/lib/system/basic_types.nim(2, 3)]
 (1, 2): 'io' [module declared in /nim-1.6.12/lib/system.nim(3121, 14)]
 (1, 2): 'is' [proc declared in /nim-1.6.12/lib/system.nim(838, 6)]

ソースコード

diff #

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