結果

問題 No.548 国士無双
コンテスト
ユーザー natoriusan
提出日時 2023-08-07 19:17:24
言語 F#
(F# 10.0)
コンパイル:
fsharp_c _filename_
実行:
/usr/bin/dotnet_wrap
結果
AC  
実行時間 54 ms / 2,000 ms
コード長 489 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 8,549 ms
コンパイル使用メモリ 206,684 KB
実行使用メモリ 33,536 KB
最終ジャッジ日時 2026-05-08 07:35:26
合計ジャッジ時間 11,669 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (198 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net10.0/main.dll
  main -> /home/judge/data/code/bin/Release/net10.0/publish/

ソースコード

diff #
raw source code

let s = stdin.ReadLine ()

if s |> Seq.sort |> Seq.map string |> String.concat "" = "abcdefghijklm" then
    "abcdefghijklm" |> Seq.iter (printfn "%c")
else
    let count =
        [|
            for i in "abcdefghijklm" ->
                s |> Seq.filter ((=)i) |> Seq.length
        |]
    if count |> Array.filter ((=)1) |> Array.length = 11 then
        count |> Array.findIndex ((=)0) |> (Array.get <| Array.ofSeq "abcdefghijklm") |> printfn "%c"
    else
        printfn "Impossible"
0