結果
| 問題 | No.123 カードシャッフル |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-06-17 23:56:25 |
| 言語 | F# (F# 10.0) |
| 結果 |
AC
|
| 実行時間 | 2,806 ms / 5,000 ms |
| コード長 | 358 bytes |
| 記録 | |
| コンパイル時間 | 6,790 ms |
| コンパイル使用メモリ | 211,856 KB |
| 実行使用メモリ | 82,560 KB |
| 最終ジャッジ日時 | 2026-04-25 21:45:37 |
| 合計ジャッジ時間 | 16,489 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 10 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (169 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net10.0/main.dll main -> /home/judge/data/code/bin/Release/net10.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"