結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー mkanenobumkanenobu
提出日時 2018-09-19 16:53:35
言語 Nim
(2.0.2)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 362 bytes
コンパイル時間 874 ms
コンパイル使用メモリ 64,932 KB
最終ジャッジ日時 2024-04-27 02:36:46
合計ジャッジ時間 1,230 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
/home/judge/data/code/Main.nim(8, 13) Error: type mismatch
Expression: isDigit(s)
  [1] s: string

Expected one of (first mismatch at [position]):
[1] func isDigit(c: char): bool

ソースコード

diff #

import sequtils, strutils, algorithm, math

var
  a:string = readLine(stdin)
  b:string = readLine(stdin)

proc checker(s:string): bool =
  if isDigit(s):
    if parseInt(s) > 12345:
      return false
    if s.len > 1:
      if s[0] == '0':
        return false
  else:
    return false
  return true

if checker(a) and checker(b):
  echo "OK"
else:
  echo "NG"
0