結果
問題 |
No.154 市バス
|
ユーザー |
|
提出日時 | 2016-06-30 09:42:49 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 656 bytes |
コンパイル時間 | 563 ms |
コンパイル使用メモリ | 64,000 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-13 08:36:50 |
合計ジャッジ時間 | 1,269 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | AC * 7 WA * 1 |
ソースコード
#include <iostream> #include <string> int main() { int T; std::cin >> T; for (int i = 0; i < T; ++i) { std::string S; std::cin >> S; int W = 0; int G = 0; int R = 0; bool ng = false; for (auto c : S) { if (c == 'W') { ++W; } else if (c == 'G') { ++G; ng = G > W; } else { ++R; ng = R > G; } if (ng) { break; } } ng = ng || G != R || G == 0; std::cout << (ng ? "im" : "") << "possible\n"; } }