結果
| 問題 |
No.154 市バス
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-07-16 15:34:29 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 620 bytes |
| コンパイル時間 | 768 ms |
| コンパイル使用メモリ | 104,064 KB |
| 実行使用メモリ | 21,760 KB |
| 最終ジャッジ日時 | 2024-10-13 09:04:41 |
| 合計ジャッジ時間 | 1,710 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | AC * 5 WA * 3 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
class Bus
{
static public void Main(String[] args)
{
int T = int.Parse(Console.ReadLine());
for(int i=0; i < T; i++)
{
string S = Console.ReadLine();
if(S.Length < 3)
{
Console.WriteLine("impossible");
continue;
}
int count = 0;
foreach(char s in S)
{
if(s == 'G')
{
count++;
}
else if(s == 'R')
{
if(--count < 0)
{
Console.WriteLine("impossible");
break;
}
}
}
if(count == 0)
{
Console.WriteLine("possible");
}
else if(count > 0)
{
Console.WriteLine("impossible");
}
}
}
}