NCPC26 final practice - py

This commit is contained in:
Zacharias committed 2026-09-29 17:09:30 +02:00
1 parent f9af40293e
commit 3f62e35eb0
4 files changed
+191

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
import sys
l = 0
r = 1001
m = 500
temp = m
for i in range(10):
print(m)
sys.stdout.flush()
term = input()
if term == "correct":
exit()
elif term == "lower":
temp = m
m = (l + m) // 2
r = temp
else:
temp = m
m = (m + r) // 2
l = temp
+12
View File
@@ -0,0 +1,12 @@
ball = 1
for i in range(5):
j = int(input())
k = int(input())
if j == ball:
ball = k
elif k == ball:
ball = j
print(ball)
+4
View File
@@ -0,0 +1,4 @@
w = int(input())
l = int(input())
print(w*l)