結果
問題 | No.154 市バス |
ユーザー |
![]() |
提出日時 | 2017-02-05 21:02:21 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 507 bytes |
コンパイル時間 | 445 ms |
コンパイル使用メモリ | 59,084 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-13 08:56:50 |
合計ジャッジ時間 | 992 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | WA * 8 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:5:33: warning: ‘s’ is used uninitialized [-Wuninitialized] 5 | #define rep(n) for(int i = 0; i < n; ++i) | ^ main.cpp:8:16: note: ‘s’ was declared here 8 | int t, s, c = 0; | ^
ソースコード
#include <cstdio>#include <iostream>#include <cmath>#include <string>#define rep(n) for(int i = 0; i < n; ++i)using namespace std;int main(void) {int t, s, c = 0;cin >> t;rep(s) {string str;cin >> str;rep(str.size()) {if (str[i] == 'G') {++c;}else if (str[i] == 'R') {--c;}if (c < 0) {cout << "impossible" << endl;return 0;}}if (c == 0) {cout << "possible" << endl;}else {cout << "impossible" << endl;}return 0;}}