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. Dreamoon is standing at the position 0 on a number line. Drazil is sending a list of commands through Wi-Fi to Dreamoon's smartphone and Dreamoon follows them. Each command is one of the following two types: 1. Go 1 unit towards the pos...
instruction
0
19,796
3
39,592
Tags: bitmasks, brute force, combinatorics, dp, math, probabilities Correct Solution: ``` MyList,Res = [0] , 0 First = input() Second = input() for i in range(len(First)): Temp = [] Res += 1 if First[i] == "+" else -1 if '?' not in First[i] + Second[i]: for P in MyList: Temp.append(P + ...
output
1
19,796
3
39,593
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Dreamoon is standing at the position 0 on a number line. Drazil is sending a list of commands through Wi-Fi to Dreamoon's smartphone and Dreamoon follows them. Each command is one of the follow...
instruction
0
19,797
3
39,594
Yes
output
1
19,797
3
39,595
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Dreamoon is standing at the position 0 on a number line. Drazil is sending a list of commands through Wi-Fi to Dreamoon's smartphone and Dreamoon follows them. Each command is one of the follow...
instruction
0
19,798
3
39,596
Yes
output
1
19,798
3
39,597
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Dreamoon is standing at the position 0 on a number line. Drazil is sending a list of commands through Wi-Fi to Dreamoon's smartphone and Dreamoon follows them. Each command is one of the follow...
instruction
0
19,799
3
39,598
Yes
output
1
19,799
3
39,599
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Dreamoon is standing at the position 0 on a number line. Drazil is sending a list of commands through Wi-Fi to Dreamoon's smartphone and Dreamoon follows them. Each command is one of the follow...
instruction
0
19,800
3
39,600
Yes
output
1
19,800
3
39,601
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Dreamoon is standing at the position 0 on a number line. Drazil is sending a list of commands through Wi-Fi to Dreamoon's smartphone and Dreamoon follows them. Each command is one of the follow...
instruction
0
19,801
3
39,602
No
output
1
19,801
3
39,603
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Dreamoon is standing at the position 0 on a number line. Drazil is sending a list of commands through Wi-Fi to Dreamoon's smartphone and Dreamoon follows them. Each command is one of the follow...
instruction
0
19,802
3
39,604
No
output
1
19,802
3
39,605
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Dreamoon is standing at the position 0 on a number line. Drazil is sending a list of commands through Wi-Fi to Dreamoon's smartphone and Dreamoon follows them. Each command is one of the follow...
instruction
0
19,803
3
39,606
No
output
1
19,803
3
39,607
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Dreamoon is standing at the position 0 on a number line. Drazil is sending a list of commands through Wi-Fi to Dreamoon's smartphone and Dreamoon follows them. Each command is one of the follow...
instruction
0
19,804
3
39,608
No
output
1
19,804
3
39,609
Provide tags and a correct Python 3 solution for this coding contest problem. Professor GukiZ makes a new robot. The robot are in the point with coordinates (x1, y1) and should go to the point (x2, y2). In a single step the robot can change any of its coordinates (maybe both of them) by one (decrease or increase). So ...
instruction
0
19,855
3
39,710
Tags: implementation, math Correct Solution: ``` x1, y1 = [int(t) for t in input().split()] x2, y2 = [int(t) for t in input().split()] dx = abs(x2 - x1) dy = abs(y2 - y1) print(max(dx, dy)) ```
output
1
19,855
3
39,711
Provide tags and a correct Python 3 solution for this coding contest problem. Professor GukiZ makes a new robot. The robot are in the point with coordinates (x1, y1) and should go to the point (x2, y2). In a single step the robot can change any of its coordinates (maybe both of them) by one (decrease or increase). So ...
instruction
0
19,860
3
39,720
Tags: implementation, math Correct Solution: ``` a,b = list(map(int, input().split())) x,y = list(map(int, input().split())) if abs(x-a) < abs(y-b): dist = abs(x-a) dist += abs(y - b) - dist else: dist = abs(y-b) dist += abs(x - a) - dist print(dist) ```
output
1
19,860
3
39,721
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Professor GukiZ makes a new robot. The robot are in the point with coordinates (x1, y1) and should go to the point (x2, y2). In a single step the robot can change any of its coordinates (maybe b...
instruction
0
19,863
3
39,726
Yes
output
1
19,863
3
39,727
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Professor GukiZ makes a new robot. The robot are in the point with coordinates (x1, y1) and should go to the point (x2, y2). In a single step the robot can change any of its coordinates (maybe b...
instruction
0
19,864
3
39,728
Yes
output
1
19,864
3
39,729
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Professor GukiZ makes a new robot. The robot are in the point with coordinates (x1, y1) and should go to the point (x2, y2). In a single step the robot can change any of its coordinates (maybe b...
instruction
0
19,865
3
39,730
Yes
output
1
19,865
3
39,731
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Professor GukiZ makes a new robot. The robot are in the point with coordinates (x1, y1) and should go to the point (x2, y2). In a single step the robot can change any of its coordinates (maybe b...
instruction
0
19,866
3
39,732
Yes
output
1
19,866
3
39,733
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Professor GukiZ makes a new robot. The robot are in the point with coordinates (x1, y1) and should go to the point (x2, y2). In a single step the robot can change any of its coordinates (maybe b...
instruction
0
19,867
3
39,734
No
output
1
19,867
3
39,735
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Professor GukiZ makes a new robot. The robot are in the point with coordinates (x1, y1) and should go to the point (x2, y2). In a single step the robot can change any of its coordinates (maybe b...
instruction
0
19,868
3
39,736
No
output
1
19,868
3
39,737
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Professor GukiZ makes a new robot. The robot are in the point with coordinates (x1, y1) and should go to the point (x2, y2). In a single step the robot can change any of its coordinates (maybe b...
instruction
0
19,869
3
39,738
No
output
1
19,869
3
39,739
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Professor GukiZ makes a new robot. The robot are in the point with coordinates (x1, y1) and should go to the point (x2, y2). In a single step the robot can change any of its coordinates (maybe b...
instruction
0
19,870
3
39,740
No
output
1
19,870
3
39,741
Provide tags and a correct Python 3 solution for this coding contest problem. Little Artem likes electronics. He can spend lots of time making different schemas and looking for novelties in the nearest electronics store. The new control element was delivered to the store recently and Artem immediately bought it. That...
instruction
0
19,872
3
39,744
Tags: implementation Correct Solution: ``` import itertools import bisect import math from collections import * import os import sys from io import BytesIO, IOBase ii = lambda: int(input()) lmii = lambda: list(map(int, input().split())) li = lambda: list(input()) mii = lambda: map(int, input().split()) msi = lambda: m...
output
1
19,872
3
39,745
Provide tags and a correct Python 3 solution for this coding contest problem. Little Artem likes electronics. He can spend lots of time making different schemas and looking for novelties in the nearest electronics store. The new control element was delivered to the store recently and Artem immediately bought it. That...
instruction
0
19,873
3
39,746
Tags: implementation Correct Solution: ``` def w(ind): global mtx, n, m box = mtx[ind][-1] for i in range(m - 1 - 1, -1, -1): mtx[ind][i + 1] = mtx[ind][i] mtx[ind][0] = box def h(ind): global mtx, n, m box = mtx[-1][ind] for i in range(n - 1 - 1, -1, -1): mtx[i + 1][ind...
output
1
19,873
3
39,747
Provide tags and a correct Python 3 solution for this coding contest problem. Little Artem likes electronics. He can spend lots of time making different schemas and looking for novelties in the nearest electronics store. The new control element was delivered to the store recently and Artem immediately bought it. That...
instruction
0
19,874
3
39,748
Tags: implementation Correct Solution: ``` n,m,q=map(int,input().split()) l=[list(map(int,input().split())) for _ in range(q)][::-1] adj=[[0]*m for _ in range(n)] for i in range(q): t=l[i] if t[0]==3: adj[t[1]-1][t[2]-1]=t[3] elif t[0]==2: j=t[1]-1 x=adj[-1][j] for i in range...
output
1
19,874
3
39,749
Provide tags and a correct Python 3 solution for this coding contest problem. Little Artem likes electronics. He can spend lots of time making different schemas and looking for novelties in the nearest electronics store. The new control element was delivered to the store recently and Artem immediately bought it. That...
instruction
0
19,875
3
39,750
Tags: implementation Correct Solution: ``` n, m, qq = map(int, input().split()) queries = [] for i in range(qq): queries.append(list(map(int, input().split()))) G = [[0] * m for i in range(n)] for q in reversed(queries): if q[0] == 1: last = G[q[1] - 1][-1] for j in range(m - 2, -1, -1): ...
output
1
19,875
3
39,751
Provide tags and a correct Python 3 solution for this coding contest problem. Little Artem likes electronics. He can spend lots of time making different schemas and looking for novelties in the nearest electronics store. The new control element was delivered to the store recently and Artem immediately bought it. That...
instruction
0
19,876
3
39,752
Tags: implementation Correct Solution: ``` nmq = input().split(' ') n, m, q = int(nmq[0]), int(nmq[1]), int(nmq[2]) mt = [] for i in range(0, n): mt.append([]) for j in range(0, m): mt[-1].append((i, j)) res = [] for i in range(0, n): res.append([]) for j in range(0, m): res[-1].append(0...
output
1
19,876
3
39,753
Provide tags and a correct Python 3 solution for this coding contest problem. Little Artem likes electronics. He can spend lots of time making different schemas and looking for novelties in the nearest electronics store. The new control element was delivered to the store recently and Artem immediately bought it. That...
instruction
0
19,877
3
39,754
Tags: implementation Correct Solution: ``` def main(): n, m, q = map(int, input().split()) nm, qq = n * m, [input() for _ in range(q)] res = ["0"] * nm for s in reversed(qq): k, *l = s.split() if k == "3": res[(int(l[0]) - 1) * m + int(l[1]) - 1] = l[2] elif k == "2":...
output
1
19,877
3
39,755
Provide tags and a correct Python 3 solution for this coding contest problem. Little Artem likes electronics. He can spend lots of time making different schemas and looking for novelties in the nearest electronics store. The new control element was delivered to the store recently and Artem immediately bought it. That...
instruction
0
19,878
3
39,756
Tags: implementation Correct Solution: ``` def C(): d = input().split(" ") n = int(d[0]) m = int(d[1]) s = int(d[2]) z = [] matr = [] for i in range(n): cur = [] for j in range(m): cur.append(0) matr.append(cur) for i in range(s): zapr = [] ...
output
1
19,878
3
39,757
Provide tags and a correct Python 3 solution for this coding contest problem. Little Artem likes electronics. He can spend lots of time making different schemas and looking for novelties in the nearest electronics store. The new control element was delivered to the store recently and Artem immediately bought it. That...
instruction
0
19,879
3
39,758
Tags: implementation Correct Solution: ``` m,n,q = map(int,input().split()) inps = [map(lambda x: int(x)-1,input().split()) for _ in range(q)] matrix = [[-1]*n for _ in range(m)] for x in reversed(inps): t,c,*cc = x if t == 0: matrix[c] = [matrix[c][-1]] + matrix[c][:-1] elif t == 1: new = [...
output
1
19,879
3
39,759
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Little Artem likes electronics. He can spend lots of time making different schemas and looking for novelties in the nearest electronics store. The new control element was delivered to the store ...
instruction
0
19,880
3
39,760
Yes
output
1
19,880
3
39,761
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Little Artem likes electronics. He can spend lots of time making different schemas and looking for novelties in the nearest electronics store. The new control element was delivered to the store ...
instruction
0
19,881
3
39,762
Yes
output
1
19,881
3
39,763
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Little Artem likes electronics. He can spend lots of time making different schemas and looking for novelties in the nearest electronics store. The new control element was delivered to the store ...
instruction
0
19,882
3
39,764
Yes
output
1
19,882
3
39,765
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Little Artem likes electronics. He can spend lots of time making different schemas and looking for novelties in the nearest electronics store. The new control element was delivered to the store ...
instruction
0
19,883
3
39,766
Yes
output
1
19,883
3
39,767
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Little Artem likes electronics. He can spend lots of time making different schemas and looking for novelties in the nearest electronics store. The new control element was delivered to the store ...
instruction
0
19,884
3
39,768
No
output
1
19,884
3
39,769
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Little Artem likes electronics. He can spend lots of time making different schemas and looking for novelties in the nearest electronics store. The new control element was delivered to the store ...
instruction
0
19,885
3
39,770
No
output
1
19,885
3
39,771
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Little Artem likes electronics. He can spend lots of time making different schemas and looking for novelties in the nearest electronics store. The new control element was delivered to the store ...
instruction
0
19,886
3
39,772
No
output
1
19,886
3
39,773
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Little Artem likes electronics. He can spend lots of time making different schemas and looking for novelties in the nearest electronics store. The new control element was delivered to the store ...
instruction
0
19,887
3
39,774
No
output
1
19,887
3
39,775
Provide tags and a correct Python 3 solution for this coding contest problem. Ghosts live in harmony and peace, they travel the space without any purpose other than scare whoever stands in their way. There are n ghosts in the universe, they move in the OXY plane, each one of them has its own velocity that does not ch...
instruction
0
20,002
3
40,004
Tags: geometry, math Correct Solution: ``` import sys import math import bisect import itertools from collections import Counter d = {} s = {} n, a, b = list(map(int,sys.stdin.readline().strip().split(' '))) for n0 in range(n): x,vxi,vyi = list(map(int,sys.stdin.readline().strip().split(' '))) curr = a*vxi - vyi if...
output
1
20,002
3
40,005
Provide tags and a correct Python 3 solution for this coding contest problem. Ghosts live in harmony and peace, they travel the space without any purpose other than scare whoever stands in their way. There are n ghosts in the universe, they move in the OXY plane, each one of them has its own velocity that does not ch...
instruction
0
20,003
3
40,006
Tags: geometry, math Correct Solution: ``` import sys import io, os input = sys.stdin.buffer.readline #input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline from collections import defaultdict n, a, b = map(int, input().split()) XV = [] for i in range(n): x, vx, vy = map(int, input().split()) XV.append(...
output
1
20,003
3
40,007
Provide tags and a correct Python 3 solution for this coding contest problem. Ghosts live in harmony and peace, they travel the space without any purpose other than scare whoever stands in their way. There are n ghosts in the universe, they move in the OXY plane, each one of them has its own velocity that does not ch...
instruction
0
20,004
3
40,008
Tags: geometry, math Correct Solution: ``` import atexit import io import sys # Buffering IO _INPUT_LINES = sys.stdin.read().splitlines() input = iter(_INPUT_LINES).__next__ _OUTPUT_BUFFER = io.StringIO() sys.stdout = _OUTPUT_BUFFER @atexit.register def write(): sys.__stdout__.write(_OUTPUT_BUFFER.getvalue()) ...
output
1
20,004
3
40,009
Provide tags and a correct Python 3 solution for this coding contest problem. Ghosts live in harmony and peace, they travel the space without any purpose other than scare whoever stands in their way. There are n ghosts in the universe, they move in the OXY plane, each one of them has its own velocity that does not ch...
instruction
0
20,005
3
40,010
Tags: geometry, math Correct Solution: ``` from collections import Counter n,a,b=[int(_) for _ in input().split()] s,s1=Counter(),Counter();ans=0 for i in range(n): x,vx,vy=[int(_) for _ in input().split()] tmp=vy-a*vx ans+=s[tmp]-s1[(vx,vy)] s[tmp]+=1 s1[(vx,vy)]+=1 print(ans*2) ```
output
1
20,005
3
40,011
Provide tags and a correct Python 3 solution for this coding contest problem. Ghosts live in harmony and peace, they travel the space without any purpose other than scare whoever stands in their way. There are n ghosts in the universe, they move in the OXY plane, each one of them has its own velocity that does not ch...
instruction
0
20,006
3
40,012
Tags: geometry, math Correct Solution: ``` # ---------------------------iye ha aam zindegi--------------------------------------------- import math import random import heapq, bisect import sys from collections import deque, defaultdict from fractions import Fraction import sys #import threading from collections import...
output
1
20,006
3
40,013
Provide tags and a correct Python 3 solution for this coding contest problem. Ghosts live in harmony and peace, they travel the space without any purpose other than scare whoever stands in their way. There are n ghosts in the universe, they move in the OXY plane, each one of them has its own velocity that does not ch...
instruction
0
20,007
3
40,014
Tags: geometry, math Correct Solution: ``` from collections import Counter from sys import stdin n,a,b=[int(_) for _ in stdin.buffer.readline().split()] s,s1=Counter(),Counter();ans=0 for i in range(n): x,vx,vy=[int(_) for _ in stdin.buffer.readline().split()] tmp=vy-a*vx ans+=s[tmp]-s[(vx,vy)]-s1[(tmp,x)]+s1[(tmp,x...
output
1
20,007
3
40,015
Provide tags and a correct Python 3 solution for this coding contest problem. Ghosts live in harmony and peace, they travel the space without any purpose other than scare whoever stands in their way. There are n ghosts in the universe, they move in the OXY plane, each one of them has its own velocity that does not ch...
instruction
0
20,008
3
40,016
Tags: geometry, math Correct Solution: ``` from collections import Counter import sys n,a,b = list(map(int,sys.stdin.readline().split())) c = Counter() d = Counter() ans = 0 for i in range(n): x,vx,vy = list(map(int,sys.stdin.readline().split())) tmp = vy - a*vx ans += c[tmp] - c[(vx,vy)] - d[(tmp,x)] + d[(...
output
1
20,008
3
40,017
Provide tags and a correct Python 3 solution for this coding contest problem. Ghosts live in harmony and peace, they travel the space without any purpose other than scare whoever stands in their way. There are n ghosts in the universe, they move in the OXY plane, each one of them has its own velocity that does not ch...
instruction
0
20,009
3
40,018
Tags: geometry, math Correct Solution: ``` from collections import Counter import sys n,a,b = list(map(int,sys.stdin.readline().split())) c = Counter(); d = Counter() ans = 0 for i in range(n): x,vx,vy = list(map(int,sys.stdin.readline().split())) tmp = vy - a*vx ans += c[tmp] - c[(vx,vy)] - d[(tmp,x)] + d[...
output
1
20,009
3
40,019
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ghosts live in harmony and peace, they travel the space without any purpose other than scare whoever stands in their way. There are n ghosts in the universe, they move in the OXY plane, each on...
instruction
0
20,010
3
40,020
Yes
output
1
20,010
3
40,021
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ghosts live in harmony and peace, they travel the space without any purpose other than scare whoever stands in their way. There are n ghosts in the universe, they move in the OXY plane, each on...
instruction
0
20,011
3
40,022
Yes
output
1
20,011
3
40,023
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ghosts live in harmony and peace, they travel the space without any purpose other than scare whoever stands in their way. There are n ghosts in the universe, they move in the OXY plane, each on...
instruction
0
20,012
3
40,024
Yes
output
1
20,012
3
40,025
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ghosts live in harmony and peace, they travel the space without any purpose other than scare whoever stands in their way. There are n ghosts in the universe, they move in the OXY plane, each on...
instruction
0
20,013
3
40,026
Yes
output
1
20,013
3
40,027
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ghosts live in harmony and peace, they travel the space without any purpose other than scare whoever stands in their way. There are n ghosts in the universe, they move in the OXY plane, each on...
instruction
0
20,014
3
40,028
No
output
1
20,014
3
40,029
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ghosts live in harmony and peace, they travel the space without any purpose other than scare whoever stands in their way. There are n ghosts in the universe, they move in the OXY plane, each on...
instruction
0
20,015
3
40,030
No
output
1
20,015
3
40,031
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ghosts live in harmony and peace, they travel the space without any purpose other than scare whoever stands in their way. There are n ghosts in the universe, they move in the OXY plane, each on...
instruction
0
20,016
3
40,032
No
output
1
20,016
3
40,033