結果
問題 | No.1006 Share an Integer |
ユーザー | syunsuke |
提出日時 | 2020-09-01 22:25:45 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 355 bytes |
コンパイル時間 | 241 ms |
コンパイル使用メモリ | 82,148 KB |
実行使用メモリ | 78,740 KB |
最終ジャッジ日時 | 2024-04-30 21:22:43 |
合計ジャッジ時間 | 4,549 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 39 ms
60,196 KB |
testcase_01 | AC | 42 ms
58,316 KB |
testcase_02 | AC | 47 ms
60,212 KB |
testcase_03 | AC | 39 ms
52,404 KB |
testcase_04 | AC | 47 ms
61,252 KB |
testcase_05 | AC | 53 ms
62,268 KB |
testcase_06 | AC | 56 ms
62,692 KB |
testcase_07 | AC | 56 ms
62,252 KB |
testcase_08 | AC | 53 ms
63,136 KB |
testcase_09 | AC | 56 ms
61,480 KB |
testcase_10 | AC | 55 ms
62,552 KB |
testcase_11 | TLE | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
ソースコード
N=int(input()) L=[1 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): A=i-L[i] B=(N-i)-L[(N-i)] if abs(A-B)<SA: SA=abs(A-B) ans=[[i,N-i]] elif abs(A-B)==SA: ans.append([i,N-i]) for i in ans: print(*i)