結果

問題 No.1006 Share an Integer
ユーザー s_shoheis_shohei
提出日時 2020-04-11 14:53:03
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 429 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 81,568 KB
実行使用メモリ 74,164 KB
最終ジャッジ日時 2023-10-19 05:43:56
合計ジャッジ時間 4,991 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
57,948 KB
testcase_01 AC 39 ms
53,600 KB
testcase_02 AC 61 ms
64,156 KB
testcase_03 AC 38 ms
53,408 KB
testcase_04 AC 54 ms
66,232 KB
testcase_05 AC 70 ms
72,872 KB
testcase_06 AC 68 ms
73,256 KB
testcase_07 AC 71 ms
74,020 KB
testcase_08 AC 67 ms
72,872 KB
testcase_09 AC 70 ms
74,164 KB
testcase_10 AC 71 ms
73,280 KB
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

x=int(input())

def m_div(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

def f(num):
    return num - len(m_div(num))

mn = float("inf")
for a in range(1,x):
    b=x-a
    mn=min(mn,abs(f(a)-f(b)))

for a in range(1,x):
    b=x-a
    if abs(f(a)-f(b))==mn:
        print(a,b)
0