結果
問題 | No.486 3 Straight Win(3連勝) |
ユーザー |
![]() |
提出日時 | 2017-10-27 20:27:46 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 402 bytes |
コンパイル時間 | 1,605 ms |
コンパイル使用メモリ | 165,904 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-21 21:25:28 |
合計ジャッジ時間 | 2,335 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 WA * 5 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main(){ string s; int e=0,w=0; cin>>s; if(s.size()<3) { cout<<"NA"<<"\n"; return 0; } for(int i=0;i<s.size()-2;i++){ if(s[i]=='O'&&s[i+1]=='O'&&s[i+2]=='O') { e++; } else if(s[i]=='X'&&s[i+1]=='X'&&s[i+2]=='X') { w++; } } if(e>w) cout<<"East"<<"\n"; else if(e<w) cout<<"West"<<"\n"; else cout<<"NA"<<"\n"; return 0; }