結果
問題 | No.123 カードシャッフル |
ユーザー | regerege |
提出日時 | 2016-06-17 23:56:25 |
言語 | F# (F# 4.0) |
結果 |
AC
|
実行時間 | 3,141 ms / 5,000 ms |
コード長 | 358 bytes |
コンパイル時間 | 9,427 ms |
コンパイル使用メモリ | 186,388 KB |
実行使用メモリ | 75,220 KB |
最終ジャッジ日時 | 2024-04-17 23:41:24 |
合計ジャッジ時間 | 22,777 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 295 ms
34,784 KB |
testcase_01 | AC | 305 ms
34,764 KB |
testcase_02 | AC | 293 ms
34,768 KB |
testcase_03 | AC | 294 ms
35,048 KB |
testcase_04 | AC | 296 ms
35,028 KB |
testcase_05 | AC | 293 ms
35,044 KB |
testcase_06 | AC | 297 ms
34,912 KB |
testcase_07 | AC | 296 ms
35,180 KB |
testcase_08 | AC | 300 ms
34,920 KB |
testcase_09 | AC | 296 ms
35,032 KB |
testcase_10 | AC | 312 ms
44,056 KB |
testcase_11 | AC | 3,141 ms
75,220 KB |
testcase_12 | AC | 3,115 ms
75,044 KB |
testcase_13 | AC | 3,119 ms
75,168 KB |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (244 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] |> int let ss = stdin.ReadLine().Split(' ') |> Seq.map int |> Seq.toList let rec ml i p l = function | x::xs -> ml i (p+1) (if i = p then x::l else l@[x]) xs | _ -> l let rec f c = function | s::ss -> if s = 1 then f c ss else f (ml s 1 [] c) ss | _ -> c.[0] f [1..N] ss |> printfn "%d"