結果

問題 No.1544 [Cherry 2nd Tune C] Synchroscope
ユーザー Manuel1024
提出日時 2021-05-19 19:36:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 148 ms / 2,000 ms
コード長 204 bytes
コンパイル時間 492 ms
コンパイル使用メモリ 82,404 KB
実行使用メモリ 62,524 KB
最終ジャッジ日時 2024-12-14 21:33:47
合計ジャッジ時間 4,912 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 48
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = -1
for i in range(n*m):
    if a[i%n] == b[i%m]:
        ans = i+1
        break

print(ans)
0