結果
問題 | No.1006 Share an Integer |
ユーザー |
![]() |
提出日時 | 2020-03-06 22:07:34 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 480 bytes |
コンパイル時間 | 318 ms |
コンパイル使用メモリ | 82,140 KB |
実行使用メモリ | 84,940 KB |
最終ジャッジ日時 | 2024-04-22 07:55:44 |
合計ジャッジ時間 | 3,418 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 37 ms
53,216 KB |
testcase_01 | AC | 38 ms
53,352 KB |
testcase_02 | AC | 41 ms
59,496 KB |
testcase_03 | WA | - |
testcase_04 | AC | 42 ms
58,920 KB |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | AC | 41 ms
59,324 KB |
testcase_09 | AC | 42 ms
59,024 KB |
testcase_10 | AC | 42 ms
59,296 KB |
testcase_11 | AC | 128 ms
75,280 KB |
testcase_12 | AC | 227 ms
83,432 KB |
testcase_13 | AC | 211 ms
84,676 KB |
testcase_14 | AC | 259 ms
84,940 KB |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | AC | 181 ms
82,324 KB |
testcase_19 | AC | 184 ms
80,440 KB |
testcase_20 | AC | 197 ms
82,524 KB |
testcase_21 | AC | 240 ms
84,352 KB |
ソースコード
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[::-1]]))