結果
問題 | No.154 市バス |
ユーザー |
![]() |
提出日時 | 2018-09-19 15:56:00 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 375 bytes |
コンパイル時間 | 1,203 ms |
コンパイル使用メモリ | 158,556 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-18 08:15:56 |
合計ジャッジ時間 | 1,743 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | AC * 5 WA * 3 |
コンパイルメッセージ
main.cpp:3:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type] 3 | main(){ | ^~~~
ソースコード
#include<bits/stdc++.h>using namespace std;main(){int t;string s;cin>>t;while(t--){cin>>s;int b=0;for(int i=0;i<s.length();++i){if(s[i]=='W')continue;b+=(s[i]=='G'?1:-1);if(b<0){cout<<"impossible\n";break;}}cout<<(b||s[s.length()-1]!='R'?"im":"")<<"possible\n";}}