結果

問題 No.1544 [Cherry 2nd Tune C] Synchroscope
ユーザー ayaoniayaoni
提出日時 2021-06-13 00:10:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 180 ms / 2,000 ms
コード長 585 bytes
コンパイル時間 990 ms
コンパイル使用メモリ 86,660 KB
実行使用メモリ 76,656 KB
最終ジャッジ日時 2023-08-22 21:06:13
合計ジャッジ時間 7,386 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,128 KB
testcase_01 AC 72 ms
71,292 KB
testcase_02 AC 70 ms
71,372 KB
testcase_03 AC 80 ms
76,120 KB
testcase_04 AC 78 ms
76,132 KB
testcase_05 AC 77 ms
76,432 KB
testcase_06 AC 78 ms
76,440 KB
testcase_07 AC 76 ms
76,488 KB
testcase_08 AC 78 ms
76,260 KB
testcase_09 AC 77 ms
76,132 KB
testcase_10 AC 76 ms
76,356 KB
testcase_11 AC 77 ms
76,488 KB
testcase_12 AC 77 ms
76,264 KB
testcase_13 AC 76 ms
76,264 KB
testcase_14 AC 78 ms
76,352 KB
testcase_15 AC 77 ms
76,308 KB
testcase_16 AC 77 ms
76,488 KB
testcase_17 AC 76 ms
76,292 KB
testcase_18 AC 75 ms
76,208 KB
testcase_19 AC 76 ms
76,268 KB
testcase_20 AC 77 ms
76,656 KB
testcase_21 AC 76 ms
76,436 KB
testcase_22 AC 77 ms
76,332 KB
testcase_23 AC 78 ms
76,312 KB
testcase_24 AC 79 ms
76,284 KB
testcase_25 AC 78 ms
76,132 KB
testcase_26 AC 76 ms
76,200 KB
testcase_27 AC 77 ms
76,132 KB
testcase_28 AC 78 ms
76,272 KB
testcase_29 AC 75 ms
76,308 KB
testcase_30 AC 77 ms
76,132 KB
testcase_31 AC 77 ms
76,536 KB
testcase_32 AC 77 ms
76,320 KB
testcase_33 AC 180 ms
76,064 KB
testcase_34 AC 74 ms
71,076 KB
testcase_35 AC 75 ms
71,160 KB
testcase_36 AC 77 ms
75,992 KB
testcase_37 AC 75 ms
76,260 KB
testcase_38 AC 176 ms
76,236 KB
testcase_39 AC 174 ms
76,292 KB
testcase_40 AC 175 ms
76,268 KB
testcase_41 AC 176 ms
76,388 KB
testcase_42 AC 175 ms
76,244 KB
testcase_43 AC 174 ms
76,464 KB
testcase_44 AC 171 ms
76,132 KB
testcase_45 AC 174 ms
76,212 KB
testcase_46 AC 174 ms
76,464 KB
testcase_47 AC 172 ms
76,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())


N,M = MI()
A = LI()
B = LI()

for i in range(N*M):
    if A[i % N] == B[i % M]:
        print(i+1)
        break
else:
    print(-1)
0