結果

問題 No.2718 Best Consonance
ユーザー ShirotsumeShirotsume
提出日時 2024-04-06 11:58:00
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 867 bytes
コンパイル時間 356 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 107,792 KB
最終ジャッジ日時 2024-04-07 00:19:58
合計ジャッジ時間 59,978 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
57,676 KB
testcase_01 AC 44 ms
57,676 KB
testcase_02 AC 43 ms
57,676 KB
testcase_03 AC 44 ms
57,676 KB
testcase_04 AC 44 ms
57,676 KB
testcase_05 AC 43 ms
57,676 KB
testcase_06 AC 43 ms
57,676 KB
testcase_07 AC 43 ms
57,676 KB
testcase_08 AC 43 ms
57,676 KB
testcase_09 AC 82 ms
78,800 KB
testcase_10 AC 86 ms
78,804 KB
testcase_11 AC 84 ms
78,800 KB
testcase_12 AC 83 ms
78,928 KB
testcase_13 AC 85 ms
78,800 KB
testcase_14 AC 2,626 ms
99,652 KB
testcase_15 AC 2,043 ms
101,600 KB
testcase_16 AC 2,169 ms
95,936 KB
testcase_17 AC 1,720 ms
92,216 KB
testcase_18 AC 2,366 ms
101,276 KB
testcase_19 AC 1,950 ms
94,004 KB
testcase_20 AC 2,627 ms
99,656 KB
testcase_21 AC 2,481 ms
98,552 KB
testcase_22 AC 2,582 ms
107,792 KB
testcase_23 AC 1,545 ms
90,700 KB
testcase_24 AC 2,735 ms
100,620 KB
testcase_25 AC 2,757 ms
100,748 KB
testcase_26 AC 2,746 ms
101,132 KB
testcase_27 AC 2,722 ms
100,748 KB
testcase_28 AC 2,730 ms
100,748 KB
testcase_29 AC 2,704 ms
100,620 KB
testcase_30 AC 2,719 ms
100,748 KB
testcase_31 AC 2,732 ms
100,620 KB
testcase_32 AC 2,729 ms
100,748 KB
testcase_33 AC 2,731 ms
101,132 KB
testcase_34 AC 42 ms
57,676 KB
testcase_35 AC 42 ms
57,676 KB
testcase_36 AC 3,255 ms
99,340 KB
testcase_37 AC 42 ms
57,676 KB
testcase_38 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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 ** 61 - 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))
            g = a // i
            ans = max(ans, a * b // (a * c[g] // g))
    for i in range(1, a + 1):
        if i * i > a:
            break
        if a % i == 0:
            g = i
            c[g] = min(c[g], a)
            g = a // i
            c[g] = min(c[g], a)

print(ans)
            
            
0