結果
問題 | No.769 UNOシミュレータ |
ユーザー | hokto |
提出日時 | 2018-12-22 15:04:35 |
言語 | Ruby (3.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,542 bytes |
コンパイル時間 | 113 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 37,376 KB |
最終ジャッジ日時 | 2024-11-22 08:55:32 |
合計ジャッジ時間 | 7,428 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 95 ms
12,032 KB |
testcase_01 | RE | - |
testcase_02 | RE | - |
testcase_03 | RE | - |
testcase_04 | RE | - |
testcase_05 | AC | 97 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 | 264 ms
20,864 KB |
testcase_15 | WA | - |
testcase_16 | AC | 439 ms
29,952 KB |
testcase_17 | RE | - |
testcase_18 | RE | - |
testcase_19 | RE | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | AC | 89 ms
12,160 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"