結果

問題 No.1006 Share an Integer
ユーザー lloyzlloyz
提出日時 2022-05-28 14:40:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 594 ms / 2,000 ms
コード長 341 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 81,756 KB
実行使用メモリ 257,380 KB
最終ジャッジ日時 2023-10-20 23:06:07
合計ジャッジ時間 6,537 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,536 KB
testcase_01 AC 38 ms
53,536 KB
testcase_02 AC 38 ms
60,060 KB
testcase_03 AC 33 ms
53,536 KB
testcase_04 AC 40 ms
60,060 KB
testcase_05 AC 44 ms
62,412 KB
testcase_06 AC 43 ms
62,412 KB
testcase_07 AC 44 ms
62,412 KB
testcase_08 AC 43 ms
62,412 KB
testcase_09 AC 44 ms
62,412 KB
testcase_10 AC 43 ms
62,412 KB
testcase_11 AC 321 ms
161,200 KB
testcase_12 AC 522 ms
236,544 KB
testcase_13 AC 594 ms
257,364 KB
testcase_14 AC 570 ms
257,076 KB
testcase_15 AC 480 ms
217,144 KB
testcase_16 AC 240 ms
143,368 KB
testcase_17 AC 334 ms
182,196 KB
testcase_18 AC 469 ms
216,860 KB
testcase_19 AC 479 ms
217,792 KB
testcase_20 AC 518 ms
239,548 KB
testcase_21 AC 581 ms
257,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

x = int(input())

C = [i for i in range(x + 1)]
for i in range(1, x + 1):
    for j in range(i, x + 1, i):
        C[j] -= 1

D = [[] for _ in range(x)]
for i in range(1, x):
    num = abs(C[i] - C[x - i])
    D[num].append((i, x - i))
for i in range(x):
    if len(D[i]) > 0:
        for a, b in D[i]:
            print(a, b)
        break
0