結果

問題 No.1544 [Cherry 2nd Tune C] Synchroscope
ユーザー mesame3993
提出日時 2021-11-18 00:44:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 406 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 362 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 451,840 KB
最終ジャッジ日時 2024-12-24 09:40:12
合計ジャッジ時間 13,016 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 48
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
  from sys import stdin
  readline=stdin.readline
  n, m = map(int, readline().split())
  A = list(map(int, readline().split()))
  B = list(map(int, readline().split()))
  A = A*m
  B = B*n
  for i in range(n*m):
    if A[i] == B[i]:
      print(i+1)
      break
  else:
    print(-1)
main()
0