結果
問題 |
No.1006 Share an Integer
|
ユーザー |
![]() |
提出日時 | 2020-03-06 22:06:38 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 474 bytes |
コンパイル時間 | 223 ms |
コンパイル使用メモリ | 82,532 KB |
実行使用メモリ | 86,064 KB |
最終ジャッジ日時 | 2024-10-14 07:08:30 |
合計ジャッジ時間 | 3,825 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 5 WA * 14 |
ソースコード
import sys input = sys.stdin.readline X = int(input()) A = [i-1 for i in range(X+1)] for x in range(2, X+1): p = x while p <= X: A[p] -= 1 p += x ans = [] s = 10**13 for x in range(1, X//2+1): y = X-x score = abs(A[x]-A[y]) if score < s: ans = [(x, y)] s = score elif score == s: ans.append((x, y)) print("\n".join([str(a)+" "+str(b) for a, b in ans])) print("\n".join([str(b)+" "+str(a) for a, b in ans]))