#include #ifndef ONLINE_JUDGE #define _GLIBCXX_DEBUG #endif using namespace std; #define rep(i, n) for (ll i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = s; i < (int)(n); i++) #define Clear(a) a = decltype(a)() #define all(a) a.begin(),a.end() #define rall(a) a.rbegin(),a.rend() #define vec vector typedef long long ll; typedef pair P; //const ll big=998244353; const ll big=1000000007LL; const ll INF=1e18; const int dx[4]={1,0,-1,0}; const int dy[4]={0,1,0,-1}; ll max(ll x,ll y){ if(x>y)return x; else return y; } ll min(ll x,ll y){ if(x> n; /* ただのNimをすれば良い 1~Nに対してxorを取る →まあ各桁に対して計算するのが無難そうだけど… 1の位:mod2で見て非0ならおわり 2の位:mod4で見て非0なら終わり…って感じではないじゃん、ア */ rep(i,32){ if(exp(2LL,i)>n)break; ll cnt=n/exp(2LL,i+1);//1 ll num=cnt*exp(2LL,i);//1 num+=max(0 , (n%(exp(2LL,i+1))) - exp(2LL,i)); if(num%2!=0){ cout << "X\n"; return 0; } } cout << "O\n"; }