結果

問題 No.1544 [Cherry 2nd Tune C] Synchroscope
ユーザー miya145592miya145592
提出日時 2023-05-07 15:46:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 165 ms / 2,000 ms
コード長 233 bytes
コンパイル時間 1,928 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 76,592 KB
最終ジャッジ日時 2023-08-16 05:21:21
合計ジャッジ時間 10,332 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,424 KB
testcase_01 AC 65 ms
71,180 KB
testcase_02 AC 65 ms
71,468 KB
testcase_03 AC 69 ms
76,376 KB
testcase_04 AC 71 ms
76,592 KB
testcase_05 AC 70 ms
76,376 KB
testcase_06 AC 68 ms
76,532 KB
testcase_07 AC 70 ms
76,348 KB
testcase_08 AC 70 ms
76,492 KB
testcase_09 AC 68 ms
76,308 KB
testcase_10 AC 69 ms
76,164 KB
testcase_11 AC 73 ms
76,396 KB
testcase_12 AC 71 ms
76,508 KB
testcase_13 AC 74 ms
76,188 KB
testcase_14 AC 75 ms
76,488 KB
testcase_15 AC 70 ms
76,320 KB
testcase_16 AC 69 ms
76,500 KB
testcase_17 AC 69 ms
76,116 KB
testcase_18 AC 69 ms
76,468 KB
testcase_19 AC 70 ms
76,272 KB
testcase_20 AC 71 ms
76,164 KB
testcase_21 AC 68 ms
76,480 KB
testcase_22 AC 69 ms
76,368 KB
testcase_23 AC 68 ms
76,508 KB
testcase_24 AC 70 ms
76,324 KB
testcase_25 AC 70 ms
76,248 KB
testcase_26 AC 70 ms
76,504 KB
testcase_27 AC 72 ms
76,368 KB
testcase_28 AC 69 ms
76,368 KB
testcase_29 AC 71 ms
76,168 KB
testcase_30 AC 71 ms
76,320 KB
testcase_31 AC 72 ms
76,464 KB
testcase_32 AC 71 ms
76,368 KB
testcase_33 AC 72 ms
76,224 KB
testcase_34 AC 67 ms
71,488 KB
testcase_35 AC 65 ms
70,944 KB
testcase_36 AC 72 ms
76,332 KB
testcase_37 AC 71 ms
76,348 KB
testcase_38 AC 160 ms
76,308 KB
testcase_39 AC 159 ms
76,200 KB
testcase_40 AC 161 ms
76,276 KB
testcase_41 AC 159 ms
76,324 KB
testcase_42 AC 157 ms
76,544 KB
testcase_43 AC 157 ms
76,120 KB
testcase_44 AC 161 ms
76,548 KB
testcase_45 AC 165 ms
76,304 KB
testcase_46 AC 157 ms
76,468 KB
testcase_47 AC 159 ms
76,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
N, M = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
G = math.gcd(N, M)
L = N*M//G
for i in range(L):
    if A[i%N]==B[i%M]:
        print(i+1)
        exit()
print(-1)
0