結果

問題 No.1006 Share an Integer
ユーザー tatyamtatyam
提出日時 2020-03-07 00:26:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 401 ms / 2,000 ms
コード長 247 bytes
コンパイル時間 152 ms
コンパイル使用メモリ 82,148 KB
実行使用メモリ 91,772 KB
最終ジャッジ日時 2024-04-22 11:20:49
合計ジャッジ時間 4,897 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
51,968 KB
testcase_01 AC 41 ms
52,096 KB
testcase_02 AC 46 ms
59,008 KB
testcase_03 AC 39 ms
52,224 KB
testcase_04 AC 47 ms
59,392 KB
testcase_05 AC 48 ms
61,184 KB
testcase_06 AC 49 ms
61,056 KB
testcase_07 AC 47 ms
60,800 KB
testcase_08 AC 50 ms
60,800 KB
testcase_09 AC 49 ms
61,056 KB
testcase_10 AC 48 ms
61,184 KB
testcase_11 AC 177 ms
84,480 KB
testcase_12 AC 366 ms
90,700 KB
testcase_13 AC 400 ms
91,648 KB
testcase_14 AC 401 ms
91,520 KB
testcase_15 AC 326 ms
89,160 KB
testcase_16 AC 148 ms
82,368 KB
testcase_17 AC 186 ms
84,732 KB
testcase_18 AC 331 ms
89,088 KB
testcase_19 AC 303 ms
88,696 KB
testcase_20 AC 335 ms
89,636 KB
testcase_21 AC 396 ms
91,772 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
mn = 9e9
for i in range(1,x):
    mn = min(mn, abs(f[i]-f[x-i]))
for i in range(1,x):
    if mn == abs(f[i]-f[x-i]):
        print(i, x-i)
0