Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
бинарный поиск
nq1s788
Apr 16th, 2024
32
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
Python
0.23 KB
| None
|
0
0
raw
download
clone
embed
print
report
a
=
list
(
map
(
int
,
input
(
)
.
split
(
)
)
)
#[2, 5, 7, 9]
x
=
int
(
input
(
)
)
#индекс первого, >= x
l
=
-
1
r
=
len
(
a
)
while
r - l
>
1
:
m
=
(
l + r
)
//
2
if
a
[
m
]
>=
x:
r
=
m
else
:
l
=
m
print
(
r
)
Add Comment
Please,
Sign In
to add comment
Public Pastes
check.sh
Bash | 17 min ago | 3.12 KB
510 mm/45 Type 98
Lua | 24 min ago | 0.79 KB
508 mm/45 Mk.I
Lua | 24 min ago | 0.74 KB
🤑 G2A.com Free Gift Card Guide Jun 2024 FIX 🎁
GetText | 24 min ago | 0.36 KB
483 mm/50 SK C42
Lua | 24 min ago | 0.74 KB
460 mm/45 Type 94
Lua | 24 min ago | 0.80 KB
457 mm/55 SM-45
Lua | 24 min ago | 0.76 KB
457 mm/48 B-45
Lua | 25 min ago | 0.77 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!