結果
| 問題 | 
                            No.486 3 Straight Win(3連勝)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2017-03-27 07:55:05 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 193 bytes | 
| コンパイル時間 | 673 ms | 
| コンパイル使用メモリ | 65,428 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-06-26 04:23:55 | 
| 合計ジャッジ時間 | 1,494 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 28 | 
コンパイルメッセージ
main.cpp:2:21: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | using namespace std;main(){string s;cin>>s;int a=0;for(int i=0;i+3<=s.length();i++)if(s[i]==s[i+1]&&s[i]==s[i+2]&&!a)a=s[i]=='O'?1:-1;cout<<(a?a+1?"East":"West":"NA")<<endl;}
      |                     ^~~~
            
            ソースコード
#include<iostream>
using namespace std;main(){string s;cin>>s;int a=0;for(int i=0;i+3<=s.length();i++)if(s[i]==s[i+1]&&s[i]==s[i+2]&&!a)a=s[i]=='O'?1:-1;cout<<(a?a+1?"East":"West":"NA")<<endl;}