結果
問題 |
No.2 素因数ゲーム
|
ユーザー |
|
提出日時 | 2022-07-17 01:45:50 |
言語 | OCaml (5.2.1) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 590 bytes |
コンパイル時間 | 1,027 ms |
コンパイル使用メモリ | 21,576 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-29 02:44:33 |
合計ジャッジ時間 | 1,579 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
ソースコード
Scanf.scanf "%d" (fun n -> let factor k = let rec loop r i acc = if r = 1 then acc else if i * i > r then 1 :: acc else if r mod i <> 0 then loop r (i + 1) acc else let rec loop2 r c = if r mod i = 0 then loop2 (r / i) (c + 1) else loop r (i + 1) (c :: acc) in loop2 r 0 in loop k 2 [] in print_endline @@ if 0 <> List.fold_left (lxor) 0 (factor n) then "Alice" else "Bob" )