結果

問題 No.293 4>7の世界
コンテスト
ユーザー n_knuu
提出日時 2016-04-05 10:04:52
言語 Nim
(2.2.6)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 386 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,251 ms
コンパイル使用メモリ 69,900 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-03-19 01:45:47
合計ジャッジ時間 3,206 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 18) Warning: imported and not used: 'sequtils' [UnusedImport]

ソースコード

diff #
raw source code

import strutils, sequtils
let
  input = stdin.readline.split
  (A, B) = (input[0], input[1])
if A.len != B.len:
   echo(if A.len > B.len: A else: B)
else:
  for i in 0..<A.len:
    var
      a = A[i]
      b = B[i]
    if a != b:
      if a == '4' and b == '7':
        echo(A)
      elif a == '7' and b == '4':
        echo(B)
      else:
        echo(if a > b: A else: B)
      break
0