結果
問題 |
No.486 3 Straight Win(3連勝)
|
ユーザー |
![]() |
提出日時 | 2018-02-26 16:58:23 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 559 bytes |
コンパイル時間 | 668 ms |
コンパイル使用メモリ | 67,100 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-26 04:38:57 |
合計ジャッジ時間 | 1,558 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
ソースコード
#include <iostream> #include <vector> #include <string> #define REP(i, a, b) for (int i = int(a); i < int(b); i++) #define dump(s) cerr << __LINE__ << "\t:" << #s << " = " << (s) << endl using namespace std; int main () { string s; cin >> s; char fs = s[0]; int cnt = 0; string ans = "NA"; REP (i, 0, s.size()) { if (fs == s[i]) { cnt++; } else { cnt = 1; } if (ans.size() == 2 && cnt == 3) { if (fs == 'O') ans = "East"; else ans = "West"; } fs = s[i]; } cout << ans << endl; return 0; }