結果
| 問題 |
No.1544 [Cherry 2nd Tune C] Synchroscope
|
| コンテスト | |
| ユーザー |
Manuel1024
|
| 提出日時 | 2021-05-25 02:09:39 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 334 bytes |
| コンパイル時間 | 290 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 22,528 KB |
| 最終ジャッジ日時 | 2024-12-14 21:36:53 |
| 合計ジャッジ時間 | 35,856 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 37 TLE * 11 |
ソースコード
n, m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = -1
lim = n*m
ind = 0
ai = 0
bi = 0
while ind < lim:
if a[ai] == b[bi]:
ans = ind+1
break
ind += 1
ai += 1
bi += 1
if ai == n:
ai -= n
if bi == m:
bi -= m
print(ans)
Manuel1024