結果
問題 | No.769 UNOシミュレータ |
ユーザー | hokto |
提出日時 | 2018-12-22 14:50:04 |
言語 | Ruby (3.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,676 bytes |
コンパイル時間 | 89 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 37,376 KB |
最終ジャッジ日時 | 2024-11-22 08:55:47 |
合計ジャッジ時間 | 11,670 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | RE | - |
testcase_02 | RE | - |
testcase_03 | RE | - |
testcase_04 | RE | - |
testcase_05 | WA | - |
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 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | RE | - |
testcase_18 | RE | - |
testcase_19 | RE | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
コンパイルメッセージ
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 print "ID:",current_id,"\n" print "card:",card_count[current_id] 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] print "next draw" 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 print "draw" 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 print "\n" counter+=1 end print current_id+1 print " " print card_count[current_id] print "\n"