結果
| 問題 | No.2 素因数ゲーム |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-03-08 16:39:02 |
| 言語 | D (dmd 2.112.0) |
| 結果 |
AC
|
| 実行時間 | 0 ms / 5,000 ms |
| コード長 | 400 bytes |
| 記録 | |
| コンパイル時間 | 3,269 ms |
| コンパイル使用メモリ | 186,112 KB |
| 実行使用メモリ | 5,760 KB |
| 最終ジャッジ日時 | 2026-07-07 00:18:17 |
| 合計ジャッジ時間 | 5,227 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 31 |
コンパイルメッセージ
/home/linuxbrew/.linuxbrew/opt/dmd/include/dlang/dmd/core/checkedint.d(814): Warning: cannot inline function `core.checkedint.mulu!().mulu`
ulong mulu()(ulong x, uint y, ref bool overflow)
^
ソースコード
import std;
void main(){
long n;
readf("%d",&n);
int[]vals;
int c=0;
while(n%2==0){
n>>=1;
c++;
}
if(c!=0){
vals~=c;
}
foreach(i; iota(3,n,2)){
if(i*i>n)break;
if(n%i==0){
int cc=0;
while(n%i==0){
n/=i;
++cc;
}
vals~=cc;
}
}
if(n>1)vals~=1;
int xr=0.reduce!((a,b)=>(a^b))(vals);
writeln(xr==0?"Bob":"Alice");
}