結果
問題 | No.769 UNOシミュレータ |
ユーザー | hokto |
提出日時 | 2018-12-22 15:04:35 |
言語 | Ruby (3.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,542 bytes |
コンパイル時間 | 189 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 37,504 KB |
最終ジャッジ日時 | 2024-05-02 00:15:40 |
合計ジャッジ時間 | 6,333 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 81 ms
12,160 KB |
testcase_01 | RE | - |
testcase_02 | RE | - |
testcase_03 | RE | - |
testcase_04 | RE | - |
testcase_05 | AC | 85 ms
12,160 KB |
testcase_06 | RE | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | RE | - |
testcase_11 | RE | - |
testcase_12 | WA | - |
testcase_13 | RE | - |
testcase_14 | AC | 226 ms
20,608 KB |
testcase_15 | WA | - |
testcase_16 | AC | 367 ms
29,952 KB |
testcase_17 | RE | - |
testcase_18 | RE | - |
testcase_19 | RE | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | AC | 86 ms
12,288 KB |
コンパイルメッセージ
Syntax OK
ソースコード
number_log=gets.chomp.split.map(&:to_i) log=Array.new(number_log[1]) card_count=Array.new(number_log[1]) number_log[1].times do|i| log[i]=gets.chomp card_count[i]=0 end current_id=0 counter=0.to_i squential_flow=1 draw_count=1 while counter<log.size if log[counter].include?("skip") card_count[current_id]+=1 if counter !=log.size-1 current_id =(current_id+squential_flow*2)%number_log[0] end elsif log[counter].include?("reverse") squential_flow*=-1 card_count[current_id]+=1 if counter !=log.size-1 current_id =(current_id+squential_flow)%number_log[0] end elsif log[counter].include?("drawtwo") if log[counter+1].include?("drawtwo") draw_count+=1 card_count[current_id]+=1 else card_count[counter+squential_flow] -= draw_count*2 card_count[current_id]+=1 draw_count =1 current_id =(current_id+squential_flow)%number_log[0] end if counter !=log.size-1 current_id =(current_id+squential_flow)%number_log[0] end elsif log[counter].include?("drawfour") if log[counter+1].include?("drawfour") draw_count+=1 card_count[current_id]+=1 else card_count[counter+squential_flow]-=4*draw_count card_count[current_id]+=1 current_id =(current_id+squential_flow)%number_log[0] draw_count =1 end if counter !=log.size-1 current_id =(current_id+squential_flow)%number_log[0] end else card_count[current_id]+=1 if counter !=log.size-1 current_id =(current_id+squential_flow)%number_log[0] end end counter+=1 end print current_id+1," ",card_count[current_id],"\n"