結果
問題 |
No.2718 Best Consonance
|
ユーザー |
|
提出日時 | 2024-02-07 22:35:55 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 630 bytes |
コンパイル時間 | 406 ms |
コンパイル使用メモリ | 82,408 KB |
実行使用メモリ | 108,476 KB |
最終ジャッジ日時 | 2024-10-01 03:23:42 |
合計ジャッジ時間 | 33,997 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 2 WA * 34 |
ソースコード
import sys, time, random from collections import deque, Counter, defaultdict input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) inf = 2 ** 31 - 1 mod = 998244353 n = ii() AB = [li() for _ in range(n)] AB.sort(key = lambda x: x[0] * x[1], reverse=True) c = [inf] * (2 * 10 ** 5 + 2) ans = 0 for a, b in AB: for i in range(1, a + 1): if i * i > a: break if a % i == 0: g = i ans = max(ans, a * b // (a * c[g] // g)) c[g] = min(c[g], a) print(ans)