結果
| 問題 | No.103 素因数ゲーム リターンズ | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-02-27 19:42:32 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 35 ms / 5,000 ms | 
| コード長 | 468 bytes | 
| コンパイル時間 | 608 ms | 
| コンパイル使用メモリ | 73,020 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-10-13 15:59:56 | 
| 合計ジャッジ時間 | 2,229 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 5 | 
| other | AC * 20 | 
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main()
      | ^~~~
            
            ソースコード
#include<iostream>
#include<set>
using namespace std;
int X[10001];
int N;
main()
{
	for(int i=2;i<=10000;i++)
	{
		set<int>now;
		int t=i;
		for(int j=2;j<=t;j++)
		{
			if(t%j==0)
			{
				now.insert(X[i/j]);
				t/=j;
				if(t%j==0)
				{
					now.insert(X[i/j/j]);
				}
				while(t%j==0)t/=j;
			}
		}
		int k=0;
		while(now.find(k)!=now.end())k++;
		X[i]=k;
	}
	cin>>N;
	int ans=0;
	for(;N--;)
	{
		int M;cin>>M;ans^=X[M];
	}
	cout<<(ans?"Alice":"Bob")<<endl;
}
            
            
            
        