結果
| 問題 |
No.103 素因数ゲーム リターンズ
|
| コンテスト | |
| ユーザー |
tottoripaper
|
| 提出日時 | 2014-12-14 23:56:00 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 522 bytes |
| コンパイル時間 | 143 ms |
| コンパイル使用メモリ | 22,784 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-11 21:10:19 |
| 合計ジャッジ時間 | 922 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 20 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%d", &N);
| ~~~~~^~~~~~~~~~
main.cpp:10:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%d", &n);
| ~~~~~^~~~~~~~~~
ソースコード
#include <cstdio>
int main(){
int N;
scanf("%d", &N);
int ex_or = 0;
for(int i=0;i<N;i++){
int n;
scanf("%d", &n);
for(int j=2;j*j<=n;j++){
int t = 0;
while(n % j == 0){
t += 1;
n /= j;
}
ex_or ^= t % 3;
}
if(n > 1){
ex_or ^= 1;
}
}
if(ex_or == 0){
puts("Bob");
}else{
puts("Alice");
}
}
tottoripaper