code stringlengths 3 6.57k |
|---|
split() |
np.array(lrs) |
reshape(n, 3) |
np.zeros((m + 1,) |
np.add.at(score, l - 1, s) |
np.subtract.at(score, r, s) |
np.cumsum(score, out=score) |
print(s.sum() |
min() |
d() |
map(int, sys.stdin.read() |
split() |
defaultdict(int) |
range(n) |
range(1, n + 1) |
print(dp[n]) |
a() |
map(int, sys.stdin.read() |
split() |
sorted(enumerate(a) |
range(3) |
print(*res, sep="\n") |
b() |
sys.stdin.readline() |
rstrip() |
map(int, sys.stdin.read() |
split() |
zip(*[iter(lr) |
print(s) |
c() |
map(int, sys.stdin.readline() |
split() |
np.array([list(s) |
sys.stdin.read() |
split() |
np.pad(s, 1, constant_values="x") |
np.zeros_like(s, dtype=np.float64) |
range(1, r + 1) |
np.minimum(a[i - 1, :] + 1, a[i, :], out=a[i, :]) |
range(r, 0, -1) |
np.minimum(a[i + 1, :] + 1, a[i, :], out=a[i, :]) |
range(1, c + 1) |
np.minimum(a[:, j - 1] + 1, a[:, j], out=a[:, j]) |
range(c, 0, -1) |
np.minimum(a[:, j + 1] + 1, a[:, j], out=a[:, j]) |
print(np.count_nonzero(a >= k) |
c_2() |
map(int, sys.stdin.readline() |
split() |
np.array([list(s) |
sys.stdin.read() |
split() |
np.pad(s, 1, constant_values="x") |
astype(np.int16) |
distance_transform_cdt(a, metric="taxicab") |
print(np.count_nonzero(a >= k) |
d() |
map(int, sys.stdin.read() |
split() |
np.array(xyz) |
reshape(r, 3) |
np.zeros((n, m) |
np.array([*itertools.combinations(range(n) |
print(np.sort(h[g].sum(axis=1) |
sum(axis=1) |
max() |
a() |
map(int, sys.stdin.readline() |
split() |
print(sorted(a) |
b() |
sys.stdin.readline() |
rstrip() |
str(cnt) |
print(t[2:]) |
c() |
map(int, sys.stdin.read() |
split() |
set() |
res.add(x) |
print(len(res) |
d() |
inquire(u, v) |
print(f"? {u} {v}".format(u, v) |
int(sys.stdin.readline() |
rstrip() |
int(sys.stdin.readline() |
rstrip() |
sorted([(inquire(1, v) |
range(2, n + 1) |
max((inquire(u, v) |
range(1, n + 1) |
print(f"! {d}") |
a() |
int(sys.stdin.readline() |
rstrip() |
b() |
sys.stdin.readline() |
split() |
print(int(a + b) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.