結果

問題 No.103 素因数ゲーム リターンズ
ユーザー 古寺いろは古寺いろは
提出日時 2015-04-09 20:48:25
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 568 bytes
コンパイル時間 1,184 ms
コンパイル使用メモリ 151,068 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-17 19:06:21
合計ジャッジ時間 2,580 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
4,376 KB
testcase_01 AC 7 ms
4,380 KB
testcase_02 AC 6 ms
4,376 KB
testcase_03 WA -
testcase_04 AC 7 ms
4,376 KB
testcase_05 AC 6 ms
4,376 KB
testcase_06 AC 7 ms
4,380 KB
testcase_07 AC 6 ms
4,376 KB
testcase_08 AC 7 ms
4,380 KB
testcase_09 AC 7 ms
4,380 KB
testcase_10 AC 7 ms
4,380 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 6 ms
4,376 KB
testcase_14 AC 6 ms
4,376 KB
testcase_15 AC 7 ms
4,376 KB
testcase_16 AC 6 ms
4,376 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 6 ms
4,376 KB
testcase_20 AC 7 ms
4,376 KB
testcase_21 AC 6 ms
4,376 KB
testcase_22 AC 6 ms
4,376 KB
testcase_23 AC 6 ms
4,380 KB
testcase_24 AC 7 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;

#define MAX 10005

int dp[MAX];

int main(){
	int N;
	cin >> N;
	vector<int> A(N);
	for (int i = 0; i < N; i++)
	{
		cin >> A[i];
	}
	dp[1] = 0;
	for (int i = 2; i < MAX; i++)
	{
		int temp = i;
		set<int> s;
		s.insert(dp[0]);
		for (int j = 2; j * j <= temp; j++)
		{
			if (i%j == 0){
				s.insert(dp[j]);
				s.insert(dp[i / j]);
			}
		}
		while (s.count(dp[i])) dp[i]++;
	}
	int ans = 0;
	for (int i = 0; i < N; i++)
	{
		ans ^= dp[A[i]];
	}
	if (ans == 0) cout << "Bob" << endl;
	else cout << "Alice" << endl;
}


0