結果
| 問題 | No.1006 Share an Integer |
| コンテスト | |
| ユーザー |
Ohnuma
|
| 提出日時 | 2020-04-05 23:24:38 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 480 bytes |
| 記録 | |
| コンパイル時間 | 289 ms |
| コンパイル使用メモリ | 21,280 KB |
| 実行使用メモリ | 24,572 KB |
| 最終ジャッジ日時 | 2026-08-06 14:51:43 |
| 合計ジャッジ時間 | 6,084 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 RE * 1 TLE * 1 -- * 10 |
ソースコード
def divisor(x):
tank = []
for i in range(1, int(x**0.5)+1):
if x%i==0:
tank.append(i)
if i!=x//i:
tank.append(x//i)
tank.sort()
return tank
x = int(input())
ans = []
for a in range(1, x-1):
b = x-a
fa = a - len(divisor(a))
fb = b - len(divisor(b))
ans.append((abs(fa-fb), a, b))
ans.sort(key=lambda x:x[0])
mn = ans[0][0]
for n,a,b in ans:
if n!=mn:
break
else:
print(a, b)
Ohnuma