結果

問題 No.154 市バス
ユーザー 6soukiti296soukiti29
提出日時 2017-09-18 18:50:00
言語 Nim
(2.0.2)
結果
WA  
実行時間 -
コード長 418 bytes
コンパイル時間 2,935 ms
コンパイル使用メモリ 68,592 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-12 15:13:06
合計ジャッジ時間 3,607 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
4,380 KB
testcase_01 AC 14 ms
4,384 KB
testcase_02 AC 15 ms
4,376 KB
testcase_03 AC 13 ms
4,380 KB
testcase_04 WA -
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 10 ms
4,376 KB
testcase_08 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]

ソースコード

diff #

import sequtils,strutils
var
    N = stdin.readline.parseInt
    s : string
for n in 0..<N:
    s = stdin.readline
    var
        w,g,r : int
    for c in s:
        if c == 'W':
            w += 1
        if c == 'G':
            w = 0
            g += 1
        if c == 'R':
            g -= 1
        if g < 0:
            break
    if w == 0 and g == 0:
        echo "possible"
    else:
        echo "impossible"
0