結果

問題 No.441 和か積
コンテスト
ユーザー toshiro_yanagi
提出日時 2018-06-11 08:00:46
言語 Nim
(2.2.6)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 334 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,647 ms
コンパイル使用メモリ 68,484 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2026-03-20 13:53:26
合計ジャッジ時間 5,867 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 18) Warning: imported and not used: 'sequtils' [UnusedImport]

ソースコード

diff #
raw source code

import strutils, sequtils

proc trfm(x: string): int =
  case x:
    of "0", "1", "2":
      result = x.parseInt
    else:
      result = 3

let
  AB = stdin.readLine.split
  (A, B) = (AB[0], AB[1])

  a = A.trfm
  b = B.trfm

case a + b - a * b:
  of 1 .. int.high:
    echo "S"
  of int.low .. -1:
    echo "P"
  else:
    echo "E"
0