結果

問題 No.2718 Best Consonance
ユーザー shinchanshinchan
提出日時 2024-04-06 03:54:50
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 854 bytes
コンパイル時間 688 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 107,920 KB
最終ジャッジ日時 2024-04-07 00:18:43
合計ジャッジ時間 60,794 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
57,804 KB
testcase_01 AC 44 ms
57,804 KB
testcase_02 AC 43 ms
57,804 KB
testcase_03 AC 44 ms
57,804 KB
testcase_04 AC 44 ms
57,804 KB
testcase_05 AC 44 ms
57,804 KB
testcase_06 AC 44 ms
57,804 KB
testcase_07 AC 45 ms
57,804 KB
testcase_08 AC 46 ms
57,804 KB
testcase_09 AC 84 ms
78,928 KB
testcase_10 AC 86 ms
78,932 KB
testcase_11 AC 86 ms
78,928 KB
testcase_12 AC 85 ms
79,056 KB
testcase_13 AC 85 ms
78,928 KB
testcase_14 AC 2,637 ms
99,780 KB
testcase_15 AC 2,044 ms
101,728 KB
testcase_16 AC 2,164 ms
96,064 KB
testcase_17 AC 1,727 ms
92,216 KB
testcase_18 AC 2,375 ms
101,532 KB
testcase_19 AC 1,927 ms
94,004 KB
testcase_20 AC 2,698 ms
99,784 KB
testcase_21 AC 2,500 ms
98,552 KB
testcase_22 AC 2,586 ms
107,920 KB
testcase_23 AC 1,543 ms
90,828 KB
testcase_24 AC 2,762 ms
100,620 KB
testcase_25 AC 2,764 ms
100,748 KB
testcase_26 AC 2,740 ms
101,132 KB
testcase_27 AC 2,779 ms
100,748 KB
testcase_28 AC 2,764 ms
100,748 KB
testcase_29 AC 2,761 ms
100,620 KB
testcase_30 AC 2,760 ms
100,748 KB
testcase_31 AC 2,758 ms
100,620 KB
testcase_32 AC 2,785 ms
100,748 KB
testcase_33 AC 2,781 ms
101,132 KB
testcase_34 AC 45 ms
57,804 KB
testcase_35 AC 46 ms
57,804 KB
testcase_36 AC 3,318 ms
99,468 KB
testcase_37 AC 46 ms
57,804 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 ** 63 - 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