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
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,793
3
143,586
Tags: math Correct Solution: ``` def main(): for _ in range(int(input())): x1, x2, a, b = map(int,input().split()) print((x2 - x1) // (a + b) if (x2 - x1) % (a + b) == 0 else -1) main() ```
output
1
71,793
3
143,587
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,794
3
143,588
Tags: math Correct Solution: ``` for _ in range(int(input())): s, e, a, b = [int(x) for x in input().split()] distance = e - s perunit = a + b time, rest = divmod(distance, perunit) if rest == 0: print(time) else: print(-1) ```
output
1
71,794
3
143,589
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,795
3
143,590
Tags: math Correct Solution: ``` n = int(input()) for ii in range(n): x, y, a, b = map(int, input().split()) x = y - x a = a + b print((x//a,-1)[x%a>0]) ```
output
1
71,795
3
143,591
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,796
3
143,592
Tags: math Correct Solution: ``` T=int(input()) while T>0: x,y,a,b=map(int,input().split()) if (y-x)%(a+b)==0: print((y-x)//(a+b)) else: print(-1) T-=1 ```
output
1
71,796
3
143,593
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. 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 ...
instruction
0
71,797
3
143,594
Yes
output
1
71,797
3
143,595
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. 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 ...
instruction
0
71,798
3
143,596
Yes
output
1
71,798
3
143,597
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. 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 ...
instruction
0
71,799
3
143,598
Yes
output
1
71,799
3
143,599
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. 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 ...
instruction
0
71,800
3
143,600
Yes
output
1
71,800
3
143,601
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. 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 ...
instruction
0
71,801
3
143,602
No
output
1
71,801
3
143,603
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. 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 ...
instruction
0
71,802
3
143,604
No
output
1
71,802
3
143,605
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. 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 ...
instruction
0
71,803
3
143,606
No
output
1
71,803
3
143,607
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. 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 ...
instruction
0
71,804
3
143,608
No
output
1
71,804
3
143,609
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are standing on the OX-axis at point 0 and you want to move to an integer point x > 0. You can make several jumps. Suppose you're currently at point y (y may be negative) and jump for the k...
instruction
0
71,862
3
143,724
Yes
output
1
71,862
3
143,725
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are standing on the OX-axis at point 0 and you want to move to an integer point x > 0. You can make several jumps. Suppose you're currently at point y (y may be negative) and jump for the k...
instruction
0
71,863
3
143,726
Yes
output
1
71,863
3
143,727
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are standing on the OX-axis at point 0 and you want to move to an integer point x > 0. You can make several jumps. Suppose you're currently at point y (y may be negative) and jump for the k...
instruction
0
71,864
3
143,728
Yes
output
1
71,864
3
143,729
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are standing on the OX-axis at point 0 and you want to move to an integer point x > 0. You can make several jumps. Suppose you're currently at point y (y may be negative) and jump for the k...
instruction
0
71,865
3
143,730
Yes
output
1
71,865
3
143,731
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are standing on the OX-axis at point 0 and you want to move to an integer point x > 0. You can make several jumps. Suppose you're currently at point y (y may be negative) and jump for the k...
instruction
0
71,866
3
143,732
No
output
1
71,866
3
143,733
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are standing on the OX-axis at point 0 and you want to move to an integer point x > 0. You can make several jumps. Suppose you're currently at point y (y may be negative) and jump for the k...
instruction
0
71,867
3
143,734
No
output
1
71,867
3
143,735
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are standing on the OX-axis at point 0 and you want to move to an integer point x > 0. You can make several jumps. Suppose you're currently at point y (y may be negative) and jump for the k...
instruction
0
71,868
3
143,736
No
output
1
71,868
3
143,737
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are standing on the OX-axis at point 0 and you want to move to an integer point x > 0. You can make several jumps. Suppose you're currently at point y (y may be negative) and jump for the k...
instruction
0
71,869
3
143,738
No
output
1
71,869
3
143,739
Provide tags and a correct Python 3 solution for this coding contest problem. In a Berland's zoo there is an enclosure with camels. It is known that camels like to spit. Bob watched these interesting animals for the whole day and registered in his notepad where each animal spitted. Now he wants to know if in the zoo t...
instruction
0
71,967
3
143,934
Tags: brute force Correct Solution: ``` n=int(input()) l=0 a={} for i in range(n): x,y=map(int,input().split()) a[x]=x+y for j in a: try: if j==a[a[j]]: print("YES") break else: l+=1 except: l+=1 continue if l==len(a): print("NO") `...
output
1
71,967
3
143,935
Provide tags and a correct Python 3 solution for this coding contest problem. In a Berland's zoo there is an enclosure with camels. It is known that camels like to spit. Bob watched these interesting animals for the whole day and registered in his notepad where each animal spitted. Now he wants to know if in the zoo t...
instruction
0
71,968
3
143,936
Tags: brute force Correct Solution: ``` def solve(): n = int(input()) camels = {} for i in range(n): x, d = [int(s) for s in input().split(' ')] camels[x] = d for c in camels: y = c + camels[c] if y in camels and camels[y] == -camels[c]: return "YES" retur...
output
1
71,968
3
143,937
Provide tags and a correct Python 3 solution for this coding contest problem. In a Berland's zoo there is an enclosure with camels. It is known that camels like to spit. Bob watched these interesting animals for the whole day and registered in his notepad where each animal spitted. Now he wants to know if in the zoo t...
instruction
0
71,969
3
143,938
Tags: brute force Correct Solution: ``` import sys import math #to read string get_string = lambda: sys.stdin.readline().strip() #to read list of integers get_int_list = lambda: list( map(int,sys.stdin.readline().strip().split()) ) #to read integers get_int = lambda: int(sys.stdin.readline()) #to print fast pt = lambd...
output
1
71,969
3
143,939
Provide tags and a correct Python 3 solution for this coding contest problem. In a Berland's zoo there is an enclosure with camels. It is known that camels like to spit. Bob watched these interesting animals for the whole day and registered in his notepad where each animal spitted. Now he wants to know if in the zoo t...
instruction
0
71,970
3
143,940
Tags: brute force Correct Solution: ``` n = int(input()) Distancias = [0]*n Posiciones = [0]*n for k in range (n): L = input() L = L.split() P = int(L[0]) d = int(L[1]) Distancias[k]=P+d Posiciones[k]=P Aux = 0 for k in range (n): for i in range (n): if Posiciones[k]==Distancias[i]: ...
output
1
71,970
3
143,941
Provide tags and a correct Python 3 solution for this coding contest problem. In a Berland's zoo there is an enclosure with camels. It is known that camels like to spit. Bob watched these interesting animals for the whole day and registered in his notepad where each animal spitted. Now he wants to know if in the zoo t...
instruction
0
71,971
3
143,942
Tags: brute force Correct Solution: ``` n = int(input()) x = [0]*n d = [0]*n for i in range(n): x[i],d[i] = map(int,input().split()) for i in range(n): if x[i] + d[i] in x and d[x.index(x[i] + d[i])] + x[i] + d[i] == x[i]: print("YES"); exit() print("NO") ```
output
1
71,971
3
143,943
Provide tags and a correct Python 3 solution for this coding contest problem. In a Berland's zoo there is an enclosure with camels. It is known that camels like to spit. Bob watched these interesting animals for the whole day and registered in his notepad where each animal spitted. Now he wants to know if in the zoo t...
instruction
0
71,972
3
143,944
Tags: brute force Correct Solution: ``` n = int(input()) cont, ans = {}, 'NO' for i in range(n): pos, spit = [int(item) for item in input().split(' ')] cont[pos] = spit for pos in cont: secondCamel = pos + cont[pos] if secondCamel in cont and secondCamel + cont[secondCamel] == pos: ans = 'YES'...
output
1
71,972
3
143,945
Provide tags and a correct Python 3 solution for this coding contest problem. In a Berland's zoo there is an enclosure with camels. It is known that camels like to spit. Bob watched these interesting animals for the whole day and registered in his notepad where each animal spitted. Now he wants to know if in the zoo t...
instruction
0
71,973
3
143,946
Tags: brute force Correct Solution: ``` n = int(input()) x = [0]*n d = [0]*n for i in range(n): xi, di = map(int,input().split()) x[i] = xi d[i] = di for i in range(n): for j in range(i+1,n): if x[i] + d[i] == x[j] and x[j] + d[j] == x[i]: print("YES") exit() print("NO") ...
output
1
71,973
3
143,947
Provide tags and a correct Python 3 solution for this coding contest problem. In a Berland's zoo there is an enclosure with camels. It is known that camels like to spit. Bob watched these interesting animals for the whole day and registered in his notepad where each animal spitted. Now he wants to know if in the zoo t...
instruction
0
71,974
3
143,948
Tags: brute force Correct Solution: ``` v=[] v1=[] s=0 for i in range(int(input())): x,d=map(int,input().split()) v.append(x) v1.append(d) for x in range(len(v)): for y in range(x+1,len(v)): if v[x]+v1[x] == v[y] and v[y]+v1[y] == v[x]: print('YES') s=1 break...
output
1
71,974
3
143,949
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In a Berland's zoo there is an enclosure with camels. It is known that camels like to spit. Bob watched these interesting animals for the whole day and registered in his notepad where each anima...
instruction
0
71,975
3
143,950
Yes
output
1
71,975
3
143,951
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In a Berland's zoo there is an enclosure with camels. It is known that camels like to spit. Bob watched these interesting animals for the whole day and registered in his notepad where each anima...
instruction
0
71,976
3
143,952
Yes
output
1
71,976
3
143,953
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In a Berland's zoo there is an enclosure with camels. It is known that camels like to spit. Bob watched these interesting animals for the whole day and registered in his notepad where each anima...
instruction
0
71,977
3
143,954
Yes
output
1
71,977
3
143,955
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In a Berland's zoo there is an enclosure with camels. It is known that camels like to spit. Bob watched these interesting animals for the whole day and registered in his notepad where each anima...
instruction
0
71,978
3
143,956
Yes
output
1
71,978
3
143,957
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In a Berland's zoo there is an enclosure with camels. It is known that camels like to spit. Bob watched these interesting animals for the whole day and registered in his notepad where each anima...
instruction
0
71,979
3
143,958
No
output
1
71,979
3
143,959
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In a Berland's zoo there is an enclosure with camels. It is known that camels like to spit. Bob watched these interesting animals for the whole day and registered in his notepad where each anima...
instruction
0
71,980
3
143,960
No
output
1
71,980
3
143,961
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In a Berland's zoo there is an enclosure with camels. It is known that camels like to spit. Bob watched these interesting animals for the whole day and registered in his notepad where each anima...
instruction
0
71,981
3
143,962
No
output
1
71,981
3
143,963
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In a Berland's zoo there is an enclosure with camels. It is known that camels like to spit. Bob watched these interesting animals for the whole day and registered in his notepad where each anima...
instruction
0
71,982
3
143,964
No
output
1
71,982
3
143,965
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n beacons located at distinct positions on a number line. The i-th beacon has position ai and power level bi. When the i-th beacon is activated, it destroys all beacons to its left (di...
instruction
0
72,092
3
144,184
Yes
output
1
72,092
3
144,185
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Tyndex is again well ahead of the rivals! The reaction to the release of Zoozle Chrome browser was the release of a new browser Tyndex.Brome! The popularity of the new browser is growing daily....
instruction
0
72,104
3
144,208
No
output
1
72,104
3
144,209
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In the year 2168, AtCoder Inc., which is much larger than now, is starting a limited express train service called AtCoder Express. In the plan developed by the president Takahashi, the trains w...
instruction
0
72,376
3
144,752
Yes
output
1
72,376
3
144,753
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In the year 2168, AtCoder Inc., which is much larger than now, is starting a limited express train service called AtCoder Express. In the plan developed by the president Takahashi, the trains w...
instruction
0
72,377
3
144,754
Yes
output
1
72,377
3
144,755
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In the year 2168, AtCoder Inc., which is much larger than now, is starting a limited express train service called AtCoder Express. In the plan developed by the president Takahashi, the trains w...
instruction
0
72,378
3
144,756
Yes
output
1
72,378
3
144,757
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In the year 2168, AtCoder Inc., which is much larger than now, is starting a limited express train service called AtCoder Express. In the plan developed by the president Takahashi, the trains w...
instruction
0
72,379
3
144,758
Yes
output
1
72,379
3
144,759
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In the year 2168, AtCoder Inc., which is much larger than now, is starting a limited express train service called AtCoder Express. In the plan developed by the president Takahashi, the trains w...
instruction
0
72,380
3
144,760
No
output
1
72,380
3
144,761
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In the year 2168, AtCoder Inc., which is much larger than now, is starting a limited express train service called AtCoder Express. In the plan developed by the president Takahashi, the trains w...
instruction
0
72,381
3
144,762
No
output
1
72,381
3
144,763
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In the year 2168, AtCoder Inc., which is much larger than now, is starting a limited express train service called AtCoder Express. In the plan developed by the president Takahashi, the trains w...
instruction
0
72,383
3
144,766
No
output
1
72,383
3
144,767
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. problem Mobiles are widely known as moving works of art. The IOI Japan Committee has decided to create mobiles to publicize JOI. JOI public relations mobiles are sticks, strings, and weights. I...
instruction
0
72,440
3
144,880
No
output
1
72,440
3
144,881
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. problem Mobiles are widely known as moving works of art. The IOI Japan Committee has decided to create mobiles to publicize JOI. JOI public relations mobiles are sticks, strings, and weights. I...
instruction
0
72,441
3
144,882
No
output
1
72,441
3
144,883
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. problem Mobiles are widely known as moving works of art. The IOI Japan Committee has decided to create mobiles to publicize JOI. JOI public relations mobiles are sticks, strings, and weights. I...
instruction
0
72,442
3
144,884
No
output
1
72,442
3
144,885
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. problem Mobiles are widely known as moving works of art. The IOI Japan Committee has decided to create mobiles to publicize JOI. JOI public relations mobiles are sticks, strings, and weights. I...
instruction
0
72,443
3
144,886
No
output
1
72,443
3
144,887
Provide tags and a correct Python 3 solution for this coding contest problem. Innopolis University scientists continue to investigate the periodic table. There are n·m known elements and they form a periodic table: a rectangle with n rows and m columns. Each element can be described by its coordinates (r, c) (1 ≤ r ≤ ...
instruction
0
72,479
3
144,958
Tags: constructive algorithms, dfs and similar, dsu, graphs, matrices Correct Solution: ``` from collections import deque import os from io import BytesIO input = BytesIO(os.read(0, os.fstat(0).st_size)).readline def main(): n,m,q = map(int,input().split()) mn = m + n cr = [[] for i in range(mn)] ca ...
output
1
72,479
3
144,959