code
stringlengths
3
6.57k
c()
map(int, sys.stdin.readline()
split()
list(s)
sys.stdin.read()
split()
range(h)
range(w)
heuristic_function(u, v=target)
divmod(u, w)
divmod(v, w)
abs(vy - uy)
abs(ux - vx)
min_time(x)
GeometryTopology.Graph(h * w)
nx.DiGraph()
range(h)
range(w)
g.dijkstra(source)
g.astar(source, target, heuristic_function)
nx.dijkstra_path_length(g, source, target)
nx.astar_path_length(g, source, target, heuristic_function)
binary_search()
min_time(x)
print(binary_search()
d()
map(int, sys.stdin.readline()
split()
sorted(NumberTheory.find_divisors(k)
len(div)
enumerate(div)
range(l - 1, -1, -1)
range(i + 1, l)
sum(s[i] * k // div[i] % MOD for i in range(l)
a()
int(sys.stdin.readline()
rstrip()
range(5)
print(len(s)
b()
map(int, sys.stdin.read()
split()
print("YES" if len(set(p)
set([a, b])
c()
map(int, sys.stdin.read()
split()
np.array(xy)
reshape(m, 2)
csr_matrix((np.ones(m)
np.logical_or(g, g.T)
np.zeros(n, dtype=np.int64)
reshape(-1, 1)
np.dot(g, paths)
print(paths[b, 0])
c_2()
map(int, sys.stdin.read()
split()
GeometryTopology.Graph()
zip(*[iter(xy)
g.add_edge(x, y, weight=1)
g.add_edge(y, x, weight=1)
g.dijkstra(a, paths_cnt=True, mod=MOD)
print(paths[b])
d()
map(int, sys.stdin.read()
split()
Combinatorics.CombinationsMod()
print(cn(n + k - 1, k)
a()
map(int, sys.stdin.read()
split()
np.array(a)
np.cumsum(a, out=a)
print(((s <= a)
sum()
b()
map(int, sys.stdin.read()
split()
Counter(a)
print(sum(c.values()
len(c)
c()
map(int, sys.stdin.read()
split()
np.array(uvl)
reshape(m, 3)
csgraph_to_dense(csr_matrix((l, (u, v)
copy()
shortest_path(g, method="FW", directed=False)
np.array([*itertools.combinations(range(1, n)
min()
print(-1 if res == np.inf else int(res)
d()
map(int, sys.stdin.read()
split()
np.array(ab)
reshape(2, n, 2)
c.mean(axis=1)
np.sqrt(((c - g[:, None, :])