結果

問題 No.1006 Share an Integer
ユーザー lloyzlloyz
提出日時 2022-05-28 14:19:40
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 450 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 81,728 KB
実行使用メモリ 74,936 KB
最終ジャッジ日時 2023-10-20 23:05:36
合計ジャッジ時間 4,704 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,496 KB
testcase_01 AC 38 ms
53,496 KB
testcase_02 AC 43 ms
59,696 KB
testcase_03 AC 36 ms
53,496 KB
testcase_04 AC 43 ms
59,696 KB
testcase_05 AC 50 ms
62,120 KB
testcase_06 AC 47 ms
62,120 KB
testcase_07 AC 47 ms
62,120 KB
testcase_08 AC 48 ms
62,120 KB
testcase_09 AC 47 ms
62,120 KB
testcase_10 AC 47 ms
62,120 KB
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

x = int(input())

C = [0 for _ in range(x + 1)]
for i in range(1, x + 1):
    f = 1
    while f * f <= i:
        if i % f == 0:
            C[i] += 1
            if f * f != i:
                C[i] += 1
        f += 1

D = [[] for _ in range(x)]
for a in range(1, x):
    b = x - a
    num = abs(a - C[a] - b + C[b])
    D[num].append((a, b))

for i in range(x):
    if len(D[i]) > 0:
        for a, b in D[i]:
            print(a, b)
        break
0