結果

問題 No.1006 Share an Integer
ユーザー maspymaspy
提出日時 2020-03-06 21:27:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 448 bytes
コンパイル時間 546 ms
コンパイル使用メモリ 82,500 KB
実行使用メモリ 107,264 KB
最終ジャッジ日時 2024-04-22 04:59:33
合計ジャッジ時間 7,971 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 290 ms
91,392 KB
testcase_01 AC 280 ms
91,136 KB
testcase_02 AC 276 ms
91,008 KB
testcase_03 WA -
testcase_04 AC 265 ms
91,204 KB
testcase_05 AC 272 ms
91,388 KB
testcase_06 AC 278 ms
91,392 KB
testcase_07 AC 274 ms
91,136 KB
testcase_08 AC 277 ms
91,264 KB
testcase_09 AC 285 ms
91,136 KB
testcase_10 AC 288 ms
91,520 KB
testcase_11 AC 305 ms
100,300 KB
testcase_12 AC 361 ms
106,216 KB
testcase_13 AC 304 ms
106,880 KB
testcase_14 AC 294 ms
107,264 KB
testcase_15 AC 294 ms
104,764 KB
testcase_16 AC 284 ms
97,664 KB
testcase_17 AC 283 ms
100,608 KB
testcase_18 AC 297 ms
105,088 KB
testcase_19 AC 299 ms
104,192 KB
testcase_20 AC 300 ms
105,216 KB
testcase_21 AC 303 ms
107,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
# %%
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# %%
U = 2 * 10 ** 6 + 10
F = list(range(U))
for n in range(1, U):
    for m in range(n, U, n):
        F[m] -= 1

# %%
X = int(read())
# %%
diff = [abs(F[A] - F[X - A]) for A in range(X + 1)]
min_diff = min(diff)
ind = [i for i, x in enumerate(diff) if x == min_diff]
for a in ind:
    print(a, X - a)
0