結果
| 問題 | 
                            No.1544 [Cherry 2nd Tune C] Synchroscope
                             | 
                    
| コンテスト | |
| ユーザー | 
                            👑  Kazun
                         | 
                    
| 提出日時 | 2021-04-03 00:59:08 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                RE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 263 bytes | 
| コンパイル時間 | 354 ms | 
| コンパイル使用メモリ | 82,560 KB | 
| 実行使用メモリ | 65,152 KB | 
| 最終ジャッジ日時 | 2024-12-14 19:32:20 | 
| 合計ジャッジ時間 | 5,092 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | RE * 48 | 
ソースコード
T=int(input())
for _ in range(T):
    N,M=map(int,input().split())
    A=list(map(int,input().split()))
    B=list(map(int,input().split()))
    for i in range(N*M):
        if A[i%N]==B[i%M]:
            print(i+1)
            break
    else:
        print(-1)
            
            
            
        
            
Kazun