Skip to content

Instantly share code, notes, and snippets.

@stek29 stek29/CREAT.py
Created Aug 10, 2019

Embed
What would you like to do?
park.mail.ru entry tests
class FUCK:
def __init__(self):
self.x = list()
self.n = 0
def CREATE(self, N):
self.n = N
self.x = [0] * self.n
def SET(self, L, R, val):
for i in range(L, R):
self.x[i] = val
def GET_MIN(self, L, R):
return min((self.x[i] for i in range(L, R)))
def ADD(self, L, R, val):
for i in range(L, R):
self.x[i] += val
def GET_SUM(self, L, R):
return sum((self.x[i] for i in range(L, R)))
def PRINT(x):
print(x, end=' ')
# Example:
f = FUCK()
f.CREATE(15)
for I in range(0,13 +1):
J = 0
while (I - J >= 0) and (I + J <= 15):
f.ADD(I - J, I + J, J * ((I % 2) * 2 - 1))
J += 1
f.SET(I, I + 2, f.GET_MIN(I, I + 2))
PRINT(f.GET_MIN(0, 15))
PRINT(f.GET_MIN(1, 2))
PRINT(f.GET_MIN(4, 5))
PRINT(f.GET_MIN(11, 14))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.