結果
| 問題 | No.1544 [Cherry 2nd Tune C] Synchroscope |
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2025-05-13 20:06:03 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 255 ms / 2,000 ms |
| + 84µs | |
| コード長 | 302 bytes |
| 記録 | |
| コンパイル時間 | 85 ms |
| コンパイル使用メモリ | 64,656 KB |
| 実行使用メモリ | 59,616 KB |
| 最終ジャッジ日時 | 2026-10-15 07:55:56 |
| 合計ジャッジ時間 | 6,245 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 49 |
ソースコード
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