結果

問題 No.1544 [Cherry 2nd Tune C] Synchroscope
ユーザー ayaoniayaoni
提出日時 2021-06-13 00:10:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 147 ms / 2,000 ms
コード長 585 bytes
コンパイル時間 330 ms
コンパイル使用メモリ 82,368 KB
実行使用メモリ 62,588 KB
最終ジャッジ日時 2024-05-10 02:42:38
合計ジャッジ時間 4,866 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
54,088 KB
testcase_01 AC 39 ms
52,584 KB
testcase_02 AC 39 ms
53,476 KB
testcase_03 AC 44 ms
60,980 KB
testcase_04 AC 44 ms
61,100 KB
testcase_05 AC 44 ms
62,000 KB
testcase_06 AC 44 ms
61,252 KB
testcase_07 AC 43 ms
60,792 KB
testcase_08 AC 43 ms
60,160 KB
testcase_09 AC 43 ms
61,044 KB
testcase_10 AC 43 ms
61,864 KB
testcase_11 AC 43 ms
60,932 KB
testcase_12 AC 43 ms
60,316 KB
testcase_13 AC 43 ms
60,160 KB
testcase_14 AC 44 ms
61,832 KB
testcase_15 AC 43 ms
61,644 KB
testcase_16 AC 42 ms
60,584 KB
testcase_17 AC 43 ms
60,388 KB
testcase_18 AC 43 ms
60,864 KB
testcase_19 AC 43 ms
59,336 KB
testcase_20 AC 43 ms
61,972 KB
testcase_21 AC 42 ms
60,272 KB
testcase_22 AC 43 ms
61,304 KB
testcase_23 AC 43 ms
61,588 KB
testcase_24 AC 43 ms
61,724 KB
testcase_25 AC 43 ms
61,472 KB
testcase_26 AC 42 ms
61,168 KB
testcase_27 AC 43 ms
61,120 KB
testcase_28 AC 44 ms
61,512 KB
testcase_29 AC 43 ms
61,756 KB
testcase_30 AC 43 ms
62,076 KB
testcase_31 AC 44 ms
61,176 KB
testcase_32 AC 45 ms
61,100 KB
testcase_33 AC 147 ms
61,644 KB
testcase_34 AC 38 ms
52,864 KB
testcase_35 AC 38 ms
53,268 KB
testcase_36 AC 42 ms
59,848 KB
testcase_37 AC 43 ms
60,060 KB
testcase_38 AC 142 ms
61,244 KB
testcase_39 AC 141 ms
61,520 KB
testcase_40 AC 143 ms
61,388 KB
testcase_41 AC 142 ms
62,156 KB
testcase_42 AC 140 ms
61,044 KB
testcase_43 AC 136 ms
61,840 KB
testcase_44 AC 136 ms
62,588 KB
testcase_45 AC 140 ms
61,328 KB
testcase_46 AC 138 ms
60,956 KB
testcase_47 AC 139 ms
62,468 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