description stringlengths 171 4k | code stringlengths 94 3.98k | normalized_code stringlengths 57 4.99k |
|---|---|---|
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | for _ in range(int(input())):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
A = sorted(A)[int(N / 2) :]
B = sorted(B)[int(N / 2) :]
B = sorted(B, reverse=True)
C = [(x + y) for x, y in zip(A, B)]
sorted(C)
print(min(C)) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL VAR BIN_OP VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR FUNC_CA... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | cnt = int(input())
for i in range(cnt):
N = int(input())
Ais = list(map(int, input().split()))
Bis = list(map(int, input().split()))
Ais.sort()
Bis.sort()
Ais = Ais[int((N - 1) / 2) :]
Bis = Bis[int((N - 1) / 2) :]
Bis.sort(reverse=True)
median = 2000000001
for j in range(len(Ais... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR BIN_OP BIN_OP V... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | for _ in range(int(input())):
n = int(input())
b = list(map(int, input().split()))
g = list(map(int, input().split()))
b.sort()
g.sort()
for i in range(n // 2):
b[i] += g[i]
for i in range(n // 2, n):
b[i] += g[n + n // 2 - 1 - i]
b.sort()
print(b[n // 2]) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER VAR VAR VAR VAR FOR... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | t = int(input())
for _ in range(t):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
brr = []
arr = []
br = []
a.sort()
b.sort()
for i in range(n // 2, n):
arr.append(a[i])
brr.append(b[i])
for i in range(len(arr)):
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR LIST ASSIGN VAR LIST EXPR FUNC_CALL VAR EXPR FUNC_CALL ... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | t = int(input())
for k in range(t):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ra = n // 2
a.sort()
b.sort()
a = a[ra:]
b = b[ra:]
c = []
m = len(a)
for i in range(0, m):
c.append(a[i] + b[m - 1 - i])
c.sort()
prin... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR ... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | import sys
input = sys.stdin.readline
M = int(1000000000.0) + 7
def solve():
n = int(input())
a = sorted(list(map(int, input().split())))
b = sorted(list(map(int, input().split())))
ans = float("inf")
for i in range(n // 2, n):
ans = min(ans, a[i] + b[n - i - 1 + n // 2])
return ans
... | IMPORT ASSIGN VAR VAR ASSIGN VAR BIN_OP FUNC_CALL VAR NUMBER NUMBER FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR STRING FOR VAR FU... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | for T in range(int(input())):
N = int(input())
A = sorted(map(int, input().split()), reverse=True)[: N // 2 + 1]
B = sorted(map(int, input().split()), reverse=True)[: N // 2 + 1]
print(min(A[i] + B[N // 2 - i] for i in range(N // 2 + 1))) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR NUMBER BIN_OP BIN_OP VAR NUMBER NUMBER EXPR FUNC_CALL VAR ... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | for _ in range(int(input())):
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
A.sort()
B.sort(reverse=1)
z = []
for k in range(n // 2 + 1, n // 2 + 2):
y = []
for i in range(n):
y.append(A[i] + B[(i + k) % n])
y.sor... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR NUMBER ASSIGN VAR LIST FOR VAR FUNC_CALL VAR BIN_OP BIN_OP ... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | t = int(input())
for _ in range(t):
n = int(input())
boys = list(map(int, input().split()))
girls = list(map(int, input().split()))
boys.sort()
girls.sort()
b = []
g = []
ans = []
for i in range(n // 2, n):
b.append(boys[i])
g.append(girls[i])
g.reverse()
for ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR LIST ASSIGN VAR L... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | for _ in range(int(input().strip())):
n = int(input().strip())
arr1 = sorted(list(int(i) for i in input().strip().split()))
arr2 = sorted(list(int(i) for i in input().strip().split()))
temp = arr2[: n // 2]
arr2 = temp + arr2[n // 2 :][::-1]
new_arr = []
for i in range(n):
new_arr.ap... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR BIN_OP... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | t = int(input())
while t > 0:
t -= 1
n = int(input())
a1 = [int(x) for x in input().split()]
a2 = [int(x) for x in input().split()]
a1.sort()
a2.sort()
a1 = a1[(n - 1) // 2 :]
a2 = a2[(n - 1) // 2 :]
a1 = a1[::-1]
a = []
for i in range(len(a1)):
sum = a1[i] + a2[i]
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR NUMBER VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR BIN_OP BIN_OP VAR NUMBER NUMBER ASSIGN VAR VAR ... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | T = int(input())
for _ in range(T):
N = int(input())
A = list(map(int, input().strip().split()))[:N]
B = list(map(int, input().strip().split()))[:N]
A.sort()
B.sort()
start = (N - 1) / 2
end = N - 1
med = 1000000000000000000000000
for i in range((N - 1) // 2, N):
res = A[i] +... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR BIN_O... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | for _ in range(int(input())):
n = int(input())
a = sorted(list(map(int, input().split())))[n // 2 :]
b = sorted(list(map(int, input().split())))[n // 2 :]
b.sort(reverse=True)
c = sorted([(x + y) for x, y in zip(a, b)])
print(c[0]) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR BIN_OP VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR NUMBER ASSIGN ... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | for i in range(int(input())):
n = int(input())
inp1 = list(map(int, input().split()))
inp1.sort()
inp2 = list(map(int, input().split()))
inp2.sort()
if n == 1:
print(inp1[0] + inp2[0])
else:
r = inp1[n // 2] + inp2[n - 1]
for i in range(1, n // 2 + 1):
if ... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR BIN_OP VAR NUMBER VAR NUMB... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | for _ in range(int(input())):
l = int(input())
lis1 = list(map(int, input().split()))
lis2 = list(map(int, input().split()))
lis3 = []
if len(lis1) == 1 and len(lis2) == 1:
print(lis1[0] + lis2[0])
else:
lis1.sort()
lis2.sort()
lis1 = lis1[l // 2 :]
lis2 =... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST IF FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR BIN_OP VA... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | t = int(input())
for i in range(t):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a.sort()
b.sort(reverse=True)
half = b[n // 2 + 1 :]
half1 = half[::-1]
b1 = half1 + b[0 : n // 2 + 1]
l = []
for i in range(0, len(a)):
s = a[i] +... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR NUMBER ASSIGN VAR VAR BIN_OP BIN_OP VAR NUMB... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | for i in range(int(input())):
n = int(input())
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = []
for i in range(n // 2, n):
j = n - (i - n // 2) - 1
C.append(A[i] + B[j])
C = sorted(C)
print(C[0]) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER VAR ASSIGN VA... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | for i in range(int(input())):
n = int(input())
l1 = sorted(list(map(int, input().split())))
l2 = sorted(list(map(int, input().split())))
m = n // 2
a1 = l1[m:]
a2 = l2[::-1]
a = []
for i in range(len(a1)):
a.append(a1[i] + a2[i])
print(min(a)) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR VAR VAR ASSIGN VAR VAR NUMBER... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | for iii in range(int(input())):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
if n % 2 == 0:
n2 = int(n / 2) - 1
else:
n2 = int(n / 2)
a.sort()
b.sort()
a = a[:n2] + sorted(a[n2:], reverse=True)
for i in range(n):
a[i... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_OP FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER ASSIGN VAR F... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | for _ in range(int(input())):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a.sort()
b.sort()
x = int(n / 2)
c = []
for i in range(x):
c.append(a[i] + b[i])
for i in range(x + 1):
c.append(a[i + x] + b[n - i - 1])
c.sort(... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR BIN_OP VAR NUMBER ASSIGN VAR LIST ... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | for testcase in range(int(input())):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
if n == 1:
print(a[0] + b[0])
continue
a.sort()
b.sort()
arra = []
arrb = []
for i in range(n):
if i < n // 2:
arra.append... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR BIN_OP VAR NUMBER VAR NUMBER EXPR FUNC_CALL VAR EXPR FUNC_CALL V... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | t = int(input())
for i in range(t):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a = sorted(a)
b = sorted(b)
start = n // 2
end = n
d = 0
c = []
for i in range(start, end):
d = 0
d = a[i] + b[end - 1]
c.append(d)... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP VAR NU... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | n = int(input())
for i in range(n):
t = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a.sort()
b.sort()
b = b[: t // 2] + sorted(b[t // 2 :], reverse=True)
l = [(a[i] + b[i]) for i in range(t)]
l.sort()
print(l[t // 2]) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR BIN_OP VAR BIN_OP VAR NUMBER FUNC... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | for _ in range(int(input())):
n = int(input())
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))
l1.sort()
l2.sort()
k = n // 2 + 1
median = l1[n - 1] + l2[n - 1]
for i in range(k):
m = l1[k + i - 1] + l2[n - 1 - i]
if m < median:
media... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER NUMBER ASSIGN VAR BIN_O... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | t = int(input())
for x in range(t):
p = []
f = 0
N = int(input())
k = input().split()
o = input().split()
k = [int(y) for y in k]
o = [int(y) for y in o]
k.sort()
o.sort()
for y in range(int(N / 2), N):
p.append(k[y] + o[len(k) - 1 - f])
f += 1
print(min(p)) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR LIST ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR ... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | for _ in range(int(input())):
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
b = [int(i) for i in input().split()]
b.sort(reverse=True)
mid = n // 2
a = a[mid:]
b = b[: mid + 1]
l = []
for i in range(mid + 1):
l.append(a[i] + b[i])
l.sort()
print(... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR VAR VAR ASSIGN VAR VAR BIN_OP VA... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | def solve(N, A, B):
if N == 1:
return A[0] + B[0]
A.sort()
B.sort()
start = N // 2
end = N - 1
res = float("inf")
while start < N:
res = min(res, A[start] + B[end])
start += 1
end -= 1
return res
for i in range(int(input())):
N = int(input())
A =... | FUNC_DEF IF VAR NUMBER RETURN BIN_OP VAR NUMBER VAR NUMBER EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR FUNC_CALL VAR STRING WHILE VAR VAR ASSIGN VAR FUNC_CALL VAR VAR BIN_OP VAR VAR VAR VAR VAR NUMBER VAR NUMBER RETURN VAR FOR VAR FUNC_CALL VAR FUNC_CALL VA... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | def solve():
N = int(input())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
if N == 1:
print(A[0] + B[0])
return
M = (N + 1) // 2
A.sort()
B.sort()
ans = 10**10
i = M - 1
j = N - 1
while i < N:
ans = min(ans, A[i] + B[j])
... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR BIN_OP VAR NUMBER VAR NUMBER RETURN ASSIGN VAR BIN_OP BIN_OP VAR NUMBER NUMBER EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN V... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | t = int(input())
for _ in range(t):
n = int(input())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
a.sort()
b.sort()
a = a[n // 2 :]
b = b[n // 2 :]
ans = 10**18
for i in range(len(a)):
ans = min(ans, b[i] + a[len(a) - 1 - i])
print(ans) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR BIN_OP VAR NUMBER ASSIGN VAR VAR BIN_OP VAR NUMBE... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | for _ in range(int(input())):
n = int(input())
boiz = list(map(int, input().split()))
grils = list(map(int, input().split()))
boiz.sort()
grils.sort()
boiz = boiz[len(boiz) // 2 :]
grils = grils[len(grils) // 2 :]
ans = []
for i in range(len(boiz)):
ans.append(boiz[i] + grils... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR BIN_OP FUNC_CALL VAR VAR NUMBER ASSIGN VAR V... |
N boys and N girls attend a dance class, where N is odd. For today's practice session, they need to form N boy-girl pairs.
The i-th boy has a happiness value of A_{i} and the i-th girl has a happiness value of B_{i}.
A pair consisting of the i-th boy and the j-th girl has a happiness value of A_{i} + B_{j}.
Let the h... | for _ in range(int(input())):
n = int(input())
arr1 = list(map(int, input().split()))
arr2 = list(map(int, input().split()))
low = 3 * pow(10, 9)
mid = (n - 1) // 2
arr1.sort()
arr2.sort()
for i in range(mid, n):
num = arr1[i] + arr2[n - (i - mid) - 1]
low = min(low, num)... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP NUMBER FUNC_CALL VAR NUMBER NUMBER ASSIGN VAR BIN_OP BIN_OP VAR NUMBER NUMBER E... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n, a, c = int(input()), [], 0
for i in range(n):
x, y = list(map(int, input().split()))
a.append([x, y])
a.sort()
for i in range(n):
if a[i][1] >= c:
c = a[i][1]
else:
c = a[i][0]
print(c) | ASSIGN VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR LIST NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR LIST VAR VAR EXPR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR IF VAR VAR NUMBER VAR ASSIGN VAR VAR VAR NUMBER ASSIGN VAR VAR VAR NUMBER EXPR FUNC_CAL... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
time = []
for i in range(n):
tem1, tem2 = input().split()
time.append([int(tem1), int(tem2)])
day = 0
remain = n
time.sort()
i = 0
while remain > 0:
if time[i][0] > time[i][1] and day <= time[i][1]:
day = time[i][1]
remain -= 1
i += 1
else:
day = time[i][... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR LIST FUNC_CALL VAR VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR NUMBER WHILE VAR NUMBER IF VAR VAR NUMBER VAR VAR NUMBER VAR VAR VAR NUMBER A... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
x = []
for i in range(n):
a, b = map(int, input().split())
x.append([a, b])
x = sorted(x)
f = True
for i in range(1, n):
if x[i][1] < x[i - 1][1]:
if x[i][0] >= x[i - 1][1]:
x[i][1] = x[i][0]
else:
f = False
break
if f:
print(x[n - 1][... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR LIST VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR IF VAR VAR NUMBER VAR BIN_OP VAR NUMBER NUMBER IF VAR VAR NUMBER VAR B... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
dates = []
cur = 0
for i in range(n):
a, b = map(int, input().split())
dates.append((b, a))
dates.sort(key=lambda x: (x[1], x[0]))
for x in dates:
if x[0] >= cur:
cur = x[0]
else:
cur = x[1]
print(cur) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR VAR NUMBER VAR NUMBER FOR VAR VAR IF VAR NUMBER VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER EXPR FUNC_CALL VAR VAR |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | lst, day = sorted(list(map(int, input().split())) for _ in range(int(input()))), 0
for i, j in lst:
day = [j, i][j < day]
print(day) | ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR NUMBER FOR VAR VAR VAR ASSIGN VAR LIST VAR VAR VAR VAR EXPR FUNC_CALL VAR VAR |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
date = []
for _ in range(n):
d = input()
d = d.split()
d = list(map(lambda x: int(x), d))
date.append(d)
date.sort()
last_date = date[-1]
last_date_a = last_date[0]
last_date_b = last_date[-1]
date_check = 0
for d in date:
if d[-1] >= date_check:
date_check = d[-1]
elif ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR NUMBER FO... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | def build_lps_table(s):
table = [0] * len(s)
index = 0
for i in range(1, len(s)):
if s[i] == s[index]:
table[i] = index + 1
index += 1
else:
index = table[i - 1]
while index > 0 and s[index] != s[i]:
index = table[index - 1]
... | FUNC_DEF ASSIGN VAR BIN_OP LIST NUMBER FUNC_CALL VAR VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER FUNC_CALL VAR VAR IF VAR VAR VAR VAR ASSIGN VAR VAR BIN_OP VAR NUMBER VAR NUMBER ASSIGN VAR VAR BIN_OP VAR NUMBER WHILE VAR NUMBER VAR VAR VAR VAR ASSIGN VAR VAR BIN_OP VAR NUMBER IF VAR VAR VAR VAR VAR NUMBER ASSIGN... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
arr = []
for i in range(n):
tarr = list(map(int, input().split()))
arr.append(tarr)
arr.sort()
flag = True
best = 0
for i in range(n):
if arr[i][0] < arr[i][0]:
best = arr[i][0]
elif arr[i][1] >= best:
best = arr[i][1]
else:
best = arr[i][0]
print(best) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR VAR NUMBER VAR VAR NUMBER ASSIGN VAR VAR VAR NUMBER IF VAR VA... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
dates = sorted(
sorted([[int(i) for i in input().split()] for _ in range(n)], key=lambda x: x[1]),
key=lambda x: x[0],
)
minima = dates[0][1]
for i in range(len(dates)):
if dates[i][1] >= minima:
minima = dates[i][1]
else:
minima = dates[i][0]
print(minima) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR VAR FUNC_CALL VAR VAR VAR NUMBER VAR NUMBER ASSIGN VAR VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR NUMBER VAR ASSIGN VAR VAR VAR NUMBER ASSIGN VAR VAR VAR NUMBER EXPR FUNC... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | d = [0]
print(
(
[
(d.append(b) if b >= d[-1] else d.append(a))
for a, b in sorted(
[list(map(int, input().split())) for i in range(int(input()))]
)
]
+ d
)[-1]
) | ASSIGN VAR LIST NUMBER EXPR FUNC_CALL VAR BIN_OP VAR VAR NUMBER FUNC_CALL VAR VAR FUNC_CALL VAR VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR NUMBER |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | cycle = int(input())
l0 = []
for n in range(cycle):
l0.append(tuple(map(int, input().split())))
l0.sort()
l1 = [l0[0][1]]
for n in range(cycle - 1):
if l0[n + 1][1] >= l1[n]:
l1.append(l0[n + 1][1])
elif l0[n + 1][0] >= l1[n]:
l1.append(l0[n + 1][0])
else:
l1.append(l1[n])
print(... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR LIST VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER IF VAR BIN_OP VAR NUMBER NUMBER VAR VAR EXPR FUNC_CALL VAR VAR BIN_OP V... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
def line():
return list(map(int, input().split()))
d = []
for _ in range(n):
d.append(line())
d.sort()
flag = True
day = 0
for i in range(n):
if d[i][1] >= day:
day = d[i][1]
else:
day = d[i][0]
print(day) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR VAR NUMBER VAR ASSIGN VAR VAR VAR NUMBER ASSIG... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
a = sorted([tuple(map(int, input().split())) for _ in range(n)])
prev = 0
for big, small in a:
prev = small if prev <= small else big
print(prev) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER FOR VAR VAR VAR ASSIGN VAR VAR VAR VAR VAR EXPR FUNC_CALL VAR VAR |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
dates = []
for i in range(n):
line = input().split()
dates.append([int(line[0]), int(line[1])])
dates.sort()
curr_date = 0
for date in dates:
if curr_date <= date[1]:
curr_date = date[1]
else:
curr_date = date[0]
print(curr_date) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR LIST FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER EXPR FUNC_CALL VAR ... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | q = int(input())
inputlist = []
for j in range(q):
inputlist.append(list(map(int, input().split())))
def Sorter(sub_li):
auxilliary = sorted(sub_li, key=lambda x: x[0])
leftend = 0
rightend = 0
j = 0
while j < len(auxilliary) - 1:
key = auxilliary[j][0]
if auxilliary[j + 1][0] ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF ASSIGN VAR FUNC_CALL VAR VAR VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER WHILE VAR BIN_OP FUNC_CALL VAR VAR NUMBER ASSIGN VAR VAR VAR ... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | class Exam:
def __init__(self, actual, early):
self.actual = actual
self.early = early
exams = []
n = int(input())
for i in range(n):
a, e = map(int, input().split())
exams.append(Exam(a, e))
exams.sort(key=lambda x: (x.actual, x.early))
minimum = -1
for i in range(n):
if minimum <= e... | CLASS_DEF FUNC_DEF ASSIGN VAR VAR ASSIGN VAR VAR ASSIGN VAR LIST ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR VAR VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR VAR VAR ASSIGN... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
x = []
y = []
for i in range(n):
ai, bi = map(int, input().split())
x.append(ai)
y.append(bi)
zipped_pairs = zip(x, y)
data = [i for _, i in sorted(zipped_pairs)]
record = 0
x.sort()
for i in range(n):
if data[i] >= record:
record = data[i]
else:
record = x[i]
print(... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER EXPR FUNC_CALL VAR FOR VAR F... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
a = []
for i in range(n):
a.append([int(i) for i in input().split()])
a.sort()
mn = min(a[0])
for i in range(len(a)):
if a[i][1] >= mn:
mn = a[i][1]
else:
mn = a[i][0]
print(mn) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR NUMBER VAR ASSIGN VAR VAR VAR NUMBER ASSIGN VAR VAR VAR NUMBER EXPR ... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | m = []
a = []
for _ in range(int(input())):
l, r = [int(x) for x in input().split()]
m.append(l)
a.append(r)
d = sorted(zip(m, a))
mina = -1
for l, r in d:
if r >= mina:
mina = r
else:
mina = l
print(mina) | ASSIGN VAR LIST ASSIGN VAR LIST FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR ASSIGN VAR NUMBER FOR VAR VAR VAR IF VAR VAR ASSIGN VAR VAR ASSIGN VAR VAR EXPR FUNC... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
l = []
for i in range(n):
l.append([int(x) for x in input().split()])
l.sort()
curDay = 0
for a, b in l:
if b >= curDay:
curDay = b
else:
curDay = a
print(curDay) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR VAR VAR IF VAR VAR ASSIGN VAR VAR ASSIGN VAR VAR EXPR FUNC_CALL VAR VAR |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
exams = []
max_date = 0
for i in range(n):
a, b = map(int, input().split())
if a > max_date:
max_date = a
exams.append([a, b])
exams.sort()
i = 0
last_day = 0
now = exams[i][1]
while i < n - 1:
if now > exams[i + 1][1]:
now = exams[i + 1][0]
else:
now = exams... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR VAR ASSIGN VAR VAR EXPR FUNC_CALL VAR LIST VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR VAR VAR NUMBER WHILE VAR BIN_OP VAR NUMB... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
l = []
for i in range(n):
ch = input()
l1 = ch.split()
l.append((int(l1[0]), int(l1[1])))
l.sort()
m = l[0][1]
i = 1
while i < len(l):
if l[i][1] >= m:
m = l[i][1]
else:
m = l[i][0]
i = i + 1
print(m) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER NUMBER ASSIGN VAR NUMBER WHILE VAR FUNC_CALL VAR VAR IF VAR VAR NUMBER VAR ASSI... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
dic = {}
for i in range(n):
a, b = map(int, input().split())
if a in dic:
dic[a].append(b)
else:
dic[a] = [b]
ans = []
f = 0
for key in sorted(dic.keys()):
for i in sorted(dic[key]):
if len(ans) == 0:
ans.append(min(dic[key]))
f = min(dic[... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR DICT FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR VAR EXPR FUNC_CALL VAR VAR VAR ASSIGN VAR VAR LIST VAR ASSIGN VAR LIST ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR VAR IF FUNC_CALL VAR VAR... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
l = []
s = []
for i in range(n):
a, b = input().split()
l.append([int(a), int(b)])
l.sort()
v = l[0][1]
for i in range(1, n):
if l[i][1] < v:
v = l[i][0]
else:
v = l[i][1]
print(v) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR LIST FUNC_CALL VAR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR IF VAR VAR NUMBER VAR ASSIGN VAR VAR VAR NU... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | def input_data():
n = int(input())
return [tuple(map(int, input().split())) for line in range(n)]
data = sorted(input_data())
last_day = data[0][1]
for day in data:
last_day = day[1] if day[1] >= last_day else day[0]
print(last_day) | FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR NUMBER NUMBER FOR VAR VAR ASSIGN VAR VAR NUMBER VAR VAR NUMBER VAR NUMBER EXPR FUNC_CALL VAR VAR |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
x, p = n * [0], n * [0]
for i in range(0, n):
x[i], p[i] = map(int, input().split())
x, p = (list(t) for t in zip(*sorted(zip(x, p))))
list1 = [x[0], p[0]]
c = min(list1)
for i in range(1, n):
list1 = [x[i], p[i]]
j = min(list1)
if j >= c:
c = j
else:
c = max(list1)
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR BIN_OP VAR LIST NUMBER BIN_OP VAR LIST NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR ASSIGN VAR LIST VAR NUMBER VAR NUMB... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | every = []
for i in range(int(input())):
line = list(map(int, input().split()))
every.append(line)
every.sort(key=lambda x: x[1])
every.sort(key=lambda x: x[0])
day = every[0][1]
for i in every:
if i[1] >= day:
day = i[1]
else:
day = i[0]
print(day) | ASSIGN VAR LIST FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR VAR NUMBER ASSIGN VAR VAR NUMBER NUMBER FOR VAR VAR IF VAR NUMBER VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER E... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | I = lambda: list(map(int, input().split(" ")))
n = int(input())
lst = []
for _ in range(n):
lst.append(I())
lst = sorted(lst)
c = min(lst[0])
for i in range(1, len(lst)):
cur = lst[i]
c = cur[1] if cur[1] >= c else cur[0]
print(c) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER FUNC_CALL VAR VAR ASSIGN VAR VAR VAR A... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | def find_last_date(exams):
dates = []
sorted_exams = sorted(exams, key=lambda ex: (ex[0], ex[1]))
prev = 0
for act_date, poss_date in sorted_exams:
if poss_date >= prev:
dates.append(poss_date)
prev = poss_date
else:
dates.append(act_date)
... | FUNC_DEF ASSIGN VAR LIST ASSIGN VAR FUNC_CALL VAR VAR VAR NUMBER VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR VAR IF VAR VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR VAR RETURN VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR EX... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | def main():
day = []
for _ in range(int(input())):
day.append(tuple(map(int, input().split())))
day = sorted(day)
last = 0
for x in day:
if last <= x[1]:
last = x[1]
else:
last = x[0]
print(last)
main() | FUNC_DEF ASSIGN VAR LIST FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
arr = []
for _ in range(n):
a, b = map(int, input().split())
arr.append((a, b))
arr.sort()
cnt = 0
if n == 1:
print(min(arr[0]))
else:
prev = arr[0][1]
for i in range(1, n):
if arr[i][1] >= prev:
prev = arr[i][1]
cnt = arr[i][1]
elif arr[i][0]... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER VA... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | t = []
x = int(input())
for k in range(x):
t.append(list(map(int, input().split())))
t.sort()
u = t[0][0]
y = min(t[0])
if x > 1:
for j in range(1, x):
if t[j][0] > y and t[j][1] < y:
u = t[j][0]
y = t[j][0]
elif t[j][1] > y and t[j][0] < y:
u = t[j][0]
... | ASSIGN VAR LIST ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER IF VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR IF VAR VAR NUMBER VAR VAR VAR NUM... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
input_list = []
for _ in range(n):
input_list.append([int(x) for x in input().split()])
def my_fun(the_list, num):
the_list.sort()
min_date = 0
for i in range(n):
if min_date <= input_list[i][1]:
min_date = input_list[i][1]
else:
min_date = inpu... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF EXPR FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR VAR VAR NUMBER ASSIGN VAR VAR VAR NUMBER ASSIGN VAR VAR VAR NUMBER EXPR FUNC_CALL VAR VAR EXPR ... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
M = [list(map(int, input().split())) for i in range(n)]
M.sort()
g = 0
for i in range(n):
if min(M[i][0], M[i][1]) < g:
g = max(M[i][0], M[i][1])
else:
g = min(M[i][0], M[i][1])
print(g) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF FUNC_CALL VAR VAR VAR NUMBER VAR VAR NUMBER VAR ASSIGN VAR FUNC_CALL VAR VAR VAR NUMBER VAR VAR NUMBER ASSIGN VAR FUNC_CALL VA... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
a, b = [], []
for i in range(n):
i, j = map(int, input().split())
a.append(i)
b.append(j)
z = sorted(zip(a, b))
l = [z[0][1]]
for i in range(1, len(z)):
if z[i][1] >= l[i - 1]:
l.append(z[i][1])
else:
l.append(z[i][0])
print(l[-1]) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR LIST LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR ASSIGN VAR LIST VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER FUNC_CALL VAR VAR... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | y = sorted(
[list(map(int, input().split())) for _ in range(int(input()))],
key=lambda k: [k[0], k[1]],
)
ans = -1
for i in y:
ans = i[1] if ans <= i[1] else i[0]
print(ans) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR LIST VAR NUMBER VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR ASSIGN VAR VAR VAR NUMBER VAR NUMBER VAR NUMBER EXPR FUNC_CALL VAR VAR |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | days = []
for i in range(int(input())):
days.append(list(map(int, input().split())))
days.sort(key=lambda x: (x[0], x[1]))
lastDay = 0
for el in days:
if el[1] >= lastDay:
lastDay = el[1]
else:
lastDay = el[0]
print(lastDay) | ASSIGN VAR LIST FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR NUMBER VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR IF VAR NUMBER VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER EXPR FUNC_CALL VAR VAR |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | nrofexams = int(input(""))
exams = []
for i in range(nrofexams):
line = input("").split()
tup = int(line[0]), int(line[1])
exams.append(tup)
exams = sorted(exams)
date = 0
for i in range(len(exams)):
if date <= exams[0][1]:
date = exams[0][1]
else:
date = exams[0][0]
exams.pop(0)... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR STRING ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR NUMBER N... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | def exams(nums):
nums.sort()
ans = nums[0][1]
for i in range(len(nums)):
if ans <= nums[i][1]:
ans = nums[i][1]
else:
ans = nums[i][0]
return ans
n = int(input().strip())
nums = []
for i in range(n):
a, b = map(int, input().strip().split())
nums.append((... | FUNC_DEF EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR VAR NUMBER ASSIGN VAR VAR VAR NUMBER ASSIGN VAR VAR VAR NUMBER RETURN VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
l = sorted([[*map(int, input().split())] for _ in " " * n])
a = 0
for i in l:
if i[1] < a:
a = i[0]
else:
a = max(a, i[1])
print(a) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR LIST FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR BIN_OP STRING VAR ASSIGN VAR NUMBER FOR VAR VAR IF VAR NUMBER VAR ASSIGN VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR VAR NUMBER EXPR FUNC_CALL VAR VAR |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
m = [tuple(map(int, input().split())) for _ in range(n)]
m = sorted(m)
minn = m[0][1]
for i in range(1, n):
if minn <= m[i][1]:
minn = m[i][1]
else:
minn = m[i][0]
print(minn) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR IF VAR VAR VAR NUMBER ASSIGN VAR VAR VAR NUMBER ASSIGN VAR VAR VAR NUMBER EXPR FUNC_CALL VAR VAR |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
days = [list(map(int, input().split())) for i in range(n)]
days.sort()
L = [0]
for i in range(n):
if days[i][1] >= L[i]:
L.append(days[i][1])
else:
L.append(days[i][0])
print(L[-1]) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR LIST NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR VAR NUMBER VAR VAR EXPR FUNC_CALL VAR VAR VAR NUMBER EXPR FUNC_CALL VAR VAR VAR NUMBER EXPR FUNC_CALL VAR VAR NUMBER |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
q = []
for i in range(n):
s = input().split()
a = int(s[0])
b = int(s[1])
q.append([a, b])
q.sort()
cur = q[0][1]
for i in range(1, n):
if cur > q[i][1]:
cur = q[i][0]
else:
cur = q[i][1]
print(cur) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR LIST VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR IF VAR VAR VAR NUMB... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | li = []
for i in range(int(input())):
a, b = map(int, input().split())
li.append([a, b])
li = sorted(li)
day_final = li[0][1]
for j in li:
if j[1] > day_final:
day_final = j[1]
if j[1] < day_final:
day_final = j[0]
else:
continue
print(day_final) | ASSIGN VAR LIST FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR LIST VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR VAR NUMBER NUMBER FOR VAR VAR IF VAR NUMBER VAR ASSIGN VAR VAR NUMBER IF VAR NUMBER VAR ASSIGN VAR VAR NUMBER EXPR FUNC_CALL ... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
ls = [list(map(int, input().split())) for _ in range(n)]
ls.sort()
m = 0
ck = False
for l in ls:
if m <= l[1]:
m = l[1]
else:
m = l[0]
print(m) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER EXPR FUNC_CALL VAR VAR |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
l = []
for x in range(n):
l.append([int(y) for y in input().split()])
def f(x):
return x[0], x[1]
l.sort(key=f)
date = [l[0][1]]
for z in range(1, n):
if l[z][1] >= max(date):
date.append(l[z][1])
else:
date.append(l[z][0])
print(max(date)) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN VAR NUMBER VAR NUMBER EXPR FUNC_CALL VAR VAR ASSIGN VAR LIST VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR IF VAR VAR NUMBER FUNC_CALL VAR VAR EXPR FUNC_... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
lst = []
lst1 = []
for i in range(n):
lst.append([int(i) for i in input().split()])
if n == 1:
ans = lst[0][1]
else:
m = sorted(lst, key=lambda x: (x[0], x[1]))
day = m[0][1]
for i in range(n - 1):
if m[i + 1][1] >= day:
day = m[i + 1][1]
else:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR NUMBER ASSIGN VAR VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR VAR VAR NUMBER VAR NUMBER ASSIGN VAR VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR BIN_OP VAR NU... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | nofsubjects = int(input())
subject_list = []
for i in range(nofsubjects):
subject = input()
subject = subject.split(" ")
subject[0] = int(subject[0])
subject[1] = int(subject[1])
subject_list.append(subject)
subject_list.sort()
nofdays = subject_list[0][1]
subject_list.pop(0)
while subject_list != [... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR NUMBER FUNC_CALL VAR VAR NUMBER ASSIGN VAR NUMBER FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER NUMBER EXPR FUNC_CALL VAR NUMBER... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | class Exam:
def __init__(self, a, b):
self.a = a
self.b = b
def __lt__(self, other):
if self.a == other.a:
return self.b < other.b
return self.a < other.a
n = int(input())
exams = []
for i in range(n):
a, b = [int(x) for x in input().split()]
exams.append(... | CLASS_DEF FUNC_DEF ASSIGN VAR VAR ASSIGN VAR VAR FUNC_DEF IF VAR VAR RETURN VAR VAR RETURN VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VA... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
A, B = list(), list()
check = set()
for i in range(n):
a, b = map(int, input().split())
A.append(a)
B.append(b)
check.add(a)
check = sorted(check)
val = dict()
for x in check:
val[x] = list()
for i in range(n):
val[A[i]].append(B[i])
main_lst = list()
for x in check:
val[x].... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FOR VAR... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | def main():
(n,) = read()
a = []
for i in range(n):
a.append(tuple(read()))
a.sort()
day = 0
for i in range(n):
if day <= a[i][1]:
day = a[i][1]
else:
day = a[i][0]
print(day)
def read(mode=2):
inputs = input().strip()
if mode == 0:
... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR VAR VAR NUMBER ASSIGN VAR VAR VAR NUMBER ASSIGN VAR VAR VAR NUMBER EXPR FUNC_CALL VAR VAR FUNC_DEF NUMBER ASSIGN VAR FUNC_CALL ... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
li = []
for i in range(n):
li += [list(map(int, input().rstrip().split()))]
li.sort(key=lambda x: x[0])
t = min(li[0])
day = li[0][0]
for i in range(1, n):
if min(li[i]) >= t:
t = min(li[i])
elif day == li[i][0] and min(li[i]) <= t:
continue
else:
t = max(li[i])
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR VAR LIST FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR IF FUNC_CALL VAR VAR VAR VAR ASSIGN ... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
arr = []
for i in range(n):
a, b = list(map(int, input().split()))
arr.append([a, b])
arr.sort(key=lambda x: x[0] + float(x[1]) / 20000000)
end = -1
for i in range(len(arr)):
if arr[i][1] >= end:
end = arr[i][1]
else:
end = arr[i][0]
print(end) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR LIST VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR NUMBER BIN_OP FUNC_CALL VAR VAR NUMBER NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
a = [([0] * 2) for x in range(n)]
for x in range(n):
a[x] = list(map(int, input().split()))
a = sorted(a, key=lambda x: x[1])
a = sorted(a, key=lambda x: x[0])
l = min(a[0])
for x in range(1, n):
if min(a[x]) >= l:
l = min(a[x])
else:
l = max(a[x])
print(l) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER NUMBER VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER FOR VAR F... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | t = int(input())
dates = []
for i in range(t):
a1, b1 = map(int, input().split())
a = [a1, b1]
dates.append(a)
dates.sort()
if t == 1:
print(dates[0][1])
else:
if dates[1][1] >= dates[0][1]:
l = dates[0][1]
else:
l = dates[0][0]
for i in range(1, t):
if dates[i][1] < ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST VAR VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR IF VAR NUMBER EXPR FUNC_CALL VAR VAR NUMBER NUMBER IF VAR NUMBER NUMBER VAR NUMBER NUMBER ASSIGN VAR VAR NUMBER NUMB... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
li = []
for i in range(n):
li.append([int(i) for i in input().split()])
li.sort(reverse=True)
last = li.pop()[-1]
while li:
if li[-1][-1] >= last:
last = li.pop()[-1]
else:
last = li.pop()[0]
print(last) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR NUMBER WHILE VAR IF VAR NUMBER NUMBER VAR ASSIGN VAR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VA... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
p = []
for i in range(n):
a, b = map(int, input().split())
p.append([a, b])
p.sort(key=lambda x: (x[0], x[1]))
d = {}
for pair in p:
if not pair[0] in d:
d[pair[0]] = []
d[pair[0]].append(pair[1])
ks = list(d.keys())
cur = max(d[ks[0]])
for i in range(1, len(ks)):
mi = min(d... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR LIST VAR VAR EXPR FUNC_CALL VAR VAR NUMBER VAR NUMBER ASSIGN VAR DICT FOR VAR VAR IF VAR NUMBER VAR ASSIGN VAR VAR NUMBER LIST EXPR FUNC_CALL VAR VAR NUMBER VAR NU... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
a = list()
b = list()
for i in range(n):
x, y = input().split()
a.append([int(x), i])
b.append(int(y))
a.sort()
day = b[a[0][1]]
for i in range(1, n):
if b[a[i][1]] >= day:
day = b[a[i][1]]
elif a[i][0] == a[i - 1][0]:
day = max(day, b[a[i][1]])
else:
day... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR LIST FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER VA... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | import sys
n = int(input())
abn = []
for i in range(n):
a, b = map(int, sys.stdin.readline().split())
abn.append((a, b))
abn.sort(key=lambda x: (x[0], x[1]))
ans = -1
for i in range(n):
if ans <= abn[i][1]:
ans = abn[i][1]
else:
ans = abn[i][0]
print(ans) | IMPORT ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR VAR NUMBER VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR VAR VAR NUMBER ASSIGN VAR VAR VAR NUMBER ASSIGN VAR VAR ... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
L = []
for k in range(n):
a, b = map(int, input().split())
L.append((a, b))
L = sorted(L)
aux = 0
for k in range(n):
if min(L[k]) < aux:
aux = max(L[k])
else:
aux = min(L[k])
print(aux) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF FUNC_CALL VAR VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR ASSIGN VAR FUNC_CALL... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | import sys
data = sys.stdin.read().strip()
data = data.split("\n")
exams = int(data[0])
for i in range(1, len(data)):
data[i] = data[i].split(" ")
data[i][0] = int(data[i][0])
data[i][1] = int(data[i][1])
days = data[1:]
data = None
days.sort()
ordered = True
first = days[0][1]
for i in range(1, len(days))... | IMPORT ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR STRING ASSIGN VAR VAR NUMBER FUNC_CALL VAR VAR VAR NUMBER ASSIGN VAR VAR NUMBER FUNC_CALL VAR VAR VAR NUMBER ASSIGN VAR VAR NUMBER... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input().strip())
l = []
for _ in range(n):
a, b = input().strip().split()
l.append((int(a), int(b)))
l.sort()
date = 0
for a, b in l:
if b > date:
date = b
if b < date:
date = a
print(date) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR VAR VAR IF VAR VAR ASSIGN VAR VAR IF VAR VAR ASSIGN VAR VAR EXPR FUNC_CALL VAR V... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
lst = [[0, 0]] * n
for i in range(n):
lst[i] = list(map(int, input().split()))
lst.sort()
day = lst[0][1]
for i in range(1, len(lst)):
if day <= lst[i][1] and day:
day = lst[i][1]
elif day <= lst[i][0]:
day = lst[i][0]
else:
break
print(day) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST LIST NUMBER NUMBER VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER FUNC_CALL VAR VAR IF VAR VAR VAR NUMBER VAR ASSIGN VAR VAR VA... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
cur_day = 0
y = [tuple(map(int, input().split())) for _ in range(n)]
y.sort()
for a, b in y:
if b >= cur_day:
cur_day = b
else:
cur_day = a
print(cur_day) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FOR VAR VAR VAR IF VAR VAR ASSIGN VAR VAR ASSIGN VAR VAR EXPR FUNC_CALL VAR VAR |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
D = []
for _ in range(n):
D.append(tuple(map(int, input().split())))
D.sort()
date = 0
for d in D:
if date <= min(d[0], d[1]):
date = min(d[0], d[1])
else:
date = d[0]
print(date) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR VAR IF VAR FUNC_CALL VAR VAR NUMBER VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER VAR NUMBER ASSIGN VAR VAR NUMBER EXP... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input())
p = []
for i in range(n):
a, b = map(int, input().split())
p.append((a, b))
p.sort(key=lambda x: (x[0], x[1]))
prev = p[n - 1][1]
possible = True
for i in reversed(range(n - 1)):
if prev >= p[i][0]:
prev = p[i][0]
elif prev >= p[i][1]:
prev = p[i][1]
else:
po... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR VAR NUMBER VAR NUMBER ASSIGN VAR VAR BIN_OP VAR NUMBER NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR BIN_OP VAR NUMBER IF... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | n = int(input(""))
ab = []
total = 0
for i in range(n):
ab.append(tuple(int(x) for x in input("").split(" ")))
ab.sort()
for i in range(n):
total = ab[i][0] if ab[i][1] < total else ab[i][1]
print(total) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR STRING ASSIGN VAR LIST ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING STRING EXPR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR VAR NUMBER VAR VAR VAR NUMBER VAR VAR NUMBER EXPR FUNC_CALL V... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | def main():
n = int(input())
days = []
for i in range(n):
a, b = map(int, input().split())
days.append((a, b))
days.sort()
first = []
second = []
first.append(days[0][0])
second.append(days[0][1])
for i in range(1, n):
day = days[i]
if day[1] >= first[... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR LIST EXPR FUNC_CALL VAR VAR NUMBER NUMBER EXPR FUNC_CALL VAR VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR... |
Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera is a smart guy, so he will be able to pass any exam he takes on his first try. Besides, he can take several exams on one day, and in any order.
According to the schedule, a stud... | N = int(input())
dates = []
for i in range(N):
pair = tuple(map(int, input().split()))
dates.append(pair)
dates.sort()
MinDay = min(dates[0])
for i in dates[1:]:
if i[0] >= MinDay and i[1] >= MinDay:
MinDay = min(i)
elif MinDay >= min(i):
MinDay = max(i)
print(MinDay)
dates.clear() | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER FOR VAR VAR NUMBER IF VAR NUMBER VAR VAR NUMBER VAR ASSIGN VAR FUNC_CALL VAR VAR IF VAR FUNC_C... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.