結果

問題 No.1006 Share an Integer
ユーザー 👑 timitimi
提出日時 2020-10-14 17:23:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 359 bytes
コンパイル時間 1,291 ms
コンパイル使用メモリ 87,024 KB
実行使用メモリ 108,076 KB
最終ジャッジ日時 2023-09-28 00:41:20
合計ジャッジ時間 19,716 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 717 ms
107,292 KB
testcase_01 AC 752 ms
107,232 KB
testcase_02 AC 706 ms
107,244 KB
testcase_03 WA -
testcase_04 AC 750 ms
107,388 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 775 ms
107,244 KB
testcase_09 AC 735 ms
107,292 KB
testcase_10 AC 754 ms
107,292 KB
testcase_11 AC 730 ms
107,696 KB
testcase_12 AC 720 ms
107,744 KB
testcase_13 AC 732 ms
107,968 KB
testcase_14 AC 767 ms
107,944 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 759 ms
107,732 KB
testcase_19 AC 776 ms
107,580 KB
testcase_20 AC 779 ms
107,544 KB
testcase_21 AC 759 ms
107,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
x=2*(10**6)
D=[0]*(2*x+2)
for i in range(1,2*x+2):
  d=i
  D[i]+=-1+i
  while d+i<=2*x:
    d+=i
    D[d]-=1
A=[]
n=x
for i in range(1,N):
  a,b=i,N-i
  if a>b:
    break
  d=abs(D[a]-D[b])
  if n==d:
    A.append((a,b))
    A.append((b,a))
  elif n>d:
    A=[]
    n=d
    A.append((a,b))
    A.append((b,a))
for a,b in sorted(A):
  print(a,b)
0