結果

問題 No.1183 コイン遊び
ユーザー simansiman
提出日時 2020-08-26 03:18:44
言語 Ruby
(3.3.0)
結果
AC  
実行時間 859 ms / 2,000 ms
コード長 220 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 107,248 KB
最終ジャッジ日時 2024-04-24 05:02:51
合計ジャッジ時間 22,939 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
12,160 KB
testcase_01 AC 93 ms
12,160 KB
testcase_02 AC 91 ms
12,160 KB
testcase_03 AC 90 ms
12,288 KB
testcase_04 AC 91 ms
12,160 KB
testcase_05 AC 91 ms
12,288 KB
testcase_06 AC 93 ms
12,160 KB
testcase_07 AC 94 ms
12,288 KB
testcase_08 AC 93 ms
12,160 KB
testcase_09 AC 94 ms
12,160 KB
testcase_10 AC 109 ms
14,208 KB
testcase_11 AC 140 ms
19,200 KB
testcase_12 AC 549 ms
87,936 KB
testcase_13 AC 513 ms
80,384 KB
testcase_14 AC 812 ms
105,380 KB
testcase_15 AC 842 ms
107,112 KB
testcase_16 AC 838 ms
106,932 KB
testcase_17 AC 859 ms
107,112 KB
testcase_18 AC 847 ms
107,120 KB
testcase_19 AC 838 ms
106,916 KB
testcase_20 AC 837 ms
107,112 KB
testcase_21 AC 819 ms
106,984 KB
testcase_22 AC 816 ms
107,124 KB
testcase_23 AC 820 ms
106,992 KB
testcase_24 AC 820 ms
106,932 KB
testcase_25 AC 850 ms
106,932 KB
testcase_26 AC 840 ms
107,120 KB
testcase_27 AC 844 ms
107,120 KB
testcase_28 AC 843 ms
107,248 KB
testcase_29 AC 826 ms
106,928 KB
testcase_30 AC 843 ms
107,020 KB
testcase_31 AC 851 ms
106,904 KB
testcase_32 AC 846 ms
107,112 KB
testcase_33 AC 852 ms
107,024 KB
testcase_34 AC 841 ms
107,108 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
A = gets.split.map(&:to_i)
B = gets.split.map(&:to_i)

flip = false
ans = 0

A.zip(B) do |a, b|
  if a == b
    flip = false
  else
    if !flip
      flip = true
      ans += 1
    end
  end
end

puts ans
0