結果
| 問題 | No.486 3 Straight Win(3連勝) |
| コンテスト | |
| ユーザー |
focus
|
| 提出日時 | 2018-01-15 21:44:50 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 813 bytes |
| 記録 | |
| コンパイル時間 | 453 ms |
| コンパイル使用メモリ | 56,796 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-24 03:29:38 |
| 合計ジャッジ時間 | 1,390 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 16 WA * 12 |
ソースコード
#include<iostream>
#include<vector>
#include<string>
#include<cstdio>
using namespace std;
int main(){
string s;
int count=1,flag=0,i;
cin >> s;
for(i=1;s[i]!='\0';i++){
if(s[i]==s[i-1]){
count++;
if(count==3){
if(s[i]=='O'){
cout << "East";
return 0;
}
else{
cout << "West";
return 0;
}
}
}
else{
count=0;
}
}
count++;
if(count==3&&i>3){
if(s[i]=='O'){
cout << "East";
return 0;
}
else{
cout << "West";
return 0;
}
}
cout << "NA\n";
return 0;
}
focus