結果
| 問題 |
No.1286 Stone Skipping
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-19 12:40:41 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 87 ms / 2,000 ms |
| コード長 | 330 bytes |
| コンパイル時間 | 210 ms |
| コンパイル使用メモリ | 82,816 KB |
| 実行使用メモリ | 75,776 KB |
| 最終ジャッジ日時 | 2024-11-23 13:47:51 |
| 合計ジャッジ時間 | 2,516 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
ソースコード
d=int(input())
def distance(x):
res=0
while x>0:
res+=x
x//=2
if res>=d:
break
return res
for i in range(100,0,-1):
t=d*(2**(i-1))//(2**i-1)
for j in range(-50,50):
if t+j<0:
continue
if distance(t+j)==d:
print(t+j)
exit()