結果
| 問題 | No.2 素因数ゲーム |
| コンテスト | |
| ユーザー |
kazu
|
| 提出日時 | 2019-03-18 16:26:13 |
| 言語 | Ruby (4.0.6) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 395 bytes |
| 記録 | |
| コンパイル時間 | 107 ms |
| コンパイル使用メモリ | 8,704 KB |
| 実行使用メモリ | 720,000 KB |
| 最終ジャッジ日時 | 2026-08-17 00:04:25 |
| 合計ジャッジ時間 | 15,580 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 WA * 7 MLE * 1 -- * 9 |
コンパイルメッセージ
Syntax OK
ソースコード
def func(num) args = [] ncount = 0 i = 2 while num > 1 args.push(0) while num % i == 0 num = num / i args[args.size-1] += 1 end if args.last > 1 ncount += 1 end i += 1 end if ncount == 0 if args.size % 2 == 1 print "Alice" else print "Bob" end else if ncount % 2 == 1 print "Alice" else print "Bob" end end print "\n" end func(gets.to_i)
kazu