結果

問題 No.26 シャッフルゲーム
ユーザー regeregeregerege
提出日時 2016-01-11 19:00:43
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 599 bytes
コンパイル時間 7,000 ms
コンパイル使用メモリ 190,124 KB
実行使用メモリ 33,836 KB
最終ジャッジ日時 2023-10-19 22:48:19
合計ジャッジ時間 8,512 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (235 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

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 ^^^ a ^^^ b
            f (s-1) <| (((bit&&&b)>>>n)|||((bit&&&a)<<<n))|||c
    f M (1 <<< N - 1)
    |> printfn "%A"
``No.26 シャッフルゲーム`` ()
0