結果

問題 No.2 素因数ゲーム
ユーザー btkbtk
提出日時 2015-05-01 23:08:37
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 800 bytes
コンパイル時間 816 ms
コンパイル使用メモリ 85,520 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-19 04:55:26
合計ジャッジ時間 3,855 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<fstream>
#include<sstream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<vector>
#include<list>
#include<algorithm>
#include<utility>
#include<complex>
#include<functional>
using namespace std;

bool minmax(int one,int two){
	if (one == 0 && two == 0)return true;
	bool ret = true;
	if (one > 0)ret &= minmax(one - 1, two);
	if (two > 0)ret &= minmax(one + 1, two-1);
	return ret^1;
}
int main(void){
	int N;
	int p[2] = { 0 };
	cin >> N;
	for (int i = 2; i*i <= N; i++){
		int sum = 0;
		while (N%i)N /= i,sum++;
		if (sum > 1)p[1]++;
		if (sum == 1)p[0]++;
	}
	if (N > 1)p[0]++;
	if (minmax(p[0], p[1])^1)cout << "Alice" << endl;
	else cout << "Bob" << endl;

}
0