結果

問題 No.1006 Share an Integer
ユーザー maspymaspy
提出日時 2020-03-06 21:27:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 448 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 107,008 KB
最終ジャッジ日時 2024-10-14 04:08:10
合計ジャッジ時間 11,027 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 WA * 1
権限があれば一括ダウンロードができます

ソースコード

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