結果
| 問題 |
No.154 市バス
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-04-02 23:53:58 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,019 bytes |
| コンパイル時間 | 521 ms |
| コンパイル使用メモリ | 69,928 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-13 07:17:45 |
| 合計ジャッジ時間 | 1,180 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 8 |
ソースコード
#include <fstream>
#include <cstdint>
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <algorithm>
using namespace std;
void possible()
{
cout << "possible" << endl;
}
void impossible()
{
cout << "impossible" << endl;
}
bool resolve(const string& s)
{
int indexR = -1;
int indexG = -1;
int indexW = -1;
int countR = 0;
int countG = 0;
int countW = 0;
for (string::size_type i = 0; i < s.length(); i++) {
char ch = s[i];
switch (ch) {
case 'R':
countR++;
indexR = i;
break;
case 'G':
countG++;
indexG = i;
break;
case 'W':
countW++;
indexW = i;
break;
}
if (countR > countG || countG > countW) {
impossible();
return false;
}
}
if (countR == 0 || countR != countG) {
impossible();
return false;
}
if (indexW > indexG) {
impossible();
return false;
}
possible();
return true;
}
int main()
{
int n;
cin >> n;
for (int i = 0; i < n; i++) {
string s;
cin >> s;
}
return 0;
}