結果

問題 No.524 コインゲーム
ユーザー hanbei_dayo
提出日時 2020-01-26 00:33:45
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 724 bytes
コンパイル時間 730 ms
コンパイル使用メモリ 81,064 KB
実行使用メモリ 6,940 KB
最終ジャッジ日時 2024-09-14 04:19:57
合計ジャッジ時間 1,775 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<math.h>
using namespace std;
#define mod (1000000000+7)
#define N (10007)
#define INF 1e16
typedef long long ll;
typedef pair<ll,ll> P;

int g[100010];

int main(void){
    int n;
    cin>>n;
    int ans = 0;
    if(n%2==0){
        int num = n-2;
        ans =1^n;
        num/=2;
        if(num%2==0)num=0;
        else num=1;
        ans^=num;
    }
    else{
        int num = n-1;
        ans = 1;
        num/=2;
        if(num%2==0)num=0;
        else num=1;
        ans^=num;
    }
    if(ans == 0)cout<<"X"<<endl;
    else cout<<"O"<<endl;
    return 0;
}
0