message stringlengths 2 49.9k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 446 108k | cluster float64 13 13 | __index_level_0__ int64 892 217k |
|---|---|---|---|---|---|
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a tree with N vertices, numbered 1 through N. The i-th of the N-1 edges connects vertices a_i and b_i.
Currently, there are A_i stones placed on vertex i. Determine whether it is possi... | instruction | 0 | 95,162 | 13 | 190,324 |
No | output | 1 | 95,162 | 13 | 190,325 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
This is an interactive problem.
Misha likes to play cooperative games with incomplete information. Today he suggested ten his friends to play a cooperative game "Lake".
Misha has already come ... | instruction | 0 | 95,314 | 13 | 190,628 |
No | output | 1 | 95,314 | 13 | 190,629 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
This is an interactive problem.
Misha likes to play cooperative games with incomplete information. Today he suggested ten his friends to play a cooperative game "Lake".
Misha has already come ... | instruction | 0 | 95,315 | 13 | 190,630 |
No | output | 1 | 95,315 | 13 | 190,631 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
This is an interactive problem.
Misha likes to play cooperative games with incomplete information. Today he suggested ten his friends to play a cooperative game "Lake".
Misha has already come ... | instruction | 0 | 95,316 | 13 | 190,632 |
No | output | 1 | 95,316 | 13 | 190,633 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
This is an interactive problem.
Misha likes to play cooperative games with incomplete information. Today he suggested ten his friends to play a cooperative game "Lake".
Misha has already come ... | instruction | 0 | 95,317 | 13 | 190,634 |
No | output | 1 | 95,317 | 13 | 190,635 |
Evaluate the correctness of the submitted Python 2 solution to the coding contest problem. Provide a "Yes" or "No" response.
This is an interactive problem.
Misha likes to play cooperative games with incomplete information. Today he suggested ten his friends to play a cooperative game "Lake".
Misha has already come ... | instruction | 0 | 95,318 | 13 | 190,636 |
No | output | 1 | 95,318 | 13 | 190,637 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given an integer k and an undirected tree, consisting of n vertices.
The length of a simple path (a path in which each vertex appears at most once) between some pair of vertices is the number of edges in this path. A diameter of a t... | instruction | 0 | 95,502 | 13 | 191,004 |
Tags: combinatorics, dfs and similar, dp, trees
Correct Solution:
```
import sys
from collections import deque
input = lambda :sys.stdin.buffer.readline()
mi = lambda :map(int,input().split())
li = lambda :list(mi())
mod = 998244353
N,K = mi()
edge = [[] for i in range(N)]
for _ in range(N-1):
a,b = mi()
edg... | output | 1 | 95,502 | 13 | 191,005 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given an integer k and an undirected tree, consisting of n vertices.
The length of a simple path (a path in which each vertex appears at most once) between some pair of vertices is the ... | instruction | 0 | 95,503 | 13 | 191,006 |
No | output | 1 | 95,503 | 13 | 191,007 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Nastia has an unweighted tree with n vertices and wants to play with it!
The girl will perform the following operation with her tree, as long as she needs:
1. Remove any existing edge.
2. Add an edge between any pair of vertices.
... | instruction | 0 | 95,504 | 13 | 191,008 |
Tags: constructive algorithms, data structures, dfs and similar, dp, dsu, greedy, implementation, trees
Correct Solution:
```
'''Author- Akshit Monga'''
# Don't know the proper proof
from sys import stdin, stdout
input = stdin.readline
from types import GeneratorType
def bootstrap(f, stack=[]):
def wrappedfunc(*ar... | output | 1 | 95,504 | 13 | 191,009 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Nastia has an unweighted tree with n vertices and wants to play with it!
The girl will perform the following operation with her tree, as long as she needs:
1. Remove any existing edge.
2. Add an edge between any pair of vertices.
... | instruction | 0 | 95,505 | 13 | 191,010 |
Tags: constructive algorithms, data structures, dfs and similar, dp, dsu, greedy, implementation, trees
Correct Solution:
```
import sys
input = sys.stdin.buffer.readline
for _ in range(int(input())):
n = int(input())
edges = [list(map(int,input().split())) for i in range(n-1)]
adj = [set() for i in range... | output | 1 | 95,505 | 13 | 191,011 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Nastia has an unweighted tree with n vertices and wants to play with it!
The girl will perform the following operation with her tree, as long as she needs:
1. Remove any existing edge.
2. Add an edge between any pair of vertices.
... | instruction | 0 | 95,506 | 13 | 191,012 |
Tags: constructive algorithms, data structures, dfs and similar, dp, dsu, greedy, implementation, trees
Correct Solution:
```
import sys
sys.setrecursionlimit(250010)
def dfs(x):
tag[x] = 1
ql = -1
tgs = (-1, -1)
l = 0
for v in lian[x]:
if tag[v] == 0:
t = dfs(v)
gs[v... | output | 1 | 95,506 | 13 | 191,013 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Nastia has an unweighted tree with n vertices and wants to play with it!
The girl will perform the following operation with her tree, as long as she needs:
1. Remove any existing edge.
2. Add an edge between any pair of vertices.
... | instruction | 0 | 95,507 | 13 | 191,014 |
Tags: constructive algorithms, data structures, dfs and similar, dp, dsu, greedy, implementation, trees
Correct Solution:
```
import io
import os
from collections import defaultdict
from types import GeneratorType
from heapq import heappush, heappop
# From https://github.com/cheran-senthil/PyRival/blob/master/pyriva... | output | 1 | 95,507 | 13 | 191,015 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Nastia has an unweighted tree with n vertices and wants to play with it!
The girl will perform the following operation with her tree, as long as she needs:
1. Remove any existing edge.
2. Add an edge between any pair of vertices.
... | instruction | 0 | 95,508 | 13 | 191,016 |
Tags: constructive algorithms, data structures, dfs and similar, dp, dsu, greedy, implementation, trees
Correct Solution:
```
def leaf(f,u):
if len(m[u])==1:
return u
else:
for v in m[u]:
if v!=f:
ans=leaf(u,v)
if ans:return ans
def c... | output | 1 | 95,508 | 13 | 191,017 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Nastia has an unweighted tree with n vertices and wants to play with it!
The girl will perform the following operation with her tree, as long as she needs:
1. Remove any existing edge.
2. Add an edge between any pair of vertices.
... | instruction | 0 | 95,509 | 13 | 191,018 |
Tags: constructive algorithms, data structures, dfs and similar, dp, dsu, greedy, implementation, trees
Correct Solution:
```
import sys
sys.setrecursionlimit(111111)
def dfs(x):
tag[x] = 1
q = []
ql = -1
tgs = [-1, -1]
for v in lian[x]:
if tag[v] == 0:
gs[v] = dfs(v)
... | output | 1 | 95,509 | 13 | 191,019 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Nastia has an unweighted tree with n vertices and wants to play with it!
The girl will perform the following operation with her tree, as long as she needs:
1. Remove any existing edge.
2. Add an edge between any pair of vertices.
... | instruction | 0 | 95,510 | 13 | 191,020 |
Tags: constructive algorithms, data structures, dfs and similar, dp, dsu, greedy, implementation, trees
Correct Solution:
```
import time
#start_time = time.time()
#def TIME_(): print(time.time()-start_time)
import os, sys
from io import BytesIO, IOBase
from types import GeneratorType
from bisect import bisect_left, ... | output | 1 | 95,510 | 13 | 191,021 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Nastia has an unweighted tree with n vertices and wants to play with it!
The girl will perform the following operation with her tree, as long as she needs:
1. Remove any existing edge.
2. Add an edge between any pair of vertices.
... | instruction | 0 | 95,511 | 13 | 191,022 |
Tags: constructive algorithms, data structures, dfs and similar, dp, dsu, greedy, implementation, trees
Correct Solution:
```
def dfs(x, e, v, g):
v[x] = True
c = 0
for y in e[x]:
if not y in v:
if dfs(y, e, v, g):
c += 1
if c > 2:
g.append((x, y))
else:
g.append(... | output | 1 | 95,511 | 13 | 191,023 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Nastia has an unweighted tree with n vertices and wants to play with it!
The girl will perform the following operation with her tree, as long as she needs:
1. Remove any existing edge.
2.... | instruction | 0 | 95,512 | 13 | 191,024 |
Yes | output | 1 | 95,512 | 13 | 191,025 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Nastia has an unweighted tree with n vertices and wants to play with it!
The girl will perform the following operation with her tree, as long as she needs:
1. Remove any existing edge.
2.... | instruction | 0 | 95,513 | 13 | 191,026 |
Yes | output | 1 | 95,513 | 13 | 191,027 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Nastia has an unweighted tree with n vertices and wants to play with it!
The girl will perform the following operation with her tree, as long as she needs:
1. Remove any existing edge.
2.... | instruction | 0 | 95,514 | 13 | 191,028 |
Yes | output | 1 | 95,514 | 13 | 191,029 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Nastia has an unweighted tree with n vertices and wants to play with it!
The girl will perform the following operation with her tree, as long as she needs:
1. Remove any existing edge.
2.... | instruction | 0 | 95,515 | 13 | 191,030 |
Yes | output | 1 | 95,515 | 13 | 191,031 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Nastia has an unweighted tree with n vertices and wants to play with it!
The girl will perform the following operation with her tree, as long as she needs:
1. Remove any existing edge.
2.... | instruction | 0 | 95,516 | 13 | 191,032 |
No | output | 1 | 95,516 | 13 | 191,033 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Nastia has an unweighted tree with n vertices and wants to play with it!
The girl will perform the following operation with her tree, as long as she needs:
1. Remove any existing edge.
2.... | instruction | 0 | 95,517 | 13 | 191,034 |
No | output | 1 | 95,517 | 13 | 191,035 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Nastia has an unweighted tree with n vertices and wants to play with it!
The girl will perform the following operation with her tree, as long as she needs:
1. Remove any existing edge.
2.... | instruction | 0 | 95,518 | 13 | 191,036 |
No | output | 1 | 95,518 | 13 | 191,037 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Nastia has an unweighted tree with n vertices and wants to play with it!
The girl will perform the following operation with her tree, as long as she needs:
1. Remove any existing edge.
2.... | instruction | 0 | 95,519 | 13 | 191,038 |
No | output | 1 | 95,519 | 13 | 191,039 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Iahub recently has learned Bubble Sort, an algorithm that is used to sort a permutation with n elements a1, a2, ..., an in ascending order. He is bored of this so simple algorithm, so he invents his own graph. The graph (let's call it G) ini... | instruction | 0 | 95,603 | 13 | 191,206 |
Tags: binary search, data structures, dp
Correct Solution:
```
import sys
input = sys.stdin.readline
I = lambda : list(map(int,input().split()))
def CeilIndex(A, l, r, key):
while (r - l > 1):
m = l + (r - l)//2
if (A[m] >= key):
r = m
else:
l = m
re... | output | 1 | 95,603 | 13 | 191,207 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Iahub recently has learned Bubble Sort, an algorithm that is used to sort a permutation with n elements a1, a2, ..., an in ascending order. He is bored of this so simple algorithm, so he invents his own graph. The graph (let's call it G) ini... | instruction | 0 | 95,604 | 13 | 191,208 |
Tags: binary search, data structures, dp
Correct Solution:
```
from sys import stdin
input = stdin.readline
class BIT():
def __init__(self, n):
self.n = n
self.tree = [0] * (n + 1)
def sum(self, i):
ans = 0
i += 1
while i > 0:
ans =max(ans, self.tree[i])
... | output | 1 | 95,604 | 13 | 191,209 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Iahub recently has learned Bubble Sort, an algorithm that is used to sort a permutation with n elements a1, a2, ..., an in ascending order. He is bored of this so simple algorithm, so he invents his own graph. The graph (let's call it G) ini... | instruction | 0 | 95,605 | 13 | 191,210 |
Tags: binary search, data structures, dp
Correct Solution:
```
import math
import sys
from bisect import bisect_right, bisect_left, insort_right
from collections import Counter, defaultdict
from heapq import heappop, heappush
from itertools import accumulate, permutations, combinations
from sys import stdout
R = lambd... | output | 1 | 95,605 | 13 | 191,211 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Iahub recently has learned Bubble Sort, an algorithm that is used to sort a permutation with n elements a1, a2, ..., an in ascending order. He is bored of this so simple algorithm, so he invents his own graph. The graph (let's call it G) ini... | instruction | 0 | 95,606 | 13 | 191,212 |
Tags: binary search, data structures, dp
Correct Solution:
```
from bisect import *
s, n = [0], input()
for i in map(int, input().split()):
if i > s[-1]: s.append(i)
else: s[bisect_right(s, i)] = i
print(len(s) - 1)
``` | output | 1 | 95,606 | 13 | 191,213 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Iahub recently has learned Bubble Sort, an algorithm that is used to sort a permutation with n elements a1, a2, ..., an in ascending order. He is bored of this so simple algorithm, so he invents his own graph. The graph (let's call it G) ini... | instruction | 0 | 95,607 | 13 | 191,214 |
Tags: binary search, data structures, dp
Correct Solution:
```
from bisect import bisect_left, bisect_right, insort
R = lambda: map(int, input().split())
n, arr = int(input()), list(R())
dp = []
for i in range(n):
idx = bisect_left(dp, arr[i])
if idx >= len(dp):
dp.append(arr[i])
else:
dp[id... | output | 1 | 95,607 | 13 | 191,215 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Iahub recently has learned Bubble Sort, an algorithm that is used to sort a permutation with n elements a1, a2, ..., an in ascending order. He is bored of this so simple algorithm, so he invents his own graph. The graph (let's call it G) ini... | instruction | 0 | 95,608 | 13 | 191,216 |
Tags: binary search, data structures, dp
Correct Solution:
```
def CeilIndex(A, l, r, key):
while (r - l > 1):
m = l + (r - l)//2
if (A[m] >= key):
r = m
else:
l = m
return r
def LongestIncreasingSubsequenceLength(A, size):
# Add bound... | output | 1 | 95,608 | 13 | 191,217 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Iahub recently has learned Bubble Sort, an algorithm that is used to sort a permutation with n elements a1, a2, ..., an in ascending order. He is bored of this so simple algorithm, so he invents his own graph. The graph (let's call it G) ini... | instruction | 0 | 95,609 | 13 | 191,218 |
Tags: binary search, data structures, dp
Correct Solution:
```
n = int(input())
num_list = list(map(int, input().split()))
# def lower_bound(min_lis, x):
# #goal return the position of the first element >= x
# left = 0
# right = len(min_lis) - 1
# res = -1
# while left <= right:
# mid = (l... | output | 1 | 95,609 | 13 | 191,219 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Iahub recently has learned Bubble Sort, an algorithm that is used to sort a permutation with n elements a1, a2, ..., an in ascending order. He is bored of this so simple algorithm, so he invents his own graph. The graph (let's call it G) ini... | instruction | 0 | 95,610 | 13 | 191,220 |
Tags: binary search, data structures, dp
Correct Solution:
```
def CeilIndex(A, l, r, key):
while (r - l > 1):
m = l + (r - l)//2
if (A[m] >= key):
r = m
else:
l = m
return r
def LIS(A, size):
tailTable = [0 for i in range(size + 1)]
... | output | 1 | 95,610 | 13 | 191,221 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Iahub recently has learned Bubble Sort, an algorithm that is used to sort a permutation with n elements a1, a2, ..., an in ascending order. He is bored of this so simple algorithm, so he invents... | instruction | 0 | 95,611 | 13 | 191,222 |
Yes | output | 1 | 95,611 | 13 | 191,223 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Iahub recently has learned Bubble Sort, an algorithm that is used to sort a permutation with n elements a1, a2, ..., an in ascending order. He is bored of this so simple algorithm, so he invents... | instruction | 0 | 95,612 | 13 | 191,224 |
Yes | output | 1 | 95,612 | 13 | 191,225 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Iahub recently has learned Bubble Sort, an algorithm that is used to sort a permutation with n elements a1, a2, ..., an in ascending order. He is bored of this so simple algorithm, so he invents... | instruction | 0 | 95,613 | 13 | 191,226 |
Yes | output | 1 | 95,613 | 13 | 191,227 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Iahub recently has learned Bubble Sort, an algorithm that is used to sort a permutation with n elements a1, a2, ..., an in ascending order. He is bored of this so simple algorithm, so he invents... | instruction | 0 | 95,614 | 13 | 191,228 |
Yes | output | 1 | 95,614 | 13 | 191,229 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Iahub recently has learned Bubble Sort, an algorithm that is used to sort a permutation with n elements a1, a2, ..., an in ascending order. He is bored of this so simple algorithm, so he invents... | instruction | 0 | 95,615 | 13 | 191,230 |
No | output | 1 | 95,615 | 13 | 191,231 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Iahub recently has learned Bubble Sort, an algorithm that is used to sort a permutation with n elements a1, a2, ..., an in ascending order. He is bored of this so simple algorithm, so he invents... | instruction | 0 | 95,616 | 13 | 191,232 |
No | output | 1 | 95,616 | 13 | 191,233 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Iahub recently has learned Bubble Sort, an algorithm that is used to sort a permutation with n elements a1, a2, ..., an in ascending order. He is bored of this so simple algorithm, so he invents... | instruction | 0 | 95,617 | 13 | 191,234 |
No | output | 1 | 95,617 | 13 | 191,235 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Iahub recently has learned Bubble Sort, an algorithm that is used to sort a permutation with n elements a1, a2, ..., an in ascending order. He is bored of this so simple algorithm, so he invents... | instruction | 0 | 95,618 | 13 | 191,236 |
No | output | 1 | 95,618 | 13 | 191,237 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The clique problem is one of the most well-known NP-complete problems. Under some simplification it can be formulated as follows. Consider an undirected graph G. It is required to find a subset of vertices C of the maximum size such that any... | instruction | 0 | 95,670 | 13 | 191,340 |
Tags: data structures, dp, greedy, implementation, sortings
Correct Solution:
```
#!/usr/bin/env python
# coding=utf-8
n = int(input())
l = []
for i in range(n):
x, y = map(int, input().split())
l += [(x + y, x - y)]
l.sort()
r = -2000000000
a = 0
for u in l:
if u[1] >= r:
a += 1
r = u[0]
p... | output | 1 | 95,670 | 13 | 191,341 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The clique problem is one of the most well-known NP-complete problems. Under some simplification it can be formulated as follows. Consider an undirected graph G. It is required to find a subset of vertices C of the maximum size such that any... | instruction | 0 | 95,671 | 13 | 191,342 |
Tags: data structures, dp, greedy, implementation, sortings
Correct Solution:
```
def on(l1, l2):
return(abs(l1[0]-l2[0])>=l1[1]+l2[1])
n = int(input())
inf = []
for i in range(n):
a,b = map(int,input().split())
inf.append([a+b,a-b])
inf.sort()
res = 1
last = 0
for i in range(1,n):
if inf[i][1] >= inf[l... | output | 1 | 95,671 | 13 | 191,343 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The clique problem is one of the most well-known NP-complete problems. Under some simplification it can be formulated as follows. Consider an undirected graph G. It is required to find a subset of vertices C of the maximum size such that any... | instruction | 0 | 95,672 | 13 | 191,344 |
Tags: data structures, dp, greedy, implementation, sortings
Correct Solution:
```
from sys import stdin,setrecursionlimit
import threading
def main():
n = int(stdin.readline())
line = []
for i in range(n):
x, w = [int(x) for x in stdin.readline().split()]
line.append((x-w,x+w))
line.... | output | 1 | 95,672 | 13 | 191,345 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The clique problem is one of the most well-known NP-complete problems. Under some simplification it can be formulated as follows. Consider an undirected graph G. It is required to find a subset of vertices C of the maximum size such that any... | instruction | 0 | 95,673 | 13 | 191,346 |
Tags: data structures, dp, greedy, implementation, sortings
Correct Solution:
```
from sys import stdin
from sys import stdout
from collections import defaultdict
n=int(stdin.readline())
a=[map(int,stdin.readline().split(),(10,10)) for i in range(n)]
v=defaultdict(list)
for i,e in enumerate(a,1):
q,f=e
v[q-f].a... | output | 1 | 95,673 | 13 | 191,347 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The clique problem is one of the most well-known NP-complete problems. Under some simplification it can be formulated as follows. Consider an undirected graph G. It is required to find a subset of vertices C of the maximum size such that any... | instruction | 0 | 95,674 | 13 | 191,348 |
Tags: data structures, dp, greedy, implementation, sortings
Correct Solution:
```
from operator import itemgetter
class CodeforcesTask528BSolution:
def __init__(self):
self.result = ''
self.n = 0
self.points = []
def read_input(self):
self.n = int(input())
for _ in ran... | output | 1 | 95,674 | 13 | 191,349 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The clique problem is one of the most well-known NP-complete problems. Under some simplification it can be formulated as follows. Consider an undirected graph G. It is required to find a subset of vertices C of the maximum size such that any... | instruction | 0 | 95,675 | 13 | 191,350 |
Tags: data structures, dp, greedy, implementation, sortings
Correct Solution:
```
import sys
readline = sys.stdin.readline
def main():
N = int(input())
itvs = []
for _ in range(N):
x, w = map(int, input().split())
itvs.append((x - w, x + w))
itvs.sort(key=lambda x: x[1])
ans = 0
... | output | 1 | 95,675 | 13 | 191,351 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The clique problem is one of the most well-known NP-complete problems. Under some simplification it can be formulated as follows. Consider an undirected graph G. It is required to find a subset of vertices C of the maximum size such that any... | instruction | 0 | 95,676 | 13 | 191,352 |
Tags: data structures, dp, greedy, implementation, sortings
Correct Solution:
```
from bisect import bisect
import sys
readlines = sys.stdin.buffer.readlines
readline = sys.stdin.buffer.readline
def solve(X,W):
'''
(X[j]>X[i]) and (X[j]-W[j] >= X[i]+W[i]) <=> i,j are connected
'''
XW = sorted((x,w) for... | output | 1 | 95,676 | 13 | 191,353 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The clique problem is one of the most well-known NP-complete problems. Under some simplification it can be formulated as follows. Consider an undirected graph G. It is required to find a subset of vertices C of the maximum size such that any... | instruction | 0 | 95,677 | 13 | 191,354 |
Tags: data structures, dp, greedy, implementation, sortings
Correct Solution:
```
n = int(input())
d = []
for i in range(n):
xx, ww = [int(i) for i in input().split()]
d.append([xx-ww, xx+ww])
d.sort(key=lambda x:x[0])
last = -100000000000
ans = 0
for i in range(n):
if last <= d[i][0]:
last = d[i][1... | output | 1 | 95,677 | 13 | 191,355 |
Provide tags and a correct Python 2 solution for this coding contest problem.
The clique problem is one of the most well-known NP-complete problems. Under some simplification it can be formulated as follows. Consider an undirected graph G. It is required to find a subset of vertices C of the maximum size such that any... | instruction | 0 | 95,678 | 13 | 191,356 |
Tags: data structures, dp, greedy, implementation, sortings
Correct Solution:
```
from sys import stdin, stdout
from collections import Counter, defaultdict
from itertools import permutations, combinations
from fractions import Fraction
raw_input = stdin.readline
pr = stdout.write
mod=10**9+7
def ni():
return int(... | output | 1 | 95,678 | 13 | 191,357 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The clique problem is one of the most well-known NP-complete problems. Under some simplification it can be formulated as follows. Consider an undirected graph G. It is required to find a subset ... | instruction | 0 | 95,679 | 13 | 191,358 |
Yes | output | 1 | 95,679 | 13 | 191,359 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.