結果

問題 No.293 4>7の世界
ユーザー kou_kkk
提出日時 2025-02-26 12:42:33
言語 Nim
(2.2.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 372 bytes
コンパイル時間 5,811 ms
コンパイル使用メモリ 67,132 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-02-26 12:42:40
合計ジャッジ時間 6,310 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]

ソースコード

diff #

import sequtils, strutils


func `>?`(x, y: char): bool =
  if x == '4' and y == '7': return true
  if x == '7' and y == '4': return false
  return x > y


const
  z = "0000000000"

let
  ab = stdin.readLine.split
var
  a = ab[0]
  b = ab[1]

a = (z & a)[^10..^1]
b = (z & b)[^10..^1]

var
  i = 0

while a[i] == b[i]:
  inc i

echo:
  if a[i] >? b[i]: ab[0]
  else: ab[1]
0