結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
57,676 KB
testcase_01 AC 48 ms
57,676 KB
testcase_02 AC 47 ms
57,676 KB
testcase_03 AC 47 ms
57,676 KB
testcase_04 AC 44 ms
57,676 KB
testcase_05 AC 47 ms
57,676 KB
testcase_06 AC 49 ms
57,676 KB
testcase_07 AC 43 ms
57,676 KB
testcase_08 AC 43 ms
57,676 KB
testcase_09 AC 81 ms
76,116 KB
testcase_10 AC 87 ms
78,932 KB
testcase_11 AC 86 ms
78,928 KB
testcase_12 AC 85 ms
78,800 KB
testcase_13 AC 79 ms
76,752 KB
testcase_14 AC 2,604 ms
99,652 KB
testcase_15 AC 2,039 ms
100,832 KB
testcase_16 AC 2,153 ms
95,936 KB
testcase_17 AC 1,699 ms
92,216 KB
testcase_18 AC 2,350 ms
101,276 KB
testcase_19 AC 1,929 ms
94,132 KB
testcase_20 AC 2,605 ms
99,656 KB
testcase_21 AC 2,464 ms
98,680 KB
testcase_22 AC 2,575 ms
107,792 KB
testcase_23 AC 1,516 ms
90,700 KB
testcase_24 AC 2,726 ms
100,620 KB
testcase_25 AC 2,740 ms
100,748 KB
testcase_26 AC 2,755 ms
101,132 KB
testcase_27 AC 2,733 ms
100,748 KB
testcase_28 AC 2,724 ms
100,748 KB
testcase_29 AC 2,731 ms
100,620 KB
testcase_30 AC 2,724 ms
100,748 KB
testcase_31 AC 2,731 ms
100,620 KB
testcase_32 AC 2,718 ms
100,748 KB
testcase_33 AC 2,723 ms
101,132 KB
testcase_34 AC 43 ms
57,676 KB
testcase_35 AC 43 ms
57,676 KB
testcase_36 AC 3,321 ms
99,340 KB
testcase_37 WA -
権限があれば一括ダウンロードができます

ソースコード

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 ** 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))
            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