結果

問題 No.154 市バス
コンテスト
ユーザー 6soukiti29
提出日時 2017-09-18 18:48:16
言語 Nim
(2.2.8)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 382 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,303 ms
コンパイル使用メモリ 67,408 KB
実行使用メモリ 6,144 KB
最終ジャッジ日時 2026-03-19 20:37:22
合計ジャッジ時間 3,187 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other AC * 6 WA * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]

ソースコード

diff #
raw source code

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 w == 0 and g == 0:
        echo "possible"
    else:
        echo "impossible"
0