結果

問題 No.1544 [Cherry 2nd Tune C] Synchroscope
ユーザー googol_S0googol_S0
提出日時 2021-06-11 21:21:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 474 ms / 2,000 ms
コード長 230 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 467,640 KB
最終ジャッジ日時 2023-08-21 11:20:16
合計ジャッジ時間 14,954 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,156 KB
testcase_01 AC 71 ms
71,472 KB
testcase_02 AC 71 ms
71,396 KB
testcase_03 AC 149 ms
171,148 KB
testcase_04 AC 242 ms
298,868 KB
testcase_05 AC 178 ms
217,048 KB
testcase_06 AC 208 ms
263,488 KB
testcase_07 AC 201 ms
256,088 KB
testcase_08 AC 158 ms
192,212 KB
testcase_09 AC 87 ms
88,640 KB
testcase_10 AC 199 ms
252,288 KB
testcase_11 AC 151 ms
181,964 KB
testcase_12 AC 141 ms
165,824 KB
testcase_13 AC 88 ms
90,476 KB
testcase_14 AC 248 ms
320,200 KB
testcase_15 AC 284 ms
363,184 KB
testcase_16 AC 138 ms
161,364 KB
testcase_17 AC 114 ms
126,700 KB
testcase_18 AC 87 ms
87,480 KB
testcase_19 AC 93 ms
96,916 KB
testcase_20 AC 242 ms
312,852 KB
testcase_21 AC 109 ms
119,276 KB
testcase_22 AC 90 ms
91,504 KB
testcase_23 AC 395 ms
467,444 KB
testcase_24 AC 394 ms
467,332 KB
testcase_25 AC 393 ms
467,352 KB
testcase_26 AC 412 ms
467,604 KB
testcase_27 AC 385 ms
467,448 KB
testcase_28 AC 385 ms
467,640 KB
testcase_29 AC 386 ms
467,396 KB
testcase_30 AC 386 ms
467,280 KB
testcase_31 AC 390 ms
467,432 KB
testcase_32 AC 385 ms
467,288 KB
testcase_33 AC 474 ms
467,444 KB
testcase_34 AC 71 ms
71,308 KB
testcase_35 AC 71 ms
71,248 KB
testcase_36 AC 76 ms
76,388 KB
testcase_37 AC 77 ms
76,500 KB
testcase_38 AC 471 ms
465,772 KB
testcase_39 AC 472 ms
466,668 KB
testcase_40 AC 469 ms
465,512 KB
testcase_41 AC 471 ms
466,584 KB
testcase_42 AC 464 ms
459,592 KB
testcase_43 AC 442 ms
443,660 KB
testcase_44 AC 451 ms
447,732 KB
testcase_45 AC 467 ms
460,696 KB
testcase_46 AC 454 ms
450,584 KB
testcase_47 AC 457 ms
455,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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