結果
| 問題 | 
                            No.1544 [Cherry 2nd Tune C] Synchroscope
                             | 
                    
| コンテスト | |
| ユーザー | 
                             Manuel1024
                         | 
                    
| 提出日時 | 2021-04-20 22:47:31 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                RE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 275 bytes | 
| コンパイル時間 | 641 ms | 
| コンパイル使用メモリ | 82,340 KB | 
| 実行使用メモリ | 67,292 KB | 
| 最終ジャッジ日時 | 2024-12-14 19:42:07 | 
| 合計ジャッジ時間 | 4,980 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | RE * 48 | 
ソースコード
t = int(input())
for q in range(t):
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    ans = -1
    for i in range(n*m):
        if a[i%n] == b[i%m]:
            ans = i+1
            break
    print(ans)
            
            
            
        
            
Manuel1024