結果

問題 No.2 素因数ゲーム
ユーザー SakaTaku
提出日時 2020-08-27 00:37:17
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 418 bytes
コンパイル時間 1,855 ms
コンパイル使用メモリ 172,748 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-07 14:19:51
合計ジャッジ時間 2,930 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < n; ++i)
bool f(int x) {
   int res=0;
   map<int,int>factor;
   for (int i = 2; i*i <= x; i++){
      while(x%i==0){
         factor[i]++;
         x/=i;
      }
   }
   if(x!=1)factor[x]++;
   for (auto &&i : factor){
      res^=i.second;
   }
   return res;
}
int main() {
   int N; cin>>N;
   cout<<(f(N) ? "Alice" : "Bob")<<endl;
}
0