結果
問題 | No.524 コインゲーム |
ユーザー |
|
提出日時 | 2021-06-23 10:31:48 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 407 bytes |
コンパイル時間 | 1,380 ms |
コンパイル使用メモリ | 161,096 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-02-23 22:36:28 |
合計ジャッジ時間 | 2,700 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 32 |
ソースコード
#include <bits/stdc++.h> #define FOR(i, a, n) for (int i = a; i < n; i++) #define REP(w, n) FOR(w, 0, n) using namespace std; typedef long long ll; int main() { ll n; cin >> n; int a = 0; FOR(i, n - n % 4, n + 1) { a ^= i; } if (a > 0) { cout << "O" << endl; } else cout << "X" << endl; return (0); } //0 1 10 11 ->0 100 101 110 111 1000 3 4 8 16 32 64 128 256 512 1024 2048 4096 8192 1