message
stringlengths
2
45.8k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
254
108k
cluster
float64
3
3
__index_level_0__
int64
508
217k
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp takes part in a quadcopter competition. According to the rules a flying robot should: * start the race from some point of a field, * go around the flag, * close cycle returning...
instruction
0
70,432
3
140,864
No
output
1
70,432
3
140,865
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp takes part in a quadcopter competition. According to the rules a flying robot should: * start the race from some point of a field, * go around the flag, * close cycle returning...
instruction
0
70,433
3
140,866
No
output
1
70,433
3
140,867
Provide tags and a correct Python 3 solution for this coding contest problem. The stardate is 1983, and Princess Heidi is getting better at detecting the Death Stars. This time, two Rebel spies have yet again given Heidi two maps with the possible locations of the Death Star. Since she got rid of all double agents las...
instruction
0
70,466
3
140,932
Tags: hashing, strings Correct Solution: ``` n,m=list(map(int,input().split())) s=[] h=[] mod=10**9 mod+=7 for i in range(n): s=(input()) s=s.lower() hw=0 for i in range(m): hw+=ord(s[i])*(10**(m-i)) h.append(hw%mod) h1=[[] for i in range(n-m+1)] for i in range(m): hw=0 s=input() ...
output
1
70,466
3
140,933
Provide tags and a correct Python 3 solution for this coding contest problem. The stardate is 1983, and Princess Heidi is getting better at detecting the Death Stars. This time, two Rebel spies have yet again given Heidi two maps with the possible locations of the Death Star. Since she got rid of all double agents las...
instruction
0
70,467
3
140,934
Tags: hashing, strings Correct Solution: ``` n, m = list(map(int, input().strip().split(' '))) mat1, mat2 = [], [] for i in range(0, n): mat1.append(tuple(input().strip())) for i in range(0, m): mat2.append(tuple(input().strip())) ix, jx, flg = -1, -1, 0 matr, matc = [], [] for i in range(0, n-m+1): si, se = i, i+m m...
output
1
70,467
3
140,935
Provide tags and a correct Python 3 solution for this coding contest problem. The stardate is 1983, and Princess Heidi is getting better at detecting the Death Stars. This time, two Rebel spies have yet again given Heidi two maps with the possible locations of the Death Star. Since she got rid of all double agents las...
instruction
0
70,468
3
140,936
Tags: hashing, strings Correct Solution: ``` n, m = list(map(int, input().strip().split(' '))) L, M = [], [] for i in range(n): L.append(tuple(input().strip())) for i in range(0, m): M.append(tuple(input().strip())) k=0 row, col = [], [] for i in range(n-m+1): init, end = i, i+m row.append(hash(tuple(L[init:end...
output
1
70,468
3
140,937
Provide tags and a correct Python 3 solution for this coding contest problem. The stardate is 1983, and Princess Heidi is getting better at detecting the Death Stars. This time, two Rebel spies have yet again given Heidi two maps with the possible locations of the Death Star. Since she got rid of all double agents las...
instruction
0
70,469
3
140,938
Tags: hashing, strings Correct Solution: ``` n, m = [int(x) for x in input().split()] list1 = [] list2 = [] for i in range(n): list1.append(input()) for j in range(m): list2.append(input()) list3 = [] for i in range(n - m + 1): y = "" for j in range(m): y += list1[j + i] list3.append(y) l...
output
1
70,469
3
140,939
Provide tags and a correct Python 3 solution for this coding contest problem. The stardate is 1983, and Princess Heidi is getting better at detecting the Death Stars. This time, two Rebel spies have yet again given Heidi two maps with the possible locations of the Death Star. Since she got rid of all double agents las...
instruction
0
70,470
3
140,940
Tags: hashing, strings Correct Solution: ``` n, m = [int(x) for x in input().split()] list1 = [] list2 = [] for i in range(n): list1.append(input()) for j in range(m): list2.append(input()) list3 = [] for i in range(n - m + 1): y = "" for j in range(m): y += list1[j + i] list3.append(y) l...
output
1
70,470
3
140,941
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The stardate is 1983, and Princess Heidi is getting better at detecting the Death Stars. This time, two Rebel spies have yet again given Heidi two maps with the possible locations of the Death S...
instruction
0
70,471
3
140,942
No
output
1
70,471
3
140,943
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The stardate is 1983, and Princess Heidi is getting better at detecting the Death Stars. This time, two Rebel spies have yet again given Heidi two maps with the possible locations of the Death S...
instruction
0
70,472
3
140,944
No
output
1
70,472
3
140,945
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The stardate is 1983, and Princess Heidi is getting better at detecting the Death Stars. This time, two Rebel spies have yet again given Heidi two maps with the possible locations of the Death S...
instruction
0
70,473
3
140,946
No
output
1
70,473
3
140,947
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The stardate is 1983, and Princess Heidi is getting better at detecting the Death Stars. This time, two Rebel spies have yet again given Heidi two maps with the possible locations of the Death S...
instruction
0
70,474
3
140,948
No
output
1
70,474
3
140,949
Provide a correct Python 3 solution for this coding contest problem. Anchored Balloon A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation. <image> ...
instruction
0
70,691
3
141,382
"Correct Solution: ``` import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools sys.setrecursionlimit(10**7) inf = 10**20 eps = 1.0 / 10**13 mod = 10**9+7 dd = [(-1,0),(0,1),(1,0),(0,-1)] ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)] def LI(): return [int...
output
1
70,691
3
141,383
Provide a correct Python 3 solution for this coding contest problem. Anchored Balloon A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation. <image> ...
instruction
0
70,692
3
141,384
"Correct Solution: ``` """http://mayokoex.hatenablog.com/entry/2015/06/11/124120を参照しました""" """三分探索、賢い""" import sys MI = 1e-6 def calc(x,y,b): res = 90000 for bx,by,l in b: d = l**2-(x-bx)**2-(y-by)**2 if d < res: res = d return res def search_y(x,b): p = [-100,-33,33,100] ...
output
1
70,692
3
141,385
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. n robots have escaped from your laboratory! You have to find them as soon as possible, because these robots are experimental, and their behavior is not tested yet, so they may be really dangerou...
instruction
0
70,825
3
141,650
Yes
output
1
70,825
3
141,651
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. n robots have escaped from your laboratory! You have to find them as soon as possible, because these robots are experimental, and their behavior is not tested yet, so they may be really dangerou...
instruction
0
70,826
3
141,652
Yes
output
1
70,826
3
141,653
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. n robots have escaped from your laboratory! You have to find them as soon as possible, because these robots are experimental, and their behavior is not tested yet, so they may be really dangerou...
instruction
0
70,827
3
141,654
Yes
output
1
70,827
3
141,655
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. n robots have escaped from your laboratory! You have to find them as soon as possible, because these robots are experimental, and their behavior is not tested yet, so they may be really dangerou...
instruction
0
70,828
3
141,656
Yes
output
1
70,828
3
141,657
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. n robots have escaped from your laboratory! You have to find them as soon as possible, because these robots are experimental, and their behavior is not tested yet, so they may be really dangerou...
instruction
0
70,829
3
141,658
No
output
1
70,829
3
141,659
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. n robots have escaped from your laboratory! You have to find them as soon as possible, because these robots are experimental, and their behavior is not tested yet, so they may be really dangerou...
instruction
0
70,830
3
141,660
No
output
1
70,830
3
141,661
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. n robots have escaped from your laboratory! You have to find them as soon as possible, because these robots are experimental, and their behavior is not tested yet, so they may be really dangerou...
instruction
0
70,831
3
141,662
No
output
1
70,831
3
141,663
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. n robots have escaped from your laboratory! You have to find them as soon as possible, because these robots are experimental, and their behavior is not tested yet, so they may be really dangerou...
instruction
0
70,832
3
141,664
No
output
1
70,832
3
141,665
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Mr. Chanek is currently participating in a science fair that is popular in town. He finds an exciting puzzle in the fair and wants to solve it. There are N atoms numbered from 1 to N. These ato...
instruction
0
70,921
3
141,842
Yes
output
1
70,921
3
141,843
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Mr. Chanek is currently participating in a science fair that is popular in town. He finds an exciting puzzle in the fair and wants to solve it. There are N atoms numbered from 1 to N. These ato...
instruction
0
70,922
3
141,844
Yes
output
1
70,922
3
141,845
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Mr. Chanek is currently participating in a science fair that is popular in town. He finds an exciting puzzle in the fair and wants to solve it. There are N atoms numbered from 1 to N. These ato...
instruction
0
70,923
3
141,846
Yes
output
1
70,923
3
141,847
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Mr. Chanek is currently participating in a science fair that is popular in town. He finds an exciting puzzle in the fair and wants to solve it. There are N atoms numbered from 1 to N. These ato...
instruction
0
70,924
3
141,848
Yes
output
1
70,924
3
141,849
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Mr. Chanek is currently participating in a science fair that is popular in town. He finds an exciting puzzle in the fair and wants to solve it. There are N atoms numbered from 1 to N. These ato...
instruction
0
70,925
3
141,850
No
output
1
70,925
3
141,851
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Mr. Chanek is currently participating in a science fair that is popular in town. He finds an exciting puzzle in the fair and wants to solve it. There are N atoms numbered from 1 to N. These ato...
instruction
0
70,926
3
141,852
No
output
1
70,926
3
141,853
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Mr. Chanek is currently participating in a science fair that is popular in town. He finds an exciting puzzle in the fair and wants to solve it. There are N atoms numbered from 1 to N. These ato...
instruction
0
70,927
3
141,854
No
output
1
70,927
3
141,855
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Mr. Chanek is currently participating in a science fair that is popular in town. He finds an exciting puzzle in the fair and wants to solve it. There are N atoms numbered from 1 to N. These ato...
instruction
0
70,928
3
141,856
No
output
1
70,928
3
141,857
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Throughout Igor K.'s life he has had many situations worthy of attention. We remember the story with the virus, the story of his mathematical career and of course, his famous programming achieve...
instruction
0
71,363
3
142,726
No
output
1
71,363
3
142,727
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Throughout Igor K.'s life he has had many situations worthy of attention. We remember the story with the virus, the story of his mathematical career and of course, his famous programming achieve...
instruction
0
71,364
3
142,728
No
output
1
71,364
3
142,729
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Throughout Igor K.'s life he has had many situations worthy of attention. We remember the story with the virus, the story of his mathematical career and of course, his famous programming achieve...
instruction
0
71,365
3
142,730
No
output
1
71,365
3
142,731
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Throughout Igor K.'s life he has had many situations worthy of attention. We remember the story with the virus, the story of his mathematical career and of course, his famous programming achieve...
instruction
0
71,366
3
142,732
No
output
1
71,366
3
142,733
Provide tags and a correct Python 3 solution for this coding contest problem. This problem is same as the previous one, but has larger constraints. It was a Sunday morning when the three friends Selena, Shiro and Katie decided to have a trip to the nearby power station (do not try this at home). After arriving at the...
instruction
0
71,713
3
143,426
Tags: data structures, geometry, implementation, math Correct Solution: ``` coord = [] coef = {} a = b = 0 v = {} coef_a = {} n = int(input()) for i in range(n): coord.append(list(map(float, input().split()))) for i in range(n): x1, y1 = coord[i] for j in range(i+1,n): x2, y2 = coord[j] if x2 - x1: # Ax...
output
1
71,713
3
143,427
Provide tags and a correct Python 3 solution for this coding contest problem. This problem is same as the previous one, but has larger constraints. It was a Sunday morning when the three friends Selena, Shiro and Katie decided to have a trip to the nearby power station (do not try this at home). After arriving at the...
instruction
0
71,715
3
143,430
Tags: data structures, geometry, implementation, math Correct Solution: ``` #Bhargey Mehta (Sophomore) #DA-IICT, Gandhinagar import sys, math, queue #sys.stdin = open("input.txt", "r") MOD = 10**9+7 n = int(input()) p = [] for i in range(n): x, y = map(int, input().split()) p.append((x, y)) d = {} for i in r...
output
1
71,715
3
143,431
Provide tags and a correct Python 3 solution for this coding contest problem. This problem is same as the previous one, but has larger constraints. It was a Sunday morning when the three friends Selena, Shiro and Katie decided to have a trip to the nearby power station (do not try this at home). After arriving at the...
instruction
0
71,716
3
143,432
Tags: data structures, geometry, implementation, math Correct Solution: ``` import sys input=sys.stdin.readline from math import gcd n=int(input()) p=[list(map(int,input().split())) for i in range(n)] lines=[] for i in range(n): x1,y1=p[i] for j in range(i+1,n): x2,y2=p[j] # a*x-b*y=c a=...
output
1
71,716
3
143,433
Provide tags and a correct Python 3 solution for this coding contest problem. This problem is same as the previous one, but has larger constraints. It was a Sunday morning when the three friends Selena, Shiro and Katie decided to have a trip to the nearby power station (do not try this at home). After arriving at the...
instruction
0
71,718
3
143,436
Tags: data structures, geometry, implementation, math Correct Solution: ``` from sys import stdin,stdout import math from itertools import accumulate def getabc(x1,y1,x2,y2): t1=x2-x1;t2=y2-y1;t3=y1*x2-y2*x1 if t1<0: t1=t1*(-1);t2=t2*(-1);t3=t3*(-1) t4=math.gcd(math.gcd(t1,t2),t3) return t1//t4,t2//t4,t3//t4 n...
output
1
71,718
3
143,437
Provide tags and a correct Python 3 solution for this coding contest problem. This problem is same as the previous one, but has larger constraints. It was a Sunday morning when the three friends Selena, Shiro and Katie decided to have a trip to the nearby power station (do not try this at home). After arriving at the...
instruction
0
71,719
3
143,438
Tags: data structures, geometry, implementation, math Correct Solution: ``` from functools import reduce from math import gcd import collections gcdm = lambda *args: reduce(gcd, args, 0) def pointsToLine2d(p1, p2): if p1 == p2: return (0, 0, 0) _p1, _p2 = sorted((p1, p2)) g = gcdm(*filter(lambda ...
output
1
71,719
3
143,439
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. This problem is same as the previous one, but has larger constraints. It was a Sunday morning when the three friends Selena, Shiro and Katie decided to have a trip to the nearby power station (...
instruction
0
71,720
3
143,440
Yes
output
1
71,720
3
143,441
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. This problem is same as the previous one, but has larger constraints. It was a Sunday morning when the three friends Selena, Shiro and Katie decided to have a trip to the nearby power station (...
instruction
0
71,721
3
143,442
Yes
output
1
71,721
3
143,443
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. This problem is same as the previous one, but has larger constraints. It was a Sunday morning when the three friends Selena, Shiro and Katie decided to have a trip to the nearby power station (...
instruction
0
71,722
3
143,444
Yes
output
1
71,722
3
143,445
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. This problem is same as the previous one, but has larger constraints. It was a Sunday morning when the three friends Selena, Shiro and Katie decided to have a trip to the nearby power station (...
instruction
0
71,723
3
143,446
Yes
output
1
71,723
3
143,447
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. This problem is same as the previous one, but has larger constraints. It was a Sunday morning when the three friends Selena, Shiro and Katie decided to have a trip to the nearby power station (...
instruction
0
71,724
3
143,448
No
output
1
71,724
3
143,449
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. This problem is same as the previous one, but has larger constraints. It was a Sunday morning when the three friends Selena, Shiro and Katie decided to have a trip to the nearby power station (...
instruction
0
71,725
3
143,450
No
output
1
71,725
3
143,451
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. This problem is same as the previous one, but has larger constraints. It was a Sunday morning when the three friends Selena, Shiro and Katie decided to have a trip to the nearby power station (...
instruction
0
71,726
3
143,452
No
output
1
71,726
3
143,453
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. This problem is same as the previous one, but has larger constraints. It was a Sunday morning when the three friends Selena, Shiro and Katie decided to have a trip to the nearby power station (...
instruction
0
71,727
3
143,454
No
output
1
71,727
3
143,455
Provide tags and a correct Python 3 solution for this coding contest problem. Being tired of participating in too many Codeforces rounds, Gildong decided to take some rest in a park. He sat down on a bench, and soon he found two rabbits hopping around. One of the rabbits was taller than the other. He noticed that the...
instruction
0
71,789
3
143,578
Tags: math Correct Solution: ``` for i in range (int(input())): x,y,a,b=[int(x) for x in input().split()] k=(y-x)%(a+b) j=(y-x)//(a+b) if k==0: print(j) else: print(-1) ```
output
1
71,789
3
143,579
Provide tags and a correct Python 3 solution for this coding contest problem. Being tired of participating in too many Codeforces rounds, Gildong decided to take some rest in a park. He sat down on a bench, and soon he found two rabbits hopping around. One of the rabbits was taller than the other. He noticed that the...
instruction
0
71,790
3
143,580
Tags: math Correct Solution: ``` #Ashish Sagar import math q=int(input()) #q=1 for _ in range(q): x,y,a,b=map(int,input().split()) if (y-x)%(a+b)==0: print((y-x)//(a+b)) else: print(-1) ```
output
1
71,790
3
143,581
Provide tags and a correct Python 3 solution for this coding contest problem. Being tired of participating in too many Codeforces rounds, Gildong decided to take some rest in a park. He sat down on a bench, and soon he found two rabbits hopping around. One of the rabbits was taller than the other. He noticed that the...
instruction
0
71,791
3
143,582
Tags: math Correct Solution: ``` for i in range(int(input())): x,y,a,b=list(map(int,input().split())) if ((y-x)%(a+b))==0: print((y-x)//(a+b)) else: print(-1) ```
output
1
71,791
3
143,583
Provide tags and a correct Python 3 solution for this coding contest problem. Being tired of participating in too many Codeforces rounds, Gildong decided to take some rest in a park. He sat down on a bench, and soon he found two rabbits hopping around. One of the rabbits was taller than the other. He noticed that the...
instruction
0
71,792
3
143,584
Tags: math Correct Solution: ``` t = int(input()) for i in range(t): x,y,a,b = map(int, input().split()) if (y-x) % (a+b) == 0: print( int((y-x)/(a+b)) ) else: print(-1) ```
output
1
71,792
3
143,585