結果

問題 No.1006 Share an Integer
ユーザー ogi_welcomeogi_welcome
提出日時 2020-03-06 23:30:54
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 483 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 82,852 KB
実行使用メモリ 131,908 KB
最終ジャッジ日時 2024-04-22 10:39:22
合計ジャッジ時間 5,787 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
111,648 KB
testcase_01 AC 95 ms
104,468 KB
testcase_02 AC 99 ms
104,912 KB
testcase_03 AC 98 ms
104,496 KB
testcase_04 WA -
testcase_05 AC 108 ms
105,372 KB
testcase_06 AC 108 ms
105,384 KB
testcase_07 AC 111 ms
105,376 KB
testcase_08 AC 107 ms
105,172 KB
testcase_09 AC 111 ms
105,644 KB
testcase_10 AC 108 ms
104,964 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 TLE -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(n):
    l=[]
    for i in range(2,int(n**0.5)+1):
      if n%i==0:
        cnt=0
        while n%i==0:
          cnt+=1
          n//=i
        l.append((i,cnt))
    ans=1
    if n>1:
      l.append((n,1))
    for k in l:
      ans*=(k[1]+1)
    return ans
x=int(input())
e=[[] for i in range(10**6+1)]
q=10**6+2
for i in range(max(1,int(x**0.5)-10),min(x,int(x*0.5)+10)):
    r=abs(i-f(i)-(x-i)+f(x-i))
    e[r].append((i,x-i))
    q=min(q,r)
for j in e[q]:
  print(j[0],j[1])
0