結果

問題 No.548 国士無双
ユーザー むらため
提出日時 2018-12-18 06:24:52
言語 Nim
(2.2.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 314 bytes
コンパイル時間 3,376 ms
コンパイル使用メモリ 70,272 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-01 06:04:01
合計ジャッジ時間 4,249 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]

ソースコード

diff #

import sequtils,strutils,algorithm,tables
template get*():string = stdin.readLine().strip()
let s = stdin.readLine.sorted(cmp)
if s.join("") == "abcdefghijklm":
  echo s.join("\n")
elif s[0] < 'a' or s[^1] > 'm' or s.toCountTable().len < 12:
  echo "Impossible"
else:
  for c in 'a'..'m':
    if c notin s : echo c
0