結果
| 問題 | No.524 コインゲーム |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-06-02 22:54:08 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 591 bytes |
| 記録 | |
| コンパイル時間 | 1,001 ms |
| コンパイル使用メモリ | 179,520 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-18 20:22:53 |
| 合計ジャッジ時間 | 2,067 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 |
コンパイルメッセージ
main.cpp: In function 'int range(ll)':
main.cpp:19:1: warning: control reaches end of non-void function [-Wreturn-type]
19 | }
| ^
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for (int i=0,_n=(int)(n); i < _n; i++)
template<class T> bool chkmin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool chkmax(T &a, T b) { return a < b ? (a = b, true) : false; }
typedef long long ll;
int range(ll L) {
switch(L & 3) {
case 0: return L;
case 1: return 1;
case 2: return L + 1;
case 3: return 0;
}
}
int main2() {
ll N; cin >> N;
int x = range(N);
cout << (x == 0 ? "X":"O") << endl;
return 0;
}
int main() {
for (;!cin.eof();cin>>ws) main2();
return 0;
}