結果
問題 | No.524 コインゲーム |
ユーザー |
|
提出日時 | 2017-06-02 22:54:08 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 591 bytes |
コンパイル時間 | 1,213 ms |
コンパイル使用メモリ | 158,044 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-02 10:20:28 |
合計ジャッジ時間 | 2,164 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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;}