結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
104,272 KB
testcase_01 AC 96 ms
104,400 KB
testcase_02 AC 96 ms
104,760 KB
testcase_03 AC 99 ms
104,064 KB
testcase_04 AC 97 ms
104,560 KB
testcase_05 AC 99 ms
104,416 KB
testcase_06 AC 98 ms
104,412 KB
testcase_07 AC 97 ms
104,620 KB
testcase_08 AC 98 ms
104,276 KB
testcase_09 AC 99 ms
104,828 KB
testcase_10 AC 96 ms
104,356 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 1,203 ms
104,356 KB
testcase_14 WA -
testcase_15 AC 1,043 ms
104,336 KB
testcase_16 AC 562 ms
104,768 KB
testcase_17 AC 730 ms
104,900 KB
testcase_18 AC 1,049 ms
104,220 KB
testcase_19 AC 1,009 ms
104,608 KB
testcase_20 AC 1,080 ms
104,404 KB
testcase_21 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(n):
    m=n
    l=[]
    for i in range(2,n):
      if n%i==0:
        cnt=0
        while n%i==0:
          cnt+=1
          n//=i
        l.append((i,cnt))
    ans=1
    if len(l)==0:
      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,x//2-20),min(x,x//2+20)):
    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