結果
問題 | No.154 市バス |
ユーザー |
![]() |
提出日時 | 2018-09-19 15:31:57 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 353 bytes |
コンパイル時間 | 1,115 ms |
コンパイル使用メモリ | 158,524 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-18 08:15:46 |
合計ジャッジ時間 | 1,689 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | AC * 4 WA * 4 |
コンパイルメッセージ
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?"im":"")<<"possible\n";}}