結果
問題 |
No.2 素因数ゲーム
|
ユーザー |
|
提出日時 | 2022-07-17 01:48:18 |
言語 | OCaml (5.2.1) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 517 bytes |
コンパイル時間 | 840 ms |
コンパイル使用メモリ | 21,448 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-29 02:46:27 |
合計ジャッジ時間 | 1,789 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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 lxor 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 lxor acc) in loop2 r 0 in loop k 2 0 in print_endline @@ if factor n = 0 then "Bob" else "Alice" )