結果

問題 No.1006 Share an Integer
ユーザー syunsukesyunsuke
提出日時 2020-09-01 22:34:31
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 346 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 82,172 KB
実行使用メモリ 78,440 KB
最終ジャッジ日時 2024-04-30 21:36:44
合計ジャッジ時間 4,366 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
60,632 KB
testcase_01 AC 43 ms
59,096 KB
testcase_02 AC 48 ms
61,576 KB
testcase_03 AC 40 ms
52,788 KB
testcase_04 AC 46 ms
61,760 KB
testcase_05 AC 53 ms
61,472 KB
testcase_06 AC 55 ms
61,680 KB
testcase_07 AC 57 ms
61,604 KB
testcase_08 AC 52 ms
62,516 KB
testcase_09 AC 56 ms
62,092 KB
testcase_10 AC 55 ms
61,952 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 #

N=int(input())
L=[i for i in range(N+1)]
for i in range(2,N+1):
    for j in range(1,N+1):
        if i*j<=N:
            L[i*j]-=1
#print(L)
SA=10**9
ans=[]
for i in range(1,N+1):
    if abs(L[i]-L[N-i])<SA:
        SA=abs(L[i]-L[N-i])
        ans=[[i,N-i]]
    elif abs(L[i]-L[N-i])==SA:
        ans.append([i,N-i])
for i in ans:
    print(*i)
0