結果

問題 No.769 UNOシミュレータ
ユーザー cielciel
提出日時 2018-12-05 14:50:49
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 312 bytes
コンパイル時間 124 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 13,184 KB
最終ジャッジ日時 2024-05-02 00:07:38
合計ジャッジ時間 4,973 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 270 ms
12,544 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,m=gets.split.map &:to_i
a=[0]*n
k=x=0
d=1
prev=''
(m-1).times{ # discard the final turn
s=gets.chomp
if prev!=s&&prev.start_with?('draw')
a[k]+=x
k=(k+d)%n
x=0
end
if s=='drawtwo'
x+=2
elsif s=='drawfour'
x+=4
elsif s=='skip'
k=(k+d)%n
elsif s=='reverse'
d=-d
end
prev=s
a[k]+=1
k=(k+d)%n
}
puts [k,a[k]+1]*' '
0