結果
問題 | No.154 市バス |
ユーザー | yosswi414 |
提出日時 | 2018-09-19 15:56:00 |
言語 | C++11 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 375 bytes |
コンパイル時間 | 1,090 ms |
コンパイル使用メモリ | 143,920 KB |
実行使用メモリ | 4,384 KB |
最終ジャッジ日時 | 2023-09-25 10:10:11 |
合計ジャッジ時間 | 2,538 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 24 ms
4,376 KB |
testcase_01 | AC | 24 ms
4,380 KB |
testcase_02 | AC | 24 ms
4,380 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | AC | 2 ms
4,380 KB |
testcase_07 | AC | 21 ms
4,376 KB |
testcase_08 | WA | - |
コンパイルメッセージ
main.cpp:3:6: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type] 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"; } }