結果
問題 | No.524 コインゲーム |
ユーザー |
![]() |
提出日時 | 2017-06-02 22:29:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 350 bytes |
コンパイル時間 | 569 ms |
コンパイル使用メモリ | 66,040 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-02 10:16:41 |
合計ジャッジ時間 | 1,330 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 32 |
ソースコード
#include<iostream>#include<algorithm>using namespace std;long long n;int main() {cin >> n; n++;for (int i = 0; i < 36; i++) {long long p = n / (1LL << (i + 1)); p *= (1LL << i);long long q = n % (1LL << (i + 1));p += max(0LL, q - (1LL << i));if (p % 2 == 1) { cout << "O" << endl; return 0; }}cout << "X" << endl;return 0;}