結果

問題 No.927 Second Permutation
ユーザー natoriusannatoriusan
提出日時 2023-08-01 21:37:53
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 409 bytes
コンパイル時間 6,705 ms
コンパイル使用メモリ 192,984 KB
実行使用メモリ 36,856 KB
最終ジャッジ日時 2024-04-19 20:40:44
合計ジャッジ時間 11,671 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 76 ms
30,848 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 76 ms
30,848 KB
testcase_06 AC 76 ms
31,232 KB
testcase_07 AC 80 ms
31,224 KB
testcase_08 AC 115 ms
33,528 KB
testcase_09 AC 80 ms
31,072 KB
testcase_10 AC 131 ms
34,304 KB
testcase_11 AC 159 ms
36,480 KB
testcase_12 AC 118 ms
33,792 KB
testcase_13 AC 88 ms
31,860 KB
testcase_14 AC 131 ms
34,560 KB
testcase_15 AC 118 ms
33,792 KB
testcase_16 AC 155 ms
36,856 KB
testcase_17 AC 159 ms
36,736 KB
testcase_18 AC 156 ms
36,736 KB
testcase_19 AC 155 ms
36,600 KB
testcase_20 AC 161 ms
36,728 KB
testcase_21 AC 158 ms
36,608 KB
testcase_22 AC 161 ms
36,736 KB
testcase_23 AC 161 ms
36,736 KB
testcase_24 AC 148 ms
36,352 KB
testcase_25 AC 122 ms
34,816 KB
testcase_26 AC 119 ms
33,920 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (217 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/

ソースコード

diff #

let x = stdin.ReadLine () |> Seq.sortDescending |> Seq.map string |> String.concat ""
if x.Length = 1 || Seq.forall ((=)x.[0]) x || Seq.filter ((=)'0') x |> Seq.length = 0 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"
0