結果
問題 |
No.927 Second Permutation
|
ユーザー |
|
提出日時 | 2023-08-01 21:27:29 |
言語 | F# (F# 4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 400 bytes |
コンパイル時間 | 11,799 ms |
コンパイル使用メモリ | 184,420 KB |
実行使用メモリ | 36,736 KB |
最終ジャッジ日時 | 2024-10-11 12:47:06 |
合計ジャッジ時間 | 17,750 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 WA * 3 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (366 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
let x = stdin.ReadLine () |> Seq.sortDescending |> Seq.map string |> String.concat "" if x.Length = 1 || (x.Length = 2 && x.[1] = '0') || Seq.forall ((=)x.[0]) x then "-1" else let mutable index = x.Length - 2 while x.[index] = x.[index+1] do index <- index - 1 (if index = 0 then "" else x.[..index-1]) + string x.[index+1] + string x.[index] + x.[index+2..] |> printfn "%s"