結果
問題 | No.486 3 Straight Win(3連勝) |
ユーザー |
![]() |
提出日時 | 2017-03-10 21:32:16 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 563 bytes |
コンパイル時間 | 457 ms |
コンパイル使用メモリ | 58,028 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-26 04:17:09 |
合計ジャッジ時間 | 1,430 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:17:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 17 | scanf("%s", str); | ~~~~~^~~~~~~~~~~
ソースコード
#include <iostream> #include <cstdio> #include <algorithm> #include <cstdlib> #include <cstring> using namespace std; #define FOR(i,a,b) for (int i = (a); i < (b); i++) #define REP(i,n) FOR(i,0,n) typedef long long ll; int main(){ char str[101]; scanf("%s", str); int len; len = strlen(str); if (len < 3) cout << "NA" << endl; FOR(i,2,len){ if (str[i] == str[i-1] && str[i] == str[i-2]){ if (str[i] == 'O') cout << "East" << endl; else cout << "West" << endl; break; } if (i == len-1) cout << "NA" << endl; } return 0; }