結果
問題 | No.2 素因数ゲーム |
ユーザー |
![]() |
提出日時 | 2018-08-11 01:44:06 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 335 ms / 5,000 ms |
コード長 | 745 bytes |
コンパイル時間 | 727 ms |
コンパイル使用メモリ | 68,480 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-26 13:32:53 |
合計ジャッジ時間 | 2,618 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <string> #define REP(i, a, b) for (int i = int(a); i < int(b); i++) #define dump(val) cerr << __LINE__ << ":\t" << #val << " = " << (val) << endl using namespace std; typedef long long int lli; template<typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); } template<typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); } int main() { int N; cin >> N; int ans = 0; REP(i, 2, N + 1) { int cnt = 0; while (N % i == 0) { N /= i; cnt++; } ans ^= cnt; } cout << (ans == 0 ? "Bob" : "Alice") << endl; return 0; }