description stringlengths 171 4k | code stringlengths 94 3.98k | normalized_code stringlengths 57 4.99k |
|---|---|---|
The only difference between easy and hard versions is constraints.
You are given a sequence $a$ consisting of $n$ positive integers.
Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are $a$ and $b$, $a$ can be equal $b$) and is as follows: $[\unde... | import sys
input = sys.stdin.buffer.readline
def getCnts(j, l, r):
if l > r:
return 0
if l == 0:
return prefCnt[r][j]
else:
return prefCnt[r][j] - prefCnt[l - 1][j]
t = int(input())
for _ in range(t):
n = int(input())
a = [int(x) for x in input().split()]
prefCnt = [... | IMPORT ASSIGN VAR VAR FUNC_DEF IF VAR VAR RETURN NUMBER IF VAR NUMBER RETURN VAR VAR VAR RETURN BIN_OP VAR VAR VAR VAR BIN_OP VAR NUMBER VAR 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 NUMBER ... |
The only difference between easy and hard versions is constraints.
You are given a sequence $a$ consisting of $n$ positive integers.
Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are $a$ and $b$, $a$ can be equal $b$) and is as follows: $[\unde... | import sys
class E2ThreeBlocksPalindromeHardVersion:
def solve(self):
for _ in range(int(input())):
n = int(input())
arr = [int(_) for _ in input().split()]
pos = {x: [] for x in arr}
for i, x in enumerate(arr):
pos[x].append(i)
... | IMPORT CLASS_DEF FUNC_DEF 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 ASSIGN VAR VAR LIST VAR VAR FOR VAR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR VAR ASSIGN VAR NUMBER FOR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR ... |
The only difference between easy and hard versions is constraints.
You are given a sequence $a$ consisting of $n$ positive integers.
Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are $a$ and $b$, $a$ can be equal $b$) and is as follows: $[\unde... | import sys
input = sys.stdin.readline
MOD = 1000000007
MOD2 = 998244353
ii = lambda: int(input())
si = lambda: input()
dgl = lambda: list(map(int, input()))
f = lambda: map(int, input().split())
il = lambda: list(map(int, input().split()))
ls = lambda: list(input())
let = "abcdefghijklmnopqrstuvwxyz"
for _ in range(ii... | IMPORT ASSIGN VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL VAR ASSIGN 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 ... |
The only difference between easy and hard versions is constraints.
You are given a sequence $a$ consisting of $n$ positive integers.
Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are $a$ and $b$, $a$ can be equal $b$) and is as follows: $[\unde... | from sys import stdin
AI = 200
N = 2000
occ = [[(0) for i in range(N + 1)] for ai in range(AI)]
t = int(stdin.readline())
for _ in range(t):
n = int(stdin.readline())
a = [0, *(int(x) - 1 for x in input().split())]
for ai in range(AI):
occ[ai][0] = 0
for i in range(1, n + 1):
oc... | ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER VAR FUNC_CALL VAR BIN_OP VAR NUMBER VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST NUMBER BIN_OP FUNC_CALL VAR VAR NUMBER VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR... |
The only difference between easy and hard versions is constraints.
You are given a sequence $a$ consisting of $n$ positive integers.
Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are $a$ and $b$, $a$ can be equal $b$) and is as follows: $[\unde... | for _ in range(int(input())):
n = int(input())
A = list(map(int, input().split()))
P = [[] for _ in range(27)]
S = set(A)
for i, a in enumerate(A):
P[a].append(i)
ans = 0
for a in S:
for i in range(0, len(P[a]) // 2):
minp = P[a][i]
maxp = P[a][-(1 + 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 LIST VAR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR FOR VAR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR VAR ASSIGN VAR NUMBER FOR VAR VAR FOR VAR... |
The only difference between easy and hard versions is constraints.
You are given a sequence $a$ consisting of $n$ positive integers.
Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are $a$ and $b$, $a$ can be equal $b$) and is as follows: $[\unde... | for _ in range(int(input())):
n = int(input())
arr = list(map(lambda x: int(x) - 1, input().split()))
nxt = [([-1] * 26) for _ in range(n)]
prv = [([-1] * 26) for _ in range(n)]
fst = [-1] * 26
lst = [-1] * 26
initc = [0] * 26
for i in range(n):
initc[arr[i]] += 1
if fst[... | 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 BIN_OP FUNC_CALL VAR VAR NUMBER FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER NUMBER VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP LIST NUMBER NUMBER VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP ... |
The only difference between easy and hard versions is constraints.
You are given a sequence $a$ consisting of $n$ positive integers.
Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are $a$ and $b$, $a$ can be equal $b$) and is as follows: $[\unde... | t = int(input())
for q in range(t):
n = int(input())
l = list(map(int, input().split()))
sl = [[] for i in range(201)]
ss = [[0] for i in range(201)]
for i in range(n):
sl[l[i]].append(i)
for j in range(201):
ss[j].append(ss[j][-1])
ss[l[i]][-1] += 1
ans = 0
... | 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 LIST VAR FUNC_CALL VAR NUMBER ASSIGN VAR LIST NUMBER VAR FUNC_CALL VAR NUMBER FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR VAR VAR FOR... |
The only difference between easy and hard versions is constraints.
You are given a sequence $a$ consisting of $n$ positive integers.
Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are $a$ and $b$, $a$ can be equal $b$) and is as follows: $[\unde... | for _ in range(int(input())):
n = int(input())
r = list(map(int, input().split()))
d = {i: [] for i in range(1, 27)}
for i in range(n):
d[r[i]].append(i)
ans = 1
for end in range(1, 27):
c = 1
while c * 2 <= len(d[end]):
ll, rr = d[end][c - 1] + 1, d[end][-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 VAR LIST VAR FUNC_CALL VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR VAR VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER NUMBER A... |
The only difference between easy and hard versions is constraints.
You are given a sequence $a$ consisting of $n$ positive integers.
Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are $a$ and $b$, $a$ can be equal $b$) and is as follows: $[\unde... | from sys import stdin
def solve(tc):
n = int(stdin.readline().strip())
seq = list(map(int, stdin.readline().split()))
nums = [[] for i in range(200)]
for i in range(n):
nums[seq[i] - 1].append(i)
cum = [[(0) for i in range(200)] for j in range(n + 1)]
for i in range(n):
cum[i +... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST VAR FUNC_CALL VAR NUMBER FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR VAR NUMBER VAR ASSIGN VAR NUMBER VAR FUNC_CALL VAR NUMBER VAR FUNC_CALL VAR BIN_OP VAR NUMBER FOR ... |
The only difference between easy and hard versions is constraints.
You are given a sequence $a$ consisting of $n$ positive integers.
Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are $a$ and $b$, $a$ can be equal $b$) and is as follows: $[\unde... | def distribution(n):
return (n - 1) // 2
def problem_A():
print(distribution(int(input())))
s = "abcdefghijklmnopqrstuvwxyz"
def cons_str(n, b):
a = s[:b]
ans = ""
while n > b:
ans += a
n -= b
ans += a[:n]
return ans
def problem_B():
n, a, b = list(map(int, input(... | FUNC_DEF RETURN BIN_OP BIN_OP VAR NUMBER NUMBER FUNC_DEF EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR STRING FUNC_DEF ASSIGN VAR VAR VAR ASSIGN VAR STRING WHILE VAR VAR VAR VAR VAR VAR VAR VAR VAR RETURN VAR FUNC_DEF ASSIGN VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR E... |
The only difference between easy and hard versions is constraints.
You are given a sequence $a$ consisting of $n$ positive integers.
Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are $a$ and $b$, $a$ can be equal $b$) and is as follows: $[\unde... | import sys
lines = sys.stdin.readlines()
T = int(lines[0].strip())
for t in range(T):
n = int(lines[2 * t + 1].strip())
nums = list(map(int, lines[2 * t + 2].strip().split(" ")))
preSum = {}
kinds = set(nums)
for k in kinds:
preSum[k] = [0]
for num in nums:
for k in kinds:
... | IMPORT ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP NUMBER VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR BIN_OP BIN_OP NUMBER VAR NUMBER STRING ASSIGN VAR DICT ASSIGN VAR FUNC_CALL VA... |
The only difference between easy and hard versions is constraints.
You are given a sequence $a$ consisting of $n$ positive integers.
Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are $a$ and $b$, $a$ can be equal $b$) and is as follows: $[\unde... | def match(a, x, s, e):
matches = []
while s <= e:
while s <= e and a[s] != x:
s += 1
while s <= e and a[e] != x:
e -= 1
if s <= e:
matches.append((s, e))
s += 1
e -= 1
return matches
def solve(a):
ps = [[0] * 27]
f... | FUNC_DEF ASSIGN VAR LIST WHILE VAR VAR WHILE VAR VAR VAR VAR VAR VAR NUMBER WHILE VAR VAR VAR VAR VAR VAR NUMBER IF VAR VAR EXPR FUNC_CALL VAR VAR VAR VAR NUMBER VAR NUMBER RETURN VAR FUNC_DEF ASSIGN VAR LIST BIN_OP LIST NUMBER NUMBER FOR VAR VAR ASSIGN VAR VAR NUMBER VAR VAR NUMBER EXPR FUNC_CALL VAR VAR ASSIGN VAR NU... |
The only difference between easy and hard versions is constraints.
You are given a sequence $a$ consisting of $n$ positive integers.
Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are $a$ and $b$, $a$ can be equal $b$) and is as follows: $[\unde... | def three_blocks_length(sequence, outer, inner):
filtered = list(filter(lambda x: x == outer or x == inner, sequence))
max_length = 0
outer_indices = []
inner_indices = []
for i, item in enumerate(filtered):
if item == outer:
outer_indices.append(i)
if item == inner:
... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR VAR VAR VAR ASSIGN VAR NUMBER ASSIGN VAR LIST ASSIGN VAR LIST FOR VAR VAR FUNC_CALL VAR VAR IF VAR VAR EXPR FUNC_CALL VAR VAR IF VAR VAR EXPR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR VAR VAR BIN_OP BIN_OP... |
The only difference between easy and hard versions is constraints.
You are given a sequence $a$ consisting of $n$ positive integers.
Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are $a$ and $b$, $a$ can be equal $b$) and is as follows: $[\unde... | import sys
sys.setrecursionlimit(50000)
input = sys.stdin.readline
def input_list():
return map(int, input().split())
def r(n_i, n_j, i, j, m=[]):
n = n_i + n_j
if n_i == 0:
return n_j
elif n_j == 0:
return n_i
elif m[0] == m[n - 1] and m[0] == i:
return 2 + r(n_i - 2, n... | IMPORT EXPR FUNC_CALL VAR NUMBER ASSIGN VAR VAR FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF LIST ASSIGN VAR BIN_OP VAR VAR IF VAR NUMBER RETURN VAR IF VAR NUMBER RETURN VAR IF VAR NUMBER VAR BIN_OP VAR NUMBER VAR NUMBER VAR RETURN BIN_OP NUMBER FUNC_CALL VAR BIN_OP VAR NUMBER VAR VAR VAR VAR NUMB... |
The only difference between easy and hard versions is constraints.
You are given a sequence $a$ consisting of $n$ positive integers.
Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are $a$ and $b$, $a$ can be equal $b$) and is as follows: $[\unde... | from sys import stdin
t = int(stdin.readline())
for _ in range(t):
n = int(stdin.readline())
a = list(map(int, stdin.readline().split()))
d = [[(0) for _ in range(26)] for _ in range(n)]
for i in range(n):
x = a[i] - 1
if i != 0:
for j in range(26):
d[i][j] =... | 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 NUMBER VAR FUNC_CALL VAR NUMBER VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP VAR VAR NUMBER IF VAR NUMBER FOR VAR FUN... |
The only difference between easy and hard versions is constraints.
You are given a sequence $a$ consisting of $n$ positive integers.
Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are $a$ and $b$, $a$ can be equal $b$) and is as follows: $[\unde... | t = int(input())
a = list()
dp = list()
def getInd(j, i):
global n, a, dp
for k in range(n - 1, i, -1):
bias = 0
if a[k] == j + 1:
bias = 1
if dp[j][n - 1] - dp[j][k] + bias == dp[j][i]:
return k
return -1
def getMax(j, i, ind):
global dp
if ind - ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_DEF FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER VAR NUMBER ASSIGN VAR NUMBER IF VAR VAR BIN_OP VAR NUMBER ASSIGN VAR NUMBER IF BIN_OP BIN_OP VAR VAR BIN_OP VAR NUMBER VAR VAR VAR VAR VAR VAR VAR RETURN VAR RETURN NUMBER FUNC_DEF I... |
The only difference between easy and hard versions is constraints.
You are given a sequence $a$ consisting of $n$ positive integers.
Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are $a$ and $b$, $a$ can be equal $b$) and is as follows: $[\unde... | for _ in range(int(input())):
n = int(input())
a = list(map(int, input().split()))
d = {i: [] for i in range(1, 27)}
i = 0
for x in a:
d[x].append(i)
i += 1
ans = 1
for x in d:
b = d[x]
l = len(b)
for i in range(0, l // 2):
x, y = b[i] + 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 ASSIGN VAR VAR LIST VAR FUNC_CALL VAR NUMBER NUMBER ASSIGN VAR NUMBER FOR VAR VAR EXPR FUNC_CALL VAR VAR VAR VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR ASSIGN VAR VAR... |
The only difference between easy and hard versions is constraints.
You are given a sequence $a$ consisting of $n$ positive integers.
Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are $a$ and $b$, $a$ can be equal $b$) and is as follows: $[\unde... | import sys
try:
sys.stdin = open("input.txt", "r")
sys.stdout = open("output.txt", "w")
except:
pass
def max_freq(l, r):
d = {}
for i in range(l, r + 1):
if arr[i] in d:
d[arr[i]] += 1
else:
d[arr[i]] = 1
return max(d.values()) if len(d) > 0 else 0
de... | IMPORT ASSIGN VAR FUNC_CALL VAR STRING STRING ASSIGN VAR FUNC_CALL VAR STRING STRING FUNC_DEF ASSIGN VAR DICT FOR VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER IF VAR VAR VAR VAR VAR VAR NUMBER ASSIGN VAR VAR VAR NUMBER RETURN FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR FUNC_CALL VAR NUMBER FUNC_DEF ASSIGN VAR VAR ASSIGN VAR BIN_... |
The only difference between easy and hard versions is constraints.
You are given a sequence $a$ consisting of $n$ positive integers.
Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are $a$ and $b$, $a$ can be equal $b$) and is as follows: $[\unde... | t = int(input())
u = 0
while u < t:
n = int(input())
a = list(map(int, input().split()))
rama = [([0] * n) for i in range(27)]
sita = [[] for i in range(27)]
for i in range(n):
if i > 0:
s = a[i]
for j in range(27):
if j == s:
rama[... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER WHILE 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 BIN_OP LIST NUMBER VAR VAR FUNC_CALL VAR NUMBER ASSIGN VAR LIST VAR FUNC_CALL VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR NUMBER ASS... |
The only difference between easy and hard versions is constraints.
You are given a sequence $a$ consisting of $n$ positive integers.
Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are $a$ and $b$, $a$ can be equal $b$) and is as follows: $[\unde... | b = [[(0) for i in range(201)] for j in range(200005)]
for _ in range(int(input())):
n, a, maximum = int(input()), list(map(int, input().split())), 1
a = [0] + a
for x in range(1, n + 1):
for y in range(1, 201):
b[x][y] = b[x - 1][y]
b[x][a[x]] += 1
s = set(a)
for i in s:... | ASSIGN VAR NUMBER VAR FUNC_CALL VAR NUMBER VAR FUNC_CALL VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER VAR FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER FOR VAR FUN... |
The only difference between easy and hard versions is constraints.
You are given a sequence $a$ consisting of $n$ positive integers.
Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are $a$ and $b$, $a$ can be equal $b$) and is as follows: $[\unde... | def solve(arr, n, ans):
dp = [[(0) for i in range(27)] for j in range(n)]
for i in range(n):
dp[i][arr[i]] += 1
if i > 0:
for j in range(27):
dp[i][j] += dp[i - 1][j]
max_val = 0
for i in range(n):
left = dp[i][:]
for j in range(i + 1, n):
... | FUNC_DEF ASSIGN VAR NUMBER VAR FUNC_CALL VAR NUMBER VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR VAR VAR VAR VAR VAR NUMBER IF VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR VAR VAR VAR BIN_OP VAR NUMBER VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR VAR FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER VAR ASSIGN VA... |
The only difference between easy and hard versions is constraints.
You are given a sequence $a$ consisting of $n$ positive integers.
Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are $a$ and $b$, $a$ can be equal $b$) and is as follows: $[\unde... | import sys
Ri = lambda: [int(x) for x in sys.stdin.readline().split()]
ri = lambda: sys.stdin.readline().strip()
def list2d(a, b, c):
return [([c] * b) for i in range(a)]
for _ in range(int(ri())):
n = int(ri())
a = Ri()
count = list2d(27, len(a) + 1, 0)
for i in range(len(a)):
for j in... | IMPORT ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN BIN_OP LIST VAR VAR VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR NUMBER BIN_OP FUNC_CALL ... |
The only difference between easy and hard versions is constraints.
You are given a sequence $a$ consisting of $n$ positive integers.
Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are $a$ and $b$, $a$ can be equal $b$) and is as follows: $[\unde... | def r(a, b):
n = len(a)
s = len(a) // 2
j = s - 1
v = -1
while j >= 0:
x = a[j]
y = a[n - 1 - j]
c = b[y] - b[x + 1]
s = 2 * (j + 1) + c
if s > v:
v = s
j += -1
return v
t = int(input())
for i in range(t):
n = int(input())
b =... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP FUNC_CALL VAR VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR NUMBER WHILE VAR NUMBER ASSIGN VAR VAR VAR ASSIGN VAR VAR BIN_OP BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP VAR VAR VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP NUMBER BIN_OP VAR NUMBER VAR IF VAR VAR... |
The only difference between easy and hard versions is constraints.
You are given a sequence $a$ consisting of $n$ positive integers.
Let's define a three blocks palindrome as the sequence, consisting of at most two distinct elements (let these elements are $a$ and $b$, $a$ can be equal $b$) and is as follows: $[\unde... | for _ in range(int(input())):
n = int(input())
l = list(map(lambda x: int(x) - 1, input().split()))
pref = {i: [] for i in range(26)}
cnt = [(0) for i in range(26)]
counter = []
for i in range(n):
pref[l[i]].append(i)
cnt[l[i]] += 1
counter.append(cnt.copy())
ans = 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 BIN_OP FUNC_CALL VAR VAR NUMBER FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR LIST VAR FUNC_CALL VAR NUMBER ASSIGN VAR NUMBER VAR FUNC_CALL VAR NUMBER ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR F... |
There are $n$ segments on a $Ox$ axis $[l_1, r_1]$, $[l_2, r_2]$, ..., $[l_n, r_n]$. Segment $[l, r]$ covers all points from $l$ to $r$ inclusive, so all $x$ such that $l \le x \le r$.
Segments can be placed arbitrarily Β β be inside each other, coincide and so on. Segments can degenerate into points, that is $l_i=r_i$... | import sys
t = int(sys.stdin.readline())
for _ in range(t):
n = int(sys.stdin.readline())
intervals = [None] * n
for i in range(n):
intervals[i] = tuple([int(a) for a in sys.stdin.readline().split()])
intervals = list(zip(intervals, list(range(n))))
starts = sorted(intervals, key=lambda x: ... | IMPORT ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NONE VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR A... |
There are $n$ segments on a $Ox$ axis $[l_1, r_1]$, $[l_2, r_2]$, ..., $[l_n, r_n]$. Segment $[l, r]$ covers all points from $l$ to $r$ inclusive, so all $x$ such that $l \le x \le r$.
Segments can be placed arbitrarily Β β be inside each other, coincide and so on. Segments can degenerate into points, that is $l_i=r_i$... | from sys import stdin
input = stdin.readline
q = int(input())
for rwere in range(q):
n = int(input())
seg = []
pts = []
for i in range(n):
pocz, kon = map(int, input().split())
seg.append([2 * pocz, 2 * kon])
pts.append(2 * kon + 1)
p, k = map(list, zip(*seg))
pts += p +... | ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR 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 LIST BIN_OP NUMBER VAR BIN_OP NUMBER VAR EXPR FUNC_CALL VAR BIN_OP ... |
There are $n$ segments on a $Ox$ axis $[l_1, r_1]$, $[l_2, r_2]$, ..., $[l_n, r_n]$. Segment $[l, r]$ covers all points from $l$ to $r$ inclusive, so all $x$ such that $l \le x \le r$.
Segments can be placed arbitrarily Β β be inside each other, coincide and so on. Segments can degenerate into points, that is $l_i=r_i$... | import sys
reader = (line.rstrip() for line in sys.stdin)
input = reader.__next__
t = int(input())
for _ in range(t):
n = int(input())
edges = []
for i in range(n):
li, ri = list(map(int, input().split()))
edges.append((li, 0, i))
edges.append((ri, 1, i))
edges.sort()
ctr = ... | IMPORT ASSIGN VAR FUNC_CALL VAR VAR VAR ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL 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 FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR NUMBER VAR EXPR FUNC_CALL... |
There are $n$ segments on a $Ox$ axis $[l_1, r_1]$, $[l_2, r_2]$, ..., $[l_n, r_n]$. Segment $[l, r]$ covers all points from $l$ to $r$ inclusive, so all $x$ such that $l \le x \le r$.
Segments can be placed arbitrarily Β β be inside each other, coincide and so on. Segments can degenerate into points, that is $l_i=r_i$... | from sys import stdin
input = stdin.buffer.readline
t = int(input())
while t:
t -= 1
n = int(input())
seg = []
for i in range(n):
l, r = map(int, input().split())
seg.append((l, 0, i))
seg.append((r, 1, i))
seg.sort()
ans = 0
seq = []
active = set()
increase ... | ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR VAR NUMBER 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 NUMBER VAR EXPR FUNC_CALL VAR VAR NUMBER VAR EXPR FUNC_CALL VAR ASSIGN VAR NUMBER AS... |
There are $n$ segments on a $Ox$ axis $[l_1, r_1]$, $[l_2, r_2]$, ..., $[l_n, r_n]$. Segment $[l, r]$ covers all points from $l$ to $r$ inclusive, so all $x$ such that $l \le x \le r$.
Segments can be placed arbitrarily Β β be inside each other, coincide and so on. Segments can degenerate into points, that is $l_i=r_i$... | def solve(lsts):
points = []
for i in range(len(lsts)):
points.append((lst[i][0], 0, i))
points.append((lst[i][1], 1, i))
points.sort()
open = set()
increased = [0] * len(lsts)
original = 0
for i in range(len(points)):
p = points[i]
if p[1] == 0:
o... | FUNC_DEF ASSIGN VAR LIST FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR VAR NUMBER NUMBER VAR EXPR FUNC_CALL VAR VAR VAR NUMBER NUMBER VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER FUNC_CALL VAR VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR ASSIGN VAR VAR ... |
There are $n$ segments on a $Ox$ axis $[l_1, r_1]$, $[l_2, r_2]$, ..., $[l_n, r_n]$. Segment $[l, r]$ covers all points from $l$ to $r$ inclusive, so all $x$ such that $l \le x \le r$.
Segments can be placed arbitrarily Β β be inside each other, coincide and so on. Segments can degenerate into points, that is $l_i=r_i$... | debug = 0
t = int(input())
for _ in range(t):
n = int(input())
ev = []
for i in range(n):
a, b = map(int, input().split())
ev.append((a, -1, i))
ev.append((b, 1, i))
ev.sort()
a = set()
count = [0] * n
brks = 0
are_non_solo = 0
if debug:
print(ev)
... | ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL 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 FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR NUMBER VAR EXPR FUNC_CALL VAR VAR NUMBER VAR EXPR FUNC_CALL VAR ASSIGN VAR F... |
Ivan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, and a dessert.
There are $n_1$ different types of first courses Ivan can buy (the $i$-th of them costs $a_i$ coins), $n_2$ different types of second courses (the $i$-th of them costs $b_i$ coins), $n_3$ differen... | from sys import stdin, stdout
def cheap_dinner(n1, n2, n3, n4, a_a, b_a, c_a, d_a, dic_a, dic_b, dic_c):
INF = 10**10
d_a.sort(key=lambda x: x[1])
for ci in range(1, n3 + 1):
found = False
for d in d_a:
if ci not in dic_c or d[0] + 1 not in dic_c[ci]:
c_a[ci - 1... | FUNC_DEF ASSIGN VAR BIN_OP NUMBER NUMBER EXPR FUNC_CALL VAR VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR BIN_OP VAR NUMBER NUMBER VAR VAR VAR BIN_OP VAR NUMBER NUMBER VAR NUMBER ASSIGN VAR NUMBER IF VAR ASSIGN VAR BIN_OP VAR NUMBER NUMBER VAR EXPR FUNC_CALL VAR VAR ... |
Ivan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, and a dessert.
There are $n_1$ different types of first courses Ivan can buy (the $i$-th of them costs $a_i$ coins), $n_2$ different types of second courses (the $i$-th of them costs $b_i$ coins), $n_3$ differen... | import sys
input = sys.stdin.readline
input()
INF = 10**18
prev = list(map(int, input().split()))
As = [list(map(int, input().split())) for _ in range(3)]
for nex in As:
order = sorted(range(len(prev)), key=prev.__getitem__)
nadj = [set() for _ in range(len(nex))]
for _ in range(int(input())):
x, y... | IMPORT ASSIGN VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR BIN_OP NUMBER NUMBER 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 VAR FUNC_CALL VAR NUMBER FOR VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR ASSIGN VAR FUNC... |
Ivan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, and a dessert.
There are $n_1$ different types of first courses Ivan can buy (the $i$-th of them costs $a_i$ coins), $n_2$ different types of second courses (the $i$-th of them costs $b_i$ coins), $n_3$ differen... | import sys
input = lambda: sys.stdin.readline().strip()
n = list(map(int, input().split()))
a = []
for i in range(4):
a.append(list(map(int, input().split())))
def solve(l1, l2):
m = int(input())
not_together = [[i, set()] for i in range(n[l1])]
for i in range(m):
x, y = map(int, input().spli... | IMPORT ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST VAR FUNC_CALL VAR VAR FUNC_... |
Ivan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, and a dessert.
There are $n_1$ different types of first courses Ivan can buy (the $i$-th of them costs $a_i$ coins), $n_2$ different types of second courses (the $i$-th of them costs $b_i$ coins), $n_3$ differen... | import sys
input = sys.stdin.buffer.readline
INF = int(1000000000.0)
n = list(map(int, input().split()))
a = [list(map(int, input().split())) for i in range(4)]
dp = [[a[0][i], i] for i in range(n[0])]
dp.sort()
for i in range(3):
joint = [set() for j in range(n[i + 1])]
k = int(input())
for j in range(k):... | IMPORT ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR NUMBER 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 VAR FUNC_CALL VAR NUMBER ASSIGN VAR LIST VAR NUMBER VAR VAR VAR FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NU... |
Ivan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, and a dessert.
There are $n_1$ different types of first courses Ivan can buy (the $i$-th of them costs $a_i$ coins), $n_2$ different types of second courses (the $i$-th of them costs $b_i$ coins), $n_3$ differen... | from sys import stdin, stdout
n1, n2, n3, n4 = [int(x) for x in stdin.readline().split()]
a = [int(x) for x in stdin.readline().split()]
b = [int(x) for x in stdin.readline().split()]
c = [int(x) for x in stdin.readline().split()]
d = [int(x) for x in stdin.readline().split()]
a = [[i, a[i]] for i in range(n1)]
a.sort... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL 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 ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST VAR VAR... |
Ivan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, and a dessert.
There are $n_1$ different types of first courses Ivan can buy (the $i$-th of them costs $a_i$ coins), $n_2$ different types of second courses (the $i$-th of them costs $b_i$ coins), $n_3$ differen... | INF = 10**9
n1, n2, n3, n4 = map(int, input().split())
solution_a = [(int(x), i) for i, x in enumerate(input().split())]
(*b,) = map(int, input().split())
(*c,) = map(int, input().split())
(*d,) = map(int, input().split())
solution_a.sort()
b_a_denies = {}
for _ in " " * int(input()):
x, y = map(int, input().split(... | ASSIGN VAR BIN_OP NUMBER NUMBER ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR VAR VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL... |
Ivan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, and a dessert.
There are $n_1$ different types of first courses Ivan can buy (the $i$-th of them costs $a_i$ coins), $n_2$ different types of second courses (the $i$-th of them costs $b_i$ coins), $n_3$ differen... | import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")
n1, n2, n3, n4 = map(int, input().split())
a = []
[a.append([v, i]) for i, v in enumerate(map(int, input().split()))]
b = []
[b.append([v, i]) for i, v in enumerate(map(int, input().split()))]
c = []
[c.append([v, i]) for i, v in enumerate(map(int, input()... | IMPORT ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST EXPR FUNC_CALL VAR LIST VAR VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST EXPR FUNC_CALL VAR LIST VAR VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_C... |
Ivan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, and a dessert.
There are $n_1$ different types of first courses Ivan can buy (the $i$-th of them costs $a_i$ coins), $n_2$ different types of second courses (the $i$-th of them costs $b_i$ coins), $n_3$ differen... | import sys
def main():
n1, n2, n3, n4 = readIntArr()
a = readIntArr()
b = readIntArr()
c = readIntArr()
d = readIntArr()
adjBA = [set() for _ in range(n2)]
adjCB = [set() for _ in range(n3)]
adjDC = [set() for _ in range(n4)]
def fillADJ(adj):
m = int(input())
for ... | IMPORT FUNC_DEF ASSIGN VAR VAR VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL VAR VAR FUNC_DEF ASSIGN VAR FUNC_C... |
Ivan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, and a dessert.
There are $n_1$ different types of first courses Ivan can buy (the $i$-th of them costs $a_i$ coins), $n_2$ different types of second courses (the $i$-th of them costs $b_i$ coins), $n_3$ differen... | import sys
input = sys.stdin.buffer.readline
inf = 10**18
n1, n2, n3, n4 = map(int, input().split())
X = list(map(int, input().split()))
X = [(i, X[i]) for i in range(n1)]
X.sort(key=lambda x: x[1])
Y = list(map(int, input().split()))
Z = list(map(int, input().split()))
W = list(map(int, input().split()))
(m1,) = map(... | IMPORT ASSIGN VAR VAR ASSIGN VAR BIN_OP NUMBER NUMBER ASSIGN VAR VAR VAR 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 VAR VAR VAR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_C... |
Ivan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, and a dessert.
There are $n_1$ different types of first courses Ivan can buy (the $i$-th of them costs $a_i$ coins), $n_2$ different types of second courses (the $i$-th of them costs $b_i$ coins), $n_3$ differen... | import sys
input = sys.stdin.readline
n = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
D = list(map(int, input().split()))
m1 = int(input())
set_xy1 = set()
for _ in range(m1):
x, y = map(int, input().split())
set_xy... | IMPORT ASSIGN VAR 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 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 FUNC_... |
Ivan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, and a dessert.
There are $n_1$ different types of first courses Ivan can buy (the $i$-th of them costs $a_i$ coins), $n_2$ different types of second courses (the $i$-th of them costs $b_i$ coins), $n_3$ differen... | import sys
mod = 1000000007
eps = 10**-9
inf = 10**15
def main():
import sys
input = sys.stdin.buffer.readline
def F(L, R, bad):
NL = len(L)
NR = len(R)
ret = [inf] * NR
L_sorted = [(l, i) for i, l in enumerate(L)]
L_sorted.sort(key=lambda x: x[0])
for i,... | IMPORT ASSIGN VAR NUMBER ASSIGN VAR BIN_OP NUMBER NUMBER ASSIGN VAR BIN_OP NUMBER NUMBER FUNC_DEF IMPORT ASSIGN VAR VAR FUNC_DEF ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP LIST VAR VAR ASSIGN VAR VAR VAR VAR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR NUMBER FOR VAR VAR FUNC_CALL VAR V... |
Ivan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, and a dessert.
There are $n_1$ different types of first courses Ivan can buy (the $i$-th of them costs $a_i$ coins), $n_2$ different types of second courses (the $i$-th of them costs $b_i$ coins), $n_3$ differen... | from sys import stdin
n1, n2, n3, n4 = map(int, stdin.readline().split())
p1 = sorted(zip(map(int, stdin.readline().split()), range(1, n1 + 1)))
p2 = sorted(zip(map(int, stdin.readline().split()), range(1, n2 + 1)))
p3 = sorted(zip(map(int, stdin.readline().split()), range(1, n3 + 1)))
p4 = sorted(zip(map(int, stdin.r... | ASSIGN VAR VAR VAR 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 FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR FUNC... |
Ivan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, and a dessert.
There are $n_1$ different types of first courses Ivan can buy (the $i$-th of them costs $a_i$ coins), $n_2$ different types of second courses (the $i$-th of them costs $b_i$ coins), $n_3$ differen... | MAX_VAL = 2**31
def prepare_values(vals):
zipped_vals = list(zip(vals, range(1, len(vals) + 1)))
zipped_vals.sort()
pairs = [(old_i, i) for i, (val, old_i) in enumerate(zipped_vals, 1)]
return zipped_vals, dict(pairs)
def renumber_ids(dic, l):
return [dic[x] for x in l]
def get_first_absent(l)... | ASSIGN VAR BIN_OP NUMBER NUMBER FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL VAR NUMBER BIN_OP FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR NUMBER RETURN VAR FUNC_CALL VAR VAR FUNC_DEF RETURN VAR VAR VAR VAR FUNC_DEF EXPR FUNC_CALL VAR ASSIGN VAR NUMBER F... |
Ivan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, and a dessert.
There are $n_1$ different types of first courses Ivan can buy (the $i$-th of them costs $a_i$ coins), $n_2$ different types of second courses (the $i$-th of them costs $b_i$ coins), $n_3$ differen... | import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")
inp = lambda: list(map(int, sys.stdin.readline().rstrip("\r\n").split()))
mod = 10**9 + 7
Mod = 998244353
INF = float("inf")
tc = 1
def solve(a, b, c):
ans = [INF for i in range(len(a))]
g = [set() for i in range(len(a))]
for i, j in c:
... | IMPORT ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR BIN_OP BIN_OP NUMBER NUMBER NUMBER ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR NUMBER FUNC_DEF ASSIGN VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR ASSIGN VAR FU... |
Ivan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, and a dessert.
There are $n_1$ different types of first courses Ivan can buy (the $i$-th of them costs $a_i$ coins), $n_2$ different types of second courses (the $i$-th of them costs $b_i$ coins), $n_3$ differen... | import sys
input = sys.stdin.readline
INF = 10**12
def update(al0, al1, gl01):
ail0 = [(al0[i], i) for i in range(len(al0))]
ail0.sort(key=lambda x: x[0])
res = [INF] * len(al1)
rems = list(range(len(al1)))
for a, i in ail0:
new_rems = []
for i1 in rems:
if i1 in gl01[... | IMPORT ASSIGN VAR VAR ASSIGN VAR BIN_OP NUMBER NUMBER FUNC_DEF ASSIGN VAR VAR VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR NUMBER ASSIGN VAR BIN_OP LIST VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FOR VAR VAR VAR ASSIGN VAR LIST FOR VAR VAR IF VAR VAR VAR EXPR FU... |
Ivan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, and a dessert.
There are $n_1$ different types of first courses Ivan can buy (the $i$-th of them costs $a_i$ coins), $n_2$ different types of second courses (the $i$-th of them costs $b_i$ coins), $n_3$ differen... | import sys
input = sys.stdin.readline
def encode(x, y):
return (x - 1 << 18) + y
n1, n2, n3, n4 = map(int, input().split())
a = [(int(item), i) for i, item in enumerate(input().split())]
b = [(int(item), i) for i, item in enumerate(input().split())]
c = [(int(item), i) for i, item in enumerate(input().split())... | IMPORT ASSIGN VAR VAR FUNC_DEF RETURN BIN_OP BIN_OP BIN_OP VAR NUMBER NUMBER VAR ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR VAR VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR VAR VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_... |
Ivan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, and a dessert.
There are $n_1$ different types of first courses Ivan can buy (the $i$-th of them costs $a_i$ coins), $n_2$ different types of second courses (the $i$-th of them costs $b_i$ coins), $n_3$ differen... | import sys
input = sys.stdin.readline
def read_int():
return int(input())
def read_ints():
return map(int, input().split(" "))
INF = int(1000000000.0)
n = list(read_ints())
a = [[] for _ in range(4)]
a[0] = list(read_ints())
a[1] = list(read_ints())
a[2] = list(read_ints())
a[3] = list(read_ints())
dp = ... | IMPORT ASSIGN VAR VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST VAR FUNC_CALL VAR NUMBER ASSIGN VAR NUMBER FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER FUNC_CALL VAR... |
Ivan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, and a dessert.
There are $n_1$ different types of first courses Ivan can buy (the $i$-th of them costs $a_i$ coins), $n_2$ different types of second courses (the $i$-th of them costs $b_i$ coins), $n_3$ differen... | import sys
input = lambda: sys.stdin.readline().rstrip()
def ttt():
a, b = map(int, input().split())
return (a - 1 << 18) + b - 1
n1, n2, n3, n4 = map(int, input().split())
A = [(i, int(a)) for i, a in enumerate(input().split())]
B = [(i, int(a)) for i, a in enumerate(input().split())]
C = [(i, int(a)) for... | IMPORT ASSIGN VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR RETURN BIN_OP BIN_OP BIN_OP BIN_OP VAR NUMBER NUMBER VAR NUMBER ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR ASSI... |
Ivan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, and a dessert.
There are $n_1$ different types of first courses Ivan can buy (the $i$-th of them costs $a_i$ coins), $n_2$ different types of second courses (the $i$-th of them costs $b_i$ coins), $n_3$ differen... | import sys
input = sys.stdin.buffer.readline
def init(N, node, A, unit, func):
n = 1
while n < N:
n <<= 1
for i in range(n * 2 - 1):
if len(node) <= i:
node.append(unit)
else:
node[i] = unit
for i in range(len(A)):
node[n - 1 + i] = A[i]
for... | IMPORT ASSIGN VAR VAR FUNC_DEF ASSIGN VAR NUMBER WHILE VAR VAR VAR NUMBER FOR VAR FUNC_CALL VAR BIN_OP BIN_OP VAR NUMBER NUMBER IF FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR VAR VAR FOR VAR FUNC_CALL VAR BIN_OP VAR NUMB... |
Ivan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, and a dessert.
There are $n_1$ different types of first courses Ivan can buy (the $i$-th of them costs $a_i$ coins), $n_2$ different types of second courses (the $i$-th of them costs $b_i$ coins), $n_3$ differen... | import sys
from sys import stdin
n = list(map(int, stdin.readline().split()))
a = [list(map(int, stdin.readline().split())) for i in range(4)]
v = [set([]) for i in range(3)]
for i in range(3):
m = int(stdin.readline())
for j in range(m):
x, y = map(int, stdin.readline().split())
x -= 1
... | IMPORT 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 VAR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR LIST VAR FUNC_CALL VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIG... |
Ivan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, and a dessert.
There are $n_1$ different types of first courses Ivan can buy (the $i$-th of them costs $a_i$ coins), $n_2$ different types of second courses (the $i$-th of them costs $b_i$ coins), $n_3$ differen... | import sys
input = sys.stdin.readline
def main():
n = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
d = list(map(int, input().split()))
prices = [a, b, c, d]
inc = [{} for _ in range(3)]
for ... | IMPORT ASSIGN VAR VAR FUNC_DEF 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 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 ... |
Ivan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, and a dessert.
There are $n_1$ different types of first courses Ivan can buy (the $i$-th of them costs $a_i$ coins), $n_2$ different types of second courses (the $i$-th of them costs $b_i$ coins), $n_3$ differen... | MAX_MIN_VAL = 10**9
def getSortedIndices(A, n):
P = []
for i in range(n):
P.append([A[i], i])
P = sorted(P)
return [i for a, i in P]
def getPositiveStartIndex(A, AIS, n):
l = 0
r = n - 1
while l < r:
m = (l + r) // 2
if A[AIS[m]] < 0:
l = m + 1
... | ASSIGN VAR BIN_OP NUMBER NUMBER FUNC_DEF ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR LIST VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR RETURN VAR VAR VAR VAR FUNC_DEF ASSIGN VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER WHILE VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER IF VAR VAR VAR NUMBER ASSIGN VAR BIN_OP... |
Ivan wants to have a good dinner. A good dinner should consist of a first course, a second course, a drink, and a dessert.
There are $n_1$ different types of first courses Ivan can buy (the $i$-th of them costs $a_i$ coins), $n_2$ different types of second courses (the $i$-th of them costs $b_i$ coins), $n_3$ differen... | import sys
input = sys.stdin.readline
INF = int(1000000000.0)
n1, n2, n3, n4 = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
d = list(map(int, input().split()))
postx = [[] for _ in range(n2)]
for _ in range(int(input())):
x, y... | IMPORT ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR NUMBER ASSIGN VAR VAR VAR 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 FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ... |
You are given an array $a$ of $n$ non-negative integers. In one operation you can change any number in the array to any other non-negative integer.
Let's define the cost of the array as $\operatorname{DIFF}(a) - \operatorname{MEX}(a)$, where $\operatorname{MEX}$ of a set of non-negative integers is the smallest non-ne... | I = input
R = lambda: map(int, I().split())
for _ in range(int(I())):
n, k = R()
a = [*R()]
c = {}
mx = 0
for v in a:
c[v] = c.get(v, 0) + 1
while mx in c:
mx += 1
for _ in range(k):
mx += 1
while mx in c:
mx += 1
b = sorted([v for v in set(a) ... | ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR ASSIGN VAR LIST FUNC_CALL VAR ASSIGN VAR DICT ASSIGN VAR NUMBER FOR VAR VAR ASSIGN VAR VAR BIN_OP FUNC_CALL VAR VAR NUMBER NUMBER WHILE VAR VAR VAR NUMBER FOR VAR FUNC_CALL ... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | from sys import stdin
def binary_search(arr, n, k):
l, r = 0, n - 1
while l <= r:
mid = l + r >> 1
if arr[mid] <= k:
l = mid + 1
else:
r = mid - 1
return l
def main():
n = int(stdin.readline())
arr1 = list(map(int, stdin.readline().split()))
m ... | FUNC_DEF ASSIGN VAR VAR NUMBER BIN_OP VAR NUMBER WHILE VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER IF VAR VAR VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER RETURN VAR FUNC_DEF 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_CA... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | def main():
n = int(input())
t1 = [int(_) for _ in input().split()]
t1 = sorted(t1)
m = int(input())
t2 = [int(_) for _ in input().split()]
t2 = sorted(t2)
a = x = 3 * n
b = y = 3 * m
advantage = a - b
i = 0
j = 0
while i < n or j < m:
if i < n and j < m:
... | 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 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 ASSIGN VAR VAR BIN_OP NUMBER VAR ASSIGN VAR VAR BIN_OP NUMBER... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | input = __import__("sys").stdin.readline
n = int(input())
a = list(map(int, input().split()))
m = int(input())
b = list(map(int, input().split()))
lis = [[i, 0] for i in a] + [[i, 1] for i in b]
lis.sort()
zer = one = aa = bb = 0
ans = -10000000000000000000
for i in range(len(lis)):
if lis[i][1] == 0:
zer +... | ASSIGN VAR FUNC_CALL VAR STRING 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 ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP LIST VAR NUMBER VAR VAR LIST VAR NUMBER VAR VAR EXPR FUNC_... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
m = int(input())
b = list(map(int, input().split()))
a.sort()
b.sort()
j, k = 0, 0
c = []
while j <= n and k <= m:
if j == n and k == m:
break
elif j == n:
c.append([b[k], 1])
k += 1
elif k ==... | IMPORT ASSIGN 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 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 NUMBER NUMBER ASSIGN VAR LIST WHI... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | n1 = int(input())
d1 = list(map(lambda x: int(x), input().split(" ")))
n2 = int(input())
d2 = list(map(lambda x: int(x), input().split(" ")))
dl = list(set([0] + d1 + d2))
dl.sort()
dd = dict()
for i in range(0, len(dl)):
dd[dl[i]] = i
c1 = [(0) for i in range(0, len(dl))]
c2 = [(0) for i in range(0, len(dl))]
s1 =... | 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 STRING 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 STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP LIST NUMBER V... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | n = int(input())
a = sorted([int(i) for i in input().split()])
m = int(input())
b = sorted([int(i) for i in input().split()])
ma = a1 = 3 * n
mb = b1 = 3 * m
rast = a1 - b1
i, j = 0, 0
while i < n and j < m:
z = min(a[i], b[j])
while i < n and a[i] <= z:
i += 1
ma -= 1
while j < m and b[j] <... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR BIN_OP NUMBER VAR ASSIGN VAR VAR BIN_OP NUMBER VAR ASSIGN VAR BIN_OP VAR VAR ASSIGN V... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | n = int(input())
line = input().split()
a = []
for d in line:
a.append(int(d))
a.sort()
m = int(input())
line = input().split()
b = []
for d in line:
b.append(int(d))
b.sort()
arr = [[0, 0, 0]]
i = 0
j = 0
k = 1
while i < n and j < m:
if a[i] <= b[j]:
if k > 0 and arr[k - 1][0] == a[i]:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR ASSI... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | def solve(a, b):
n = len(a)
m = len(b)
a = sorted(a)
b = sorted(b)
r1 = n * 3
r2 = m * 3
max1 = r1
max2 = r2
p1 = 0
p2 = 0
while p1 < n or p2 < m:
v = 0
if p2 == m:
v = a[p1]
elif p1 == n:
v = b[p2]
else:
v =... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR VAR ASSIGN VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER WHILE VAR VAR VAR VAR ASSIGN VAR NUMBER IF VAR VAR ASSIGN VAR VAR VAR I... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | def lowerBound(A, d):
ans = -1
low, high = 0, len(A) - 1
while low <= high:
mid = (low + high) // 2
if A[mid] <= d:
ans = mid
low = mid + 1
else:
high = mid - 1
return ans + 1
n = int(input())
A = list(map(int, input().split()))
m = int(input... | FUNC_DEF ASSIGN VAR NUMBER ASSIGN VAR VAR NUMBER BIN_OP FUNC_CALL VAR VAR NUMBER WHILE VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER IF VAR VAR VAR ASSIGN VAR VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER RETURN BIN_OP VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CAL... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | def lte(n, a, d):
if a[0] > d:
return 0
if a[-1] <= d:
return n
else:
lo = 0
hi = n - 1
while lo + 1 < hi:
mid = (lo + hi) // 2
if a[mid] <= d:
lo = mid
else:
hi = mid
return lo + 1
def scor... | FUNC_DEF IF VAR NUMBER VAR RETURN NUMBER IF VAR NUMBER VAR RETURN VAR ASSIGN VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER WHILE BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER IF VAR VAR VAR ASSIGN VAR VAR ASSIGN VAR VAR RETURN BIN_OP VAR NUMBER FUNC_DEF ASSIGN VAR FUNC_CALL VAR VAR VAR VAR ASSIGN VAR FUNC_CAL... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | n = int(input())
lia = list(map(int, input().split(" ", n)[:n]))
m = int(input())
lib = list(map(int, input().split(" ", m)[:m]))
a = [[ai, 0] for ai in lia] + [[bi, 1] for bi in lib]
a.sort()
x, y = 3 * n, 3 * m
X, Y = 3 * n, 3 * m
for i in range(n + m):
if a[i][1] == 0:
X -= 1
else:
Y -= 1
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING VAR VAR ASSIGN VAR BIN_OP LIST VAR NUMBER VAR VAR LIST VAR NUMBER VAR VAR EXPR FUNC_CA... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | from sys import maxsize, stdin, stdout
n = int(input())
team1 = list(map(int, input().split()))
m = int(input())
team2 = list(map(int, input().split()))
ls = []
for i in range(n):
ls.append([team1[i], 1])
for i in range(m):
ls.append([team2[i], 2])
ls.sort()
score1 = 3 * n
score2 = 3 * m
ans = [score1, score2]... | 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 ASSIGN VAR 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 LIST VAR VAR NUMBER FOR VAR FUNC_CALL VAR VAR E... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | read = lambda: map(int, input().split())
n = int(input())
a = sorted(read())[::-1]
m = int(input())
b = sorted(read())[::-1]
x, y = 2 * n, 2 * m
j = 0
for i in range(n):
while j < m and b[j] >= a[i]:
j += 1
x1 = i + 1 + 2 * n
y1 = j + 2 * m
if x1 - y1 > x - y or x1 - y1 == x - y and x1 > x:
... | ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR NUMBER ASSIGN VAR VAR BIN_OP NUMBER VAR BIN_OP NUMBER VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR WH... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | def read_pack():
c = int(input())
x = list(map(int, str.split(input())))
x.sort()
return c, x + [0]
n, a = read_pack()
m, b = read_pack()
i = j = 0
pa = pb = None
while i <= n and j <= m:
ca = (n - i) * 3 + i * 2
cb = (m - j) * 3 + j * 2
if pa is None or ca - cb > pa - pb or ca - cb == pa ... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR RETURN VAR BIN_OP VAR LIST NUMBER ASSIGN VAR VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NONE WHILE VAR VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP B... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | import sys
input = sys.stdin.buffer.readline
def I():
return list(map(int, input().split()))
def sieve(n):
a = [1] * n
for i in range(2, n):
if a[i]:
for j in range(i * i, n, i):
a[j] = 0
return a
n = int(input())
a = sorted(I())
m = int(input())
b = sorted(I()... | IMPORT ASSIGN VAR VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF ASSIGN VAR BIN_OP LIST NUMBER VAR FOR VAR FUNC_CALL VAR NUMBER VAR IF VAR VAR FOR VAR FUNC_CALL VAR BIN_OP VAR VAR VAR VAR ASSIGN VAR VAR NUMBER RETURN VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL V... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | from sys import stdin, stdout
def solution():
n = int(stdin.readline().rstrip())
a = list(map(lambda x: (int(x), 1), stdin.readline().rstrip().split()))
m = int(stdin.readline().rstrip())
b = list(map(lambda x: (int(x), 2), stdin.readline().rstrip().split()))
c = a + b
c.sort(key=lambda tup: t... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR NUMBER FUNC_CALL 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 NUMBER FUNC_CALL FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | f, s = [], []
n = int(input())
f.extend(map(int, input().split()))
m = int(input())
s.extend(map(int, input().split()))
f.append(1 << 64)
s.append(1 << 64)
f = sorted(f)
s = sorted(s)
mxA = scoreA = 3 * n
mxB = scoreB = 3 * m
mxDif = scoreA - scoreB
i, j = 0, 0
while i < n or j < m:
if f[i] < s[j]:
scoreA -... | ASSIGN VAR VAR LIST LIST ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP NUMBER NUMBER EXPR FUNC_CALL VAR BIN_OP NUMBER NUMBER ASSIGN VAR FUNC... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | n = int(input())
a = list(map(int, input().split()))
m = int(input())
b = list(map(int, input().split()))
c = sorted([[a[i], 1] for i in range(n)] + [[b[i], 2] for i in range(m)])
x = x0 = 2 * n
y = y0 = 2 * m
for i in range(n + m - 1, -1, -1):
if c[i][1] == 1:
x += 1
else:
y += 1
if x - y >... | 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 ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR BIN_OP LIST VAR VAR NUMBER VAR FUNC_CALL VAR VAR LIST VAR VAR NUMBER VAR FUNC_CALL ... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | def main():
(n,) = read()
a = read()
res = [(i, 0) for i in a]
(m,) = read()
b = read()
res.extend((i, 1) for i in b)
res.sort()
mxa = 3 * n
mnb = 3 * m
cra = 3 * n
crb = 3 * m
for _, i in res:
if i:
crb -= 1
if cra - crb > mxa - mnb:
... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR VAR NUMBER VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR EXPR FUNC_CALL VAR VAR NUMBER VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR BIN_OP NUMBER VAR ASSIGN VAR BIN_OP NUMBER VAR ASSIGN VAR BIN_OP NUMBER VAR ASSIGN VAR BIN_OP NUMBER VAR FOR VAR ... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | n = int(input())
a = [int(s) for s in input().split()]
m = int(input())
b = [int(s) for s in input().split()]
INF = 3000000000
a.sort()
b.sort()
a.append(INF)
b.append(INF)
i = 0
j = 0
bestd = 0
bestadv = (n - m) * 3
besta = 3 * n
bestb = 3 * m
cura = 3 * n
curb = 3 * m
while i < n or j < m:
d = min(a[i], b[j])
... | 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 FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN V... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | n = int(input())
a = list(map(int, input().split()))
m = int(input())
b = list(map(int, input().split()))
a.sort()
b.sort()
x, y = 0, -1
u, v = n * 3, m * 3
q = [u, v]
while 1:
if y != m - 1:
y += 1
v -= 1
while x < n and a[x] <= b[y]:
x += 1
u -= 1
if u - v > q[0] - q[1]:
... | 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 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 NUMBER NUMBER ASSIGN VAR VAR BIN_OP VAR NUMBER BIN_OP V... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | n, a = int(input()), list(map(int, input().split()))
m, b = int(input()), list(map(int, input().split()))
p = [(i, 0) for i in a] + [(i, 1) for i in b]
p.sort()
i = 0
score = [n * 3, m * 3]
score_temp = list(score)
while i < m + n:
d = p[i][0]
while i < m + n and p[i][0] == d:
score_temp[p[i][1]] -= 1
... | ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP VAR NUMBER VAR VAR VAR NUMBER VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR LIST BIN_OP VAR NU... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | n = int(input())
lis = [[int(i), "a"] for i in input().split()]
m = int(input())
lis = lis + [[int(i), "b"] for i in input().split()] + [[0, "a"]] + [[0, "b"]]
lis.sort()
a = b = 0
ans = -1000000
fin = finb = 0
for i in range(len(lis) - 1):
if lis[i][1] == "a":
a += 1
else:
b += 1
if lis[i][... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FUNC_CALL VAR VAR STRING VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR LIST FUNC_CALL VAR VAR STRING VAR FUNC_CALL FUNC_CALL VAR LIST LIST NUMBER STRING LIST LIST NUMBER STRING EXPR FUNC_CALL VAR ASSIGN VAR V... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | n = int(input())
score = list(map(lambda x: [int(x), 0], input().split()))
m = int(input())
score += list(map(lambda x: [int(x), 1], input().split()))
score.sort()
f = []
if score[0][1] == 0:
f.append([1, 0])
else:
f.append([0, 1])
for i in range(1, n + m):
if score[i][1] == 0:
f.append([f[i - 1][0]... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR LIST FUNC_CALL VAR VAR NUMBER FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL VAR FUNC_CALL VAR LIST FUNC_CALL VAR VAR NUMBER FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR LIST IF VAR NUMBER NUMBER NUMBER ... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | n = int(input())
a = list(map(int, input().split()))
m = int(input())
b = list(map(int, input().split()))
a.sort()
b.sort()
diff = 2 * n - 2 * m
j = 0
ans = [(2 * n, 2 * m)]
for i in range(n):
while j < m:
if b[j] <= a[i] - 1:
j += 1
else:
break
ap = 2 * i + 3 * (n - i)
... | 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 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 NUMBER VAR BIN_OP NUMBER VAR ASSIGN VAR NUMBE... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | I = lambda: list(map(int, input().split()))
n = I()[0]
d1 = [0] + sorted(I())
m = I()[0]
d2 = [0] + sorted(I())
index1, index2 = {}, {}
index1[0], index2[0] = n, m
i, j = n, m
while i >= 0 and j >= 0:
maxd = max(d1[i], d2[j])
if not maxd in index1:
index1[maxd] = n - i
if not maxd in index2:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR DICT DICT ASSIGN VAR NUMBER VAR NUMBER VAR VAR ASSIGN VAR ... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | __author__ = "zhan"
first = []
second = []
n = int(input())
line = input().split()
for i in range(n):
first.append(int(line[i]))
first.sort()
m = int(input())
line = input().split()
for i in range(m):
second.append(int(line[i]))
second.sort()
a = 3 * n
b = 3 * m
d = a - b
penalty = [0, 0]
i = 0
j = 0
while i < ... | ASSIGN VAR STRING ASSIGN VAR LIST ASSIGN VAR LIST ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR EXPR FUNC_... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | n, a = int(input()), list(map(int, input().split()))
m, b = int(input()), list(map(int, input().split()))
a.sort()
b.sort()
A, B = len(a) * 3, len(b) * 3
i = j = 0
tA, tB = A, B
while i < len(a) and j < len(b):
d = min(a[i], b[j])
while i < len(a) and a[i] == d:
i += 1
tA -= 1
while j < len(... | ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL 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 BIN_OP FUNC_CALL VAR VAR NUMBER ASSIG... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | n, ans, x1, x2 = int(input()), 0, 0, 0
num1 = list(sorted(map(int, input().split())))
m, p2 = int(input()), 0
num2 = list(sorted(map(int, input().split())))
ans, x1, x2 = (n - m) * 2, n * 2, m * 2
for i in range(n):
while p2 < m and num2[p2] < num1[i]:
p2 += 1
y1, y2 = i * 2 + (n - i) * 3, p2 * 2 + (m -... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR NUMBER NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR VAR BIN_OP BIN_OP VAR... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | R = lambda: map(int, input().split())
n = int(input())
a = sorted(R()) + [int(2 * 10**9) + 1]
m = int(input())
b = sorted(R()) + [int(2 * 10**9) + 1]
i, j = 0, 0
ra, rb = n * 3, m * 3
if n * 2 - m * 2 > n * 3 - m * 3:
ra, rb = n * 2, m * 2
while i < n or j < m:
sa, sb = 0, 0
if i <= n and j <= m and a[i] < ... | ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP FUNC_CALL VAR FUNC_CALL VAR LIST BIN_OP FUNC_CALL VAR BIN_OP NUMBER BIN_OP NUMBER NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP FUNC_CALL VAR FUNC_CALL VAR LIST BIN_OP FUNC_CALL VAR BIN... |
Vasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 points if the distance it was made from doesn't exceed some value of d meters, and a throw is worth 3 points if the distance is larger tha... | def merge(l1, l2):
p1 = 0
p2 = 0
l = []
while p1 < len(l1) and p2 < len(l2):
if l1[p1] < l2[p2]:
l.append(l1[p1])
p1 += 1
else:
l.append(l2[p2])
p2 += 1
if p1 < len(l1):
l.extend(l1[p1 : len(l1)])
if p2 < len(l2):
l.... | FUNC_DEF ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR LIST WHILE VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR VAR IF VAR VAR VAR VAR EXPR FUNC_CALL VAR VAR VAR VAR NUMBER EXPR FUNC_CALL VAR VAR VAR VAR NUMBER IF VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR VAR FUNC_CALL VAR VAR IF VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR ... |
There are many freight trains departing from Kirnes planet every day. One day on that planet consists of $h$ hours, and each hour consists of $m$ minutes, where $m$ is an even number. Currently, there are $n$ freight trains, and they depart every day at the same time: $i$-th train departs at $h_i$ hours and $m_i$ minut... | import sys
sys.setrecursionlimit(10**5)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II():
return int(sys.stdin.readline())
def MI():
return map(int, sys.stdin.readline().split())
def LI():
return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number):
return [... | IMPORT EXPR FUNC_CALL VAR BIN_OP NUMBER NUMBER ASSIGN VAR BIN_OP FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR STRING FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN FUNC... |
There are many freight trains departing from Kirnes planet every day. One day on that planet consists of $h$ hours, and each hour consists of $m$ minutes, where $m$ is an even number. Currently, there are $n$ freight trains, and they depart every day at the same time: $i$-th train departs at $h_i$ hours and $m_i$ minut... | n, H, M, k = map(int, input().split())
hm = []
for i in range(n):
hm.append(list(map(int, input().split())))
M2 = M // 2
ll = []
rr = []
st = {0, M2}
for h, m in hm:
s = (m + 1) % M2
ll.append(s)
rr.append(s + k - 1)
st.add(s)
st.add(s + M2)
st.add((s + k - 1) % M2)
st.add((s + k - 1) % ... | ASSIGN VAR VAR VAR 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 FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR LIST ASSIGN VAR LIST ASSIGN VAR NUMBER VAR FOR VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR... |
There are many freight trains departing from Kirnes planet every day. One day on that planet consists of $h$ hours, and each hour consists of $m$ minutes, where $m$ is an even number. Currently, there are $n$ freight trains, and they depart every day at the same time: $i$-th train departs at $h_i$ hours and $m_i$ minut... | import sys
input = sys.stdin.readline
n, h, m, k = map(int, input().split())
tram = []
dic = {}
for i in range(n):
H, M = map(int, input().split())
r = M % (m // 2)
tram.append(r)
if r not in dic:
dic[r] = 0
dic[r] += 1
S = [i for i in dic]
for i in S:
dic[i + m // 2] = 0
dic[i + m ... | IMPORT ASSIGN VAR VAR ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR DICT FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR VAR IF VAR VAR ASSIGN VAR VAR NUMBER VAR VAR NUMBER ASSIGN ... |
There are many freight trains departing from Kirnes planet every day. One day on that planet consists of $h$ hours, and each hour consists of $m$ minutes, where $m$ is an even number. Currently, there are $n$ freight trains, and they depart every day at the same time: $i$-th train departs at $h_i$ hours and $m_i$ minut... | import sys
from sys import stdin
n, h, m, k = map(int, stdin.readline().split())
now = 0
ends = []
starts = []
ppp = [0] * n
for i in range(n):
hi, mi = map(int, stdin.readline().split())
if mi >= m // 2:
pz = mi - m
else:
pz = mi
if 0 <= pz < m // 2:
starts.append((pz, i))
... | IMPORT ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR LIST ASSIGN VAR LIST ASSIGN VAR BIN_OP LIST NUMBER VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR VAR ASSIGN VAR VAR IF NUMBER VAR B... |
You are given an array of positive integers $a = [a_0, a_1, \dots, a_{n - 1}]$ ($n \ge 2$).
In one step, the array $a$ is replaced with another array of length $n$, in which each element is the greatest common divisor (GCD) of two neighboring elements (the element itself and its right neighbor; consider that the right... | from sys import stdin, stdout
def gcd(a, b):
if b == 0:
return a
return gcd(b, a % b)
def build(n, sega):
for i in range(n - 1, -1, -1):
sega[i] = gcd(sega[i * 2], sega[i * 2 + 1])
def query(n, sega, l, r):
l += n
r += n
res = -1
while l < r:
if l & 1 == 1:
... | FUNC_DEF IF VAR NUMBER RETURN VAR RETURN FUNC_CALL VAR VAR BIN_OP VAR VAR FUNC_DEF FOR VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER NUMBER ASSIGN VAR VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER VAR BIN_OP BIN_OP VAR NUMBER NUMBER FUNC_DEF VAR VAR VAR VAR ASSIGN VAR NUMBER WHILE VAR VAR IF BIN_OP VAR NUMBER NUMBER IF VAR NUMB... |
You are given an array of positive integers $a = [a_0, a_1, \dots, a_{n - 1}]$ ($n \ge 2$).
In one step, the array $a$ is replaced with another array of length $n$, in which each element is the greatest common divisor (GCD) of two neighboring elements (the element itself and its right neighbor; consider that the right... | def gcd(a, b):
if b == 0:
return a
return gcd(b, a % b)
ans = []
for _ in range(int(input())):
n = int(input())
u = list(map(int, input().split()))
u += u[:]
m = 0
for i in range(n):
k1 = u[i]
k2 = u[i + 1]
c = 0
j = i + 1
while k1 != k2:
... | FUNC_DEF IF VAR NUMBER RETURN VAR RETURN FUNC_CALL VAR VAR BIN_OP VAR VAR ASSIGN VAR LIST 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 VAR VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR VAR ASS... |
You are given an array of positive integers $a = [a_0, a_1, \dots, a_{n - 1}]$ ($n \ge 2$).
In one step, the array $a$ is replaced with another array of length $n$, in which each element is the greatest common divisor (GCD) of two neighboring elements (the element itself and its right neighbor; consider that the right... | def read_ints():
return list(map(int, input().split()))
def gcd(x, y):
if x == 0 or y == 0:
return x + y
if x > y:
return gcd(x % y, y)
else:
return gcd(x, y % x)
def remove_gcd(a):
g = gcd(a[0], a[1])
for i in range(2, len(a)):
g = gcd(g, a[i])
return [(x... | FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF IF VAR NUMBER VAR NUMBER RETURN BIN_OP VAR VAR IF VAR VAR RETURN FUNC_CALL VAR BIN_OP VAR VAR VAR RETURN FUNC_CALL VAR VAR BIN_OP VAR VAR FUNC_DEF ASSIGN VAR FUNC_CALL VAR VAR NUMBER VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER FUNC_CALL VAR VA... |
Simon has an array a_1, a_2, ..., a_{n}, consisting of n positive integers. Today Simon asked you to find a pair of integers l, r (1 β€ l β€ r β€ n), such that the following conditions hold: there is integer j (l β€ j β€ r), such that all integers a_{l}, a_{l} + 1, ..., a_{r} are divisible by a_{j}; value r - l takes the ... | n = int(input()) + 1
t = [1] + list(map(int, input().split())) + [1]
p = [True] * n
s, q = 0, list(range(1, n))
for i in range(1, n):
if p[i]:
a = b = i
d = t[i]
if d == 1:
s, q = n - 2, [1]
break
while t[a - 1] % d == 0:
a -= 1
while t[b +... | ASSIGN VAR BIN_OP FUNC_CALL VAR FUNC_CALL VAR NUMBER ASSIGN VAR BIN_OP BIN_OP LIST NUMBER FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR LIST NUMBER ASSIGN VAR BIN_OP LIST NUMBER VAR ASSIGN VAR VAR NUMBER FUNC_CALL VAR FUNC_CALL VAR NUMBER VAR FOR VAR FUNC_CALL VAR NUMBER VAR IF VAR VAR ASSIGN VAR VAR VAR ASSI... |
Vladimir wants to modernize partitions in his office. To make the office more comfortable he decided to remove a partition and plant several bamboos in a row. He thinks it would be nice if there are n bamboos in a row, and the i-th from the left is a_{i} meters high.
Vladimir has just planted n bamboos in a row, each... | import itertools
import time
unfold = itertools.chain.from_iterable
t = time.time() + 1900
def jumps(a):
d = speedup
if time.time() > t:
print(anss)
return
try:
while True:
c = (a + d - 1) // d
d = (a + c - 2) // (c - 1)
yield d
except:
... | IMPORT IMPORT ASSIGN VAR VAR ASSIGN VAR BIN_OP FUNC_CALL VAR NUMBER FUNC_DEF ASSIGN VAR VAR IF FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR RETURN WHILE NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR VAR NUMBER BIN_OP VAR NUMBER EXPR VAR RETURN FUNC_DEF RETURN BIN_OP BIN_OP BI... |
Vladimir wants to modernize partitions in his office. To make the office more comfortable he decided to remove a partition and plant several bamboos in a row. He thinks it would be nice if there are n bamboos in a row, and the i-th from the left is a_{i} meters high.
Vladimir has just planted n bamboos in a row, each... | import itertools
unfold = itertools.chain.from_iterable
speedup = 400000
def jumps(a):
d = speedup
while d < a - 1:
c = (a + d - 1) // d
d = (a + c - 2) // (c - 1)
yield d
def calc(d):
return sum(d - 1 - (i - 1) % d for i in a)
def ans():
for d, pd in zip(D, D[1:]):
... | IMPORT ASSIGN VAR VAR ASSIGN VAR NUMBER FUNC_DEF ASSIGN VAR VAR WHILE VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR VAR NUMBER VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR VAR NUMBER BIN_OP VAR NUMBER EXPR VAR FUNC_DEF RETURN FUNC_CALL VAR BIN_OP BIN_OP VAR NUMBER BIN_OP BIN_OP VAR NUMBER VAR VAR VAR FUNC_DEF FO... |
Nadeko's birthday is approaching! As she decorated the room for the party, a long garland of Dianthus-shaped paper pieces was placed on a prominent part of the wall. Brother Koyomi will like it!
Still unsatisfied with the garland, Nadeko decided to polish it again. The garland has n pieces numbered from 1 to n from le... | import sys
input = sys.stdin.readline
n = int(input())
s = input()[:-1]
ans = [([-1] * (n + 1)) for _ in range(26)]
for c in range(26):
for i in range(n):
cnt = 0
for j in range(i, n):
if ord(s[j]) - ord("a") != c:
cnt += 1
ans[c][cnt] = max(ans[c][cnt], j - ... | IMPORT ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER VAR FUNC_CALL VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR VAR IF BIN_OP FUNC_CALL VAR VAR VAR FUNC_CALL VAR STRIN... |
Nadeko's birthday is approaching! As she decorated the room for the party, a long garland of Dianthus-shaped paper pieces was placed on a prominent part of the wall. Brother Koyomi will like it!
Still unsatisfied with the garland, Nadeko decided to polish it again. The garland has n pieces numbered from 1 to n from le... | import sys
n = int(input())
s = input()
pfs = [[(0) for _ in range(n + 1)] for _ in range(26)]
for i in range(n):
ch = ord(s[i]) - ord("a")
for j in range(26):
if j == ch:
pfs[j][i + 1] = pfs[j][i] + 1
else:
pfs[j][i + 1] = pfs[j][i]
dp = [[(0) for _ in range(n + 1)] for... | IMPORT ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER VAR FUNC_CALL VAR BIN_OP VAR NUMBER VAR FUNC_CALL VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP FUNC_CALL VAR VAR VAR FUNC_CALL VAR STRING FOR VAR FUNC_CALL VAR NUMBER IF VAR VAR ASSIGN VAR VAR BIN_OP VAR NUMBER BIN_OP VAR... |
Nadeko's birthday is approaching! As she decorated the room for the party, a long garland of Dianthus-shaped paper pieces was placed on a prominent part of the wall. Brother Koyomi will like it!
Still unsatisfied with the garland, Nadeko decided to polish it again. The garland has n pieces numbered from 1 to n from le... | import sys
input = sys.stdin.readline
def getCons(string, m, c):
n = len(string)
ans = 0
st, end = 0, 0
while end < n:
if string[end] == c:
end += 1
elif m:
m -= 1
end += 1
else:
while st < end and string[st] == c:
... | IMPORT ASSIGN VAR VAR FUNC_DEF ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR VAR NUMBER NUMBER WHILE VAR VAR IF VAR VAR VAR VAR NUMBER IF VAR VAR NUMBER VAR NUMBER WHILE VAR VAR VAR VAR VAR VAR NUMBER VAR NUMBER VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR BIN_OP VAR VAR RETURN VAR ASSIGN VAR NUMBER WHILE VAR VA... |
Nadeko's birthday is approaching! As she decorated the room for the party, a long garland of Dianthus-shaped paper pieces was placed on a prominent part of the wall. Brother Koyomi will like it!
Still unsatisfied with the garland, Nadeko decided to polish it again. The garland has n pieces numbered from 1 to n from le... | import sys
n = int(sys.stdin.readline().strip())
s = sys.stdin.readline().strip()
dp = [([-1] * (n + 1)) for i in range(26)]
for c in range(26):
for j in range(n):
tst = 1 if s[j] == chr(c + 97) else 0
dp[c][1 - tst] = max(dp[c][1 - tst], 1)
for k in range(j + 1, n):
if s[k] == ... | IMPORT ASSIGN VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER VAR FUNC_CALL VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR VAR FUNC_CALL VAR BIN_OP VAR NUMBER NUMBER NUMBER ASSIGN VAR VAR BIN_OP NUMBER VAR FUN... |
Nadeko's birthday is approaching! As she decorated the room for the party, a long garland of Dianthus-shaped paper pieces was placed on a prominent part of the wall. Brother Koyomi will like it!
Still unsatisfied with the garland, Nadeko decided to polish it again. The garland has n pieces numbered from 1 to n from le... | import sys
ii = lambda: sys.stdin.readline().strip()
idata = lambda: [int(x) for x in ii().split()]
n = int(ii())
s = ii()
slov = {}
for i in range(97, 97 + 26):
slov[chr(i)] = [[], [1]]
slov[s[0]] = [[1], [0, 0]]
for j in range(1, n):
if slov[s[j]][1][-1] == 0:
slov[s[j]][0][-1] += 1
else:
... | IMPORT ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR DICT FOR VAR FUNC_CALL VAR NUMBER BIN_OP NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR VAR LIST LIST LIST NUMBER ASSIGN VAR VAR NUMBER LIST LIST NUMBER L... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.