結果

問題 No.1544 [Cherry 2nd Tune C] Synchroscope
ユーザー Takuya NoguchiTakuya Noguchi
提出日時 2021-06-23 21:47:28
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 213 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 11,240 KB
実行使用メモリ 15,768 KB
最終ジャッジ日時 2023-09-07 03:36:19
合計ジャッジ時間 36,345 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,256 KB
testcase_01 AC 81 ms
15,148 KB
testcase_02 AC 82 ms
15,216 KB
testcase_03 AC 87 ms
15,296 KB
testcase_04 AC 88 ms
15,556 KB
testcase_05 AC 86 ms
15,356 KB
testcase_06 AC 87 ms
15,304 KB
testcase_07 AC 87 ms
15,356 KB
testcase_08 AC 88 ms
15,556 KB
testcase_09 AC 87 ms
15,396 KB
testcase_10 AC 85 ms
15,388 KB
testcase_11 AC 86 ms
15,556 KB
testcase_12 AC 86 ms
15,408 KB
testcase_13 AC 85 ms
15,140 KB
testcase_14 AC 87 ms
15,548 KB
testcase_15 AC 86 ms
15,316 KB
testcase_16 AC 89 ms
15,496 KB
testcase_17 AC 85 ms
15,444 KB
testcase_18 AC 83 ms
15,272 KB
testcase_19 AC 87 ms
15,356 KB
testcase_20 AC 86 ms
15,552 KB
testcase_21 AC 86 ms
15,392 KB
testcase_22 AC 83 ms
15,148 KB
testcase_23 AC 86 ms
15,540 KB
testcase_24 AC 87 ms
15,636 KB
testcase_25 AC 88 ms
15,408 KB
testcase_26 AC 89 ms
15,496 KB
testcase_27 AC 88 ms
15,500 KB
testcase_28 AC 88 ms
15,420 KB
testcase_29 AC 87 ms
15,460 KB
testcase_30 AC 87 ms
15,604 KB
testcase_31 AC 87 ms
15,412 KB
testcase_32 AC 87 ms
15,504 KB
testcase_33 TLE -
testcase_34 AC 82 ms
15,088 KB
testcase_35 AC 83 ms
15,136 KB
testcase_36 AC 85 ms
15,276 KB
testcase_37 AC 86 ms
15,164 KB
testcase_38 TLE -
testcase_39 TLE -
testcase_40 TLE -
testcase_41 TLE -
testcase_42 TLE -
testcase_43 TLE -
testcase_44 TLE -
testcase_45 TLE -
testcase_46 TLE -
testcase_47 TLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:6: warning: ambiguous first argument; put parentheses or a space even after `-' operator
Syntax OK

ソースコード

diff #

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

if (A & B).empty?
  puts -1
else
  (N * M).times do |i|
    next unless A[i % N] == B[i % M]

    puts i + 1
    break
  end
end
0