結果
| 問題 |
No.154 市バス
|
| ユーザー |
|
| 提出日時 | 2019-01-30 06:45:31 |
| 言語 | Nim (2.2.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 564 bytes |
| コンパイル時間 | 2,243 ms |
| コンパイル使用メモリ | 60,712 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-01 11:11:19 |
| 合計ジャッジ時間 | 2,778 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | AC * 5 WA * 3 |
ソースコード
template times*(n:int,body) = (for _ in 0..<n: body)
proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "<stdio.h>" .}
proc scan(): int =
while true:
let k = getchar_unlocked()
if k < '0': return
result = 10 * result + k.ord - '0'.ord
scan().times:
var isOk = true
var gcount = 0
while true:
let k = getchar_unlocked()
if k < 'A' or k > 'Z': break
if k == 'G': gcount += 1
if k == 'R':
if gcount == 0 : isOk = false
gcount -= 1
if not isOk or gcount > 0: echo "impossible"
else: echo "possible"