結果

問題 No.1006 Share an Integer
ユーザー OhnumaOhnuma
提出日時 2020-04-05 23:25:04
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 480 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 86,956 KB
実行使用メモリ 79,184 KB
最終ジャッジ日時 2023-09-17 21:19:01
合計ジャッジ時間 5,090 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
76,152 KB
testcase_01 AC 73 ms
71,924 KB
testcase_02 AC 81 ms
76,104 KB
testcase_03 RE -
testcase_04 AC 84 ms
76,320 KB
testcase_05 AC 93 ms
77,224 KB
testcase_06 AC 92 ms
77,380 KB
testcase_07 AC 92 ms
77,308 KB
testcase_08 AC 93 ms
77,236 KB
testcase_09 AC 94 ms
77,156 KB
testcase_10 AC 95 ms
77,432 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