結果

問題 No.2 素因数ゲーム
ユーザー Luke LiLuke Li
提出日時 2022-04-03 17:28:57
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1,509 ms / 5,000 ms
コード長 588 bytes
コンパイル時間 940 ms
コンパイル使用メモリ 28,168 KB
実行使用メモリ 122,036 KB
最終ジャッジ日時 2023-08-15 14:26:45
合計ジャッジ時間 49,623 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,461 ms
122,036 KB
testcase_01 AC 1,468 ms
121,900 KB
testcase_02 AC 1,462 ms
121,952 KB
testcase_03 AC 1,462 ms
121,948 KB
testcase_04 AC 1,449 ms
121,916 KB
testcase_05 AC 1,461 ms
121,864 KB
testcase_06 AC 1,508 ms
121,900 KB
testcase_07 AC 1,474 ms
121,868 KB
testcase_08 AC 1,492 ms
122,020 KB
testcase_09 AC 1,480 ms
121,908 KB
testcase_10 AC 1,461 ms
121,940 KB
testcase_11 AC 1,459 ms
121,964 KB
testcase_12 AC 1,477 ms
121,964 KB
testcase_13 AC 1,472 ms
122,016 KB
testcase_14 AC 1,450 ms
121,924 KB
testcase_15 AC 1,474 ms
122,028 KB
testcase_16 AC 1,467 ms
121,904 KB
testcase_17 AC 1,461 ms
121,972 KB
testcase_18 AC 1,475 ms
121,904 KB
testcase_19 AC 1,509 ms
121,868 KB
testcase_20 AC 1,451 ms
122,024 KB
testcase_21 AC 1,489 ms
121,904 KB
testcase_22 AC 1,466 ms
121,968 KB
testcase_23 AC 1,463 ms
121,920 KB
testcase_24 AC 1,463 ms
121,936 KB
testcase_25 AC 1,464 ms
121,964 KB
testcase_26 AC 1,448 ms
121,904 KB
testcase_27 AC 1,447 ms
121,904 KB
testcase_28 AC 1,471 ms
121,924 KB
testcase_29 AC 1,469 ms
122,036 KB
testcase_30 AC 1,465 ms
121,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include <stdbool.h>

bool mark[100000001];
int prime[100000001];
int primeSize;
void init()//sieve of Eratosthenes
{
	primeSize=0;
	for(int i = 2;i <= 100000000; i++)
	{
		if(mark[i] == true) continue;
		prime[primeSize++]=i;
		if(i >= 10000) continue;
		for(int j=i*i; j<=100000000; j+=i)
		{
			mark[j]=true;
		}
	}
} 
int main()
{
	init();
	int n, t = 0, s = 0;
	scanf("%d",&n);
	for(int i = 0; prime[i] <= n; i++){
		while(n%prime[i] == 0){
			n /= prime[i];
			t++;
		}
		s ^= t;
		t = 0;
	}
	if(s != 0){
		printf("Alice");
	}else{
		printf("Bob");
	}
	return 0;
}
0