結果
問題 |
No.3071 Double Speedrun
|
ユーザー |
![]() |
提出日時 | 2025-03-31 17:49:55 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 597 bytes |
コンパイル時間 | 375 ms |
コンパイル使用メモリ | 82,204 KB |
実行使用メモリ | 65,700 KB |
最終ジャッジ日時 | 2025-03-31 17:50:37 |
合計ジャッジ時間 | 2,259 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 3 |
other | RE * 14 |
ソースコード
L, R, M = map(int, input().split()) left_deg = [0] * L right_deg = [0] * R edges = [] for _ in range(M): a, b = map(int, input().split()) edges.append((a, b)) left_deg[a] += 1 right_deg[b] += 1 d_left = min(left_deg) if L > 0 else 0 d_right = min(right_deg) if R > 0 else 0 d = min(d_left, d_right) left_counts = [0] * L right_counts = [0] * R result = [] for a, b in edges: c = (left_counts[a] + right_counts[b]) % d result.append(c) left_counts[a] = (left_counts[a] + 1) % d right_counts[b] = (right_counts[b] + 1) % d print(d) for c in result: print(c)