結果

問題 No.1006 Share an Integer
ユーザー ogi_welcomeogi_welcome
提出日時 2020-03-06 23:42:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 461 ms / 2,000 ms
コード長 287 bytes
コンパイル時間 398 ms
コンパイル使用メモリ 82,348 KB
実行使用メモリ 91,648 KB
最終ジャッジ日時 2024-04-22 10:45:03
合計ジャッジ時間 5,543 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,096 KB
testcase_01 AC 39 ms
51,712 KB
testcase_02 AC 43 ms
58,752 KB
testcase_03 AC 38 ms
51,968 KB
testcase_04 AC 43 ms
58,624 KB
testcase_05 AC 48 ms
60,800 KB
testcase_06 AC 48 ms
60,672 KB
testcase_07 AC 48 ms
60,928 KB
testcase_08 AC 49 ms
61,056 KB
testcase_09 AC 49 ms
61,056 KB
testcase_10 AC 48 ms
60,416 KB
testcase_11 AC 222 ms
84,608 KB
testcase_12 AC 409 ms
90,796 KB
testcase_13 AC 461 ms
91,648 KB
testcase_14 AC 459 ms
91,392 KB
testcase_15 AC 354 ms
89,292 KB
testcase_16 AC 158 ms
82,440 KB
testcase_17 AC 201 ms
84,864 KB
testcase_18 AC 395 ms
89,344 KB
testcase_19 AC 341 ms
88,832 KB
testcase_20 AC 346 ms
89,856 KB
testcase_21 AC 425 ms
91,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

x = int(input())
f = [i for i in range(x)]
for i in range(1,x):
    for j in range(i,x,i):
        f[j] -= 1
ans = 10**18
for i in range(1,x):
    if ans > abs(f[i] - f[x-i]):
        ans = abs(f[i] - f[x-i])
for i in range(1,x):
    if ans == abs(f[i] - f[x-i]):
        print(i, x - i)
0