結果
問題 | No.486 3 Straight Win(3連勝) |
ユーザー |
|
提出日時 | 2017-02-26 02:41:48 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 594 bytes |
コンパイル時間 | 1,445 ms |
コンパイル使用メモリ | 168,444 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-26 04:07:30 |
合計ジャッジ時間 | 2,299 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr) #define all(x) (x).begin(),(x).end() #define pb push_back #define fi first #define se second string solve(string s) { int S=s.size(); rep(i,S-2) { int a=0; rep(j,3) a+=(s[i+j]=='O')?1:-1; if(a==3) return "East"; if(a==-3) return "West"; } return "NA"; } int main() { string s; cin >>s; cout << solve(s) << endl; return 0; }