結果
| 問題 |
No.524 コインゲーム
|
| ユーザー |
Outing_Island
|
| 提出日時 | 2022-01-23 20:55:35 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 2,790 bytes |
| コンパイル時間 | 1,409 ms |
| コンパイル使用メモリ | 172,244 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-30 02:26:36 |
| 合計ジャッジ時間 | 2,349 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 |
ソースコード
// Check Overflow
#ifdef DEBUG_BUILD
#define _GLIBCXX_DEBUG
#endif
// include
#include <bits/stdc++.h>
// Debugger
#ifdef DEBUG_BUILD
#include "debugger.hpp"
#else
#define debug(...)
#define debugdo(...)
#define debugtab(...)
#endif
// for alias
#define range(i, A, B) for (ll i = (ll)(A); i < (ll)(B); i++)
#define rep(i, N) range(i, 0, N)
#define rrep(i, N) for (ll i = (ll)(N)-1; i >= 0; i--)
// type alias
using namespace std;
using ll = long long;
using ld = long double;
using pll = std::pair<ll, ll>;
template <class T>
using vec = std::vector<T>;
template <class T>
using vec2 = std::vector<vec<T>>;
template <class T>
using vec3 = std::vector<vec2<T>>;
template <class T>
using priority_greater_queue = priority_queue<T, vector<T>, greater<T>>;
// number alias
constexpr int MOD = 1000000007;
constexpr ll INFL = std::numeric_limits<ll>::max() / 4;
constexpr array<ll, 4> DX = {1, 0, -1, 0};
constexpr array<ll, 4> DY = {0, 1, 0, -1};
// new vector
template <class T>
vec2<T> newVec2(size_t A, size_t B, ll a = T()) { return vec2<T>(A, vec<T>(B, a)); }
template <class T>
vec3<T> newVec3(size_t A, size_t B, size_t C, ll a = T()) { return vec3<T>(A, vec2<T>(B, vec<T>(C, a))); }
// vector input
template <class T>
std::istream &operator>>(std::istream &is, std::vector<T> &data)
{
for (T &in : data)
{
is >> in;
}
return is;
}
// functions
template <class T>
bool chmax(T &a, const T b)
{
if (a < b)
{
a = b;
return true;
}
return false;
}
template <class T>
bool chmin(T &a, const T b)
{
if (a > b)
{
a = b;
return true;
}
return false;
}
template <class T>
T pow(T x, T n)
{
T ret = 1;
while (n > 0)
{
if (n & 1)
ret *= x;
x *= x;
n >>= 1;
}
return ret;
}
/*****/
// 素因数分解する O(sprt(n))
vector<pair<long long, long long>> prime_factorize(long long n)
{
vector<pair<long long, long long>> res;
for (long long i = 2; i * i <= n; ++i)
{
if (n % i != 0)
continue;
long long ex = 0; // 指数
while (n % i == 0)
{
++ex;
n /= i;
}
res.push_back({i, ex});
}
if (n != 1)
res.push_back({n, 1});
return res;
}
void Main()
{
ll N;
cin >> N;
cout << ((N + 1) % 4 == 0 ? "X" : "O") << endl;
// ll grundy = 0;
// range(i, 1, 100)
// {
// grundy ^= i;
// debug(i, grundy);
// }
}
/*****/
int main()
{
cin.tie(nullptr);
ios::sync_with_stdio(false);
std::cout << std::fixed << std::setprecision(10);
std::cerr << std::fixed << std::setprecision(10);
Main();
std::cout << std::flush;
std::cerr << "--end--" << std::flush;
return 0;
}
Outing_Island