結果

問題 No.1006 Share an Integer
ユーザー OhnumaOhnuma
提出日時 2020-04-05 23:24:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 480 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 10,952 KB
実行使用メモリ 20,596 KB
最終ジャッジ日時 2023-09-17 21:18:49
合計ジャッジ時間 4,330 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
12,124 KB
testcase_01 AC 15 ms
7,788 KB
testcase_02 AC 18 ms
7,736 KB
testcase_03 RE -
testcase_04 AC 19 ms
8,448 KB
testcase_05 AC 22 ms
8,580 KB
testcase_06 AC 23 ms
8,380 KB
testcase_07 AC 25 ms
8,424 KB
testcase_08 AC 23 ms
8,492 KB
testcase_09 AC 25 ms
8,548 KB
testcase_10 AC 23 ms
8,424 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 #

def divisor(x):
    tank = []
    for i in range(1, int(x**0.5)+1):
        if x%i==0:
            tank.append(i)
            if i!=x//i:
                tank.append(x//i)
    tank.sort()
    return tank

x = int(input())
ans = []
for a in range(1, x-1):
    b = x-a
    fa = a - len(divisor(a))
    fb = b - len(divisor(b))
    ans.append((abs(fa-fb), a, b))
ans.sort(key=lambda x:x[0])

mn = ans[0][0]

for n,a,b in ans:
    if n!=mn:
        break
    else:
        print(a, b)
0