結果

問題 No.1006 Share an Integer
ユーザー ogi_welcomeogi_welcome
提出日時 2020-03-06 22:49:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 560 bytes
コンパイル時間 324 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 843,068 KB
最終ジャッジ日時 2024-04-22 10:01:29
合計ジャッジ時間 6,780 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 MLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

d=[0]*(10**7)
def f(n):
    if d[n]!=0:
        return d[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))
    if n>1:
      l.append((n,1))
    ans=1
    for k in l:
      ans*=(k[1]+1)
    d[n]=ans
    return ans
x=int(input())
e=[[] for i in range(10**7)]
for i in range(max(1,x//2-100),min(x,x//2+100)):
    e[abs(i-f(i)-(x-i)+f(x-i))].append((i,x-i))
for i in range(10**7):
  if len(e[i])>0:
    for j in e[i]:
      print(j[0],j[1])
    exit()
0