結果
問題 |
No.154 市バス
|
ユーザー |
![]() |
提出日時 | 2022-08-12 20:41:23 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 599 bytes |
コンパイル時間 | 2,053 ms |
コンパイル使用メモリ | 194,508 KB |
最終ジャッジ日時 | 2025-01-30 20:35:20 |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | AC * 6 WA * 2 |
ソースコード
#define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ALL(v) v.begin(), v.end() typedef long long ll; #include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int t; cin>>t; while(t--){ string s; cin>>s; int n=s.size(); int w=0,g=0,r=0; bool b=true; rep(i,n){ if(s[i]=='W') w++; else if(s[i]=='G') g++; else r++; if(w>=g && g>=r) continue; b=false; break; } if(b==false || g!=r) cout<<"impossible"<<endl; else cout<<"possible"<<endl; } return 0; }