結果

問題 No.1544 [Cherry 2nd Tune C] Synchroscope
ユーザー siman
提出日時 2021-06-13 17:51:37
言語 Ruby
(3.4.1)
結果
TLE  
実行時間 -
コード長 171 bytes
コンパイル時間 236 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 24,960 KB
最終ジャッジ日時 2024-12-23 06:42:25
合計ジャッジ時間 38,479 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 37 TLE * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:12: 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)

(N * M).times do |i|
  next if A[i % N] != B[i % M]

  puts i + 1
  exit
end

puts -1
0