結果
| 問題 |
No.1544 [Cherry 2nd Tune C] Synchroscope
|
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2025-05-13 20:10:11 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 302 bytes |
| コンパイル時間 | 265 ms |
| コンパイル使用メモリ | 12,288 KB |
| 実行使用メモリ | 11,136 KB |
| 最終ジャッジ日時 | 2025-05-13 20:10:18 |
| 合計ジャッジ時間 | 6,512 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 38 TLE * 1 -- * 9 |
ソースコード
from math import lcm
from itertools import cycle, islice
N, M = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
t = lcm(N, M)
for i, (a, b) in enumerate(islice(zip(cycle(A), cycle(B)), t)):
if a == b:
print(i+1)
exit()
print(-1)
norioc