結果

問題 No.1544 [Cherry 2nd Tune C] Synchroscope
ユーザー kokonotsukokonotsu
提出日時 2021-07-19 16:52:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 317 ms / 2,000 ms
コード長 259 bytes
コンパイル時間 423 ms
コンパイル使用メモリ 86,668 KB
実行使用メモリ 467,408 KB
最終ジャッジ日時 2023-09-24 12:37:44
合計ジャッジ時間 12,154 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,276 KB
testcase_01 AC 64 ms
71,384 KB
testcase_02 AC 70 ms
71,296 KB
testcase_03 AC 78 ms
89,392 KB
testcase_04 AC 106 ms
187,184 KB
testcase_05 AC 110 ms
216,692 KB
testcase_06 AC 138 ms
263,448 KB
testcase_07 AC 128 ms
255,720 KB
testcase_08 AC 99 ms
191,660 KB
testcase_09 AC 76 ms
88,180 KB
testcase_10 AC 122 ms
251,804 KB
testcase_11 AC 82 ms
102,640 KB
testcase_12 AC 82 ms
120,776 KB
testcase_13 AC 76 ms
90,008 KB
testcase_14 AC 177 ms
319,816 KB
testcase_15 AC 208 ms
363,080 KB
testcase_16 AC 92 ms
161,004 KB
testcase_17 AC 71 ms
78,404 KB
testcase_18 AC 72 ms
81,640 KB
testcase_19 AC 79 ms
96,840 KB
testcase_20 AC 169 ms
312,316 KB
testcase_21 AC 80 ms
118,588 KB
testcase_22 AC 74 ms
91,328 KB
testcase_23 AC 277 ms
467,248 KB
testcase_24 AC 274 ms
467,096 KB
testcase_25 AC 293 ms
467,072 KB
testcase_26 AC 274 ms
467,164 KB
testcase_27 AC 317 ms
467,356 KB
testcase_28 AC 228 ms
466,940 KB
testcase_29 AC 226 ms
466,940 KB
testcase_30 AC 227 ms
467,408 KB
testcase_31 AC 235 ms
467,016 KB
testcase_32 AC 233 ms
467,076 KB
testcase_33 AC 71 ms
76,124 KB
testcase_34 AC 65 ms
71,348 KB
testcase_35 AC 65 ms
70,920 KB
testcase_36 AC 72 ms
76,208 KB
testcase_37 AC 70 ms
76,116 KB
testcase_38 AC 312 ms
465,440 KB
testcase_39 AC 308 ms
466,228 KB
testcase_40 AC 301 ms
465,292 KB
testcase_41 AC 309 ms
466,280 KB
testcase_42 AC 301 ms
458,980 KB
testcase_43 AC 282 ms
443,240 KB
testcase_44 AC 288 ms
447,496 KB
testcase_45 AC 294 ms
460,520 KB
testcase_46 AC 288 ms
450,300 KB
testcase_47 AC 297 ms
454,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
N, M = map(int, input().split())

g = gcd(N, M)
A = list(map(int, input().split()))
B = list(map(int, input().split()))

A = A*(M//g)
B = B*(N//g)

for i in range(len(A)):
    if A[i] == B[i]:
        print(i+1)
        exit(0)

print(-1)
0