結果
問題 | No.123 カードシャッフル |
ユーザー |
|
提出日時 | 2016-06-17 23:56:25 |
言語 | F# (F# 4.0) |
結果 |
AC
|
実行時間 | 3,199 ms / 5,000 ms |
コード長 | 358 bytes |
コンパイル時間 | 8,771 ms |
コンパイル使用メモリ | 186,212 KB |
実行使用メモリ | 75,356 KB |
最終ジャッジ日時 | 2024-10-09 17:29:14 |
合計ジャッジ時間 | 22,205 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 10 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (295 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 N = stdin.ReadLine().Split(' ').[0] |> intlet ss = stdin.ReadLine().Split(' ') |> Seq.map int |> Seq.toListlet rec ml i p l = function| x::xs -> ml i (p+1) (if i = p then x::l else l@[x]) xs| _ -> llet rec f c = function| s::ss ->if s = 1 then f c sselse f (ml s 1 [] c) ss| _ -> c.[0]f [1..N] ss|> printfn "%d"