結果

問題 No.1006 Share an Integer
ユーザー 👑 H20H20
提出日時 2021-08-19 17:27:35
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 281 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 82,512 KB
実行使用メモリ 91,520 KB
最終ジャッジ日時 2024-04-20 20:15:07
合計ジャッジ時間 4,559 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,664 KB
testcase_01 AC 38 ms
52,532 KB
testcase_02 AC 41 ms
59,292 KB
testcase_03 WA -
testcase_04 AC 43 ms
59,752 KB
testcase_05 AC 47 ms
62,420 KB
testcase_06 AC 47 ms
61,588 KB
testcase_07 AC 51 ms
62,676 KB
testcase_08 AC 46 ms
61,920 KB
testcase_09 AC 47 ms
61,632 KB
testcase_10 AC 46 ms
61,560 KB
testcase_11 AC 172 ms
84,784 KB
testcase_12 AC 316 ms
90,952 KB
testcase_13 AC 344 ms
91,520 KB
testcase_14 AC 327 ms
91,196 KB
testcase_15 AC 275 ms
89,064 KB
testcase_16 AC 140 ms
82,228 KB
testcase_17 AC 181 ms
84,708 KB
testcase_18 AC 264 ms
89,332 KB
testcase_19 AC 272 ms
88,512 KB
testcase_20 AC 273 ms
89,924 KB
testcase_21 AC 325 ms
91,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
L = [0]*(N+1)
for i in range(1,N+1):
    for j in range(i,N+1,i):
        L[j]+=1
f = 10**10
for i in range(N+1):
    a = i
    b = N-a
    f = min(f,abs(a-L[a]-b+L[b]))
for i in range(N+1):
    a = i
    b = N-a
    if abs(a-L[a]-b+L[b])==f:
        print(a,N-a)
0