結果

問題 No.1006 Share an Integer
ユーザー O2MTO2MT
提出日時 2020-08-15 12:29:01
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 422 bytes
コンパイル時間 365 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 92,032 KB
最終ジャッジ日時 2024-04-19 00:48:41
合計ジャッジ時間 4,779 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
52,096 KB
testcase_01 AC 40 ms
52,096 KB
testcase_02 AC 46 ms
58,880 KB
testcase_03 RE -
testcase_04 AC 46 ms
58,880 KB
testcase_05 AC 49 ms
59,648 KB
testcase_06 AC 49 ms
59,648 KB
testcase_07 AC 49 ms
59,776 KB
testcase_08 AC 49 ms
60,160 KB
testcase_09 AC 49 ms
59,648 KB
testcase_10 AC 49 ms
59,776 KB
testcase_11 AC 189 ms
84,864 KB
testcase_12 AC 330 ms
90,880 KB
testcase_13 AC 327 ms
91,520 KB
testcase_14 AC 350 ms
91,776 KB
testcase_15 AC 286 ms
89,472 KB
testcase_16 AC 147 ms
82,304 KB
testcase_17 AC 192 ms
84,992 KB
testcase_18 AC 285 ms
89,728 KB
testcase_19 AC 280 ms
88,704 KB
testcase_20 AC 290 ms
89,856 KB
testcase_21 AC 352 ms
92,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import sqrt,floor
N = int(input())
l = [0 for _ in range(N+1)]
ans = []
num = 10**9
for i in range(1,N+1):
  for j in range(i,N,i):
    l[j] += 1

for i in range(N//2-(floor(sqrt(N))+1), N//2+floor(sqrt(N))+1):
  num = min(num,abs((i-l[i])-(N-i-l[N-i])))

for i in range(N//2-(floor(sqrt(N))+1), N//2+floor(sqrt(N))+1):
  if num == abs((i-l[i])-(N-i-l[N-i])):
    ans.append((i,N-i))

for i,j in ans:
 print(i,j)
0