結果
| 問題 |
No.26 シャッフルゲーム
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-01-10 17:38:31 |
| 言語 | F# (F# 4.0) |
| 結果 |
AC
|
| 実行時間 | 90 ms / 5,000 ms |
| コード長 | 622 bytes |
| コンパイル時間 | 13,148 ms |
| コンパイル使用メモリ | 192,652 KB |
| 実行使用メモリ | 32,256 KB |
| 最終ジャッジ日時 | 2024-09-19 15:57:07 |
| 合計ジャッジ時間 | 14,717 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (293 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 ``No.26 シャッフルゲーム`` () =
let N = int <| stdin.ReadLine()
let M = int <| stdin.ReadLine()
let rec f s bit =
if s <= 0 then bit - (bit>>>2)
else
let arr =
stdin.ReadLine().Split(' ')
|> Array.map int
|> Array.sort
let a,b2 = arr.[0],arr.[1]
let n = b2 - a
let b = 1 <<< (b2 - 1)
let c = (((bit&&&b)>>>n)|||((bit&&&a)<<<n))
let d = if c = 0 then bit else c
f (s-1) d
f M (1 <<< N - 1)
|> printfn "%A"
``No.26 シャッフルゲーム`` ()