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. There are n robots driving along an OX axis. There are also two walls: one is at coordinate 0 and one is at coordinate m. The i-th robot starts at an integer coordinate x_i~(0 < x_i < m) and mo...
instruction
0
88,669
3
177,338
No
output
1
88,669
3
177,339
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n robots driving along an OX axis. There are also two walls: one is at coordinate 0 and one is at coordinate m. The i-th robot starts at an integer coordinate x_i~(0 < x_i < m) and mo...
instruction
0
88,670
3
177,340
No
output
1
88,670
3
177,341
Evaluate the correctness of the submitted Python 2 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n robots driving along an OX axis. There are also two walls: one is at coordinate 0 and one is at coordinate m. The i-th robot starts at an integer coordinate x_i~(0 < x_i < m) and mo...
instruction
0
88,671
3
177,342
No
output
1
88,671
3
177,343
Evaluate the correctness of the submitted Python 2 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n robots driving along an OX axis. There are also two walls: one is at coordinate 0 and one is at coordinate m. The i-th robot starts at an integer coordinate x_i~(0 < x_i < m) and mo...
instruction
0
88,672
3
177,344
No
output
1
88,672
3
177,345
Evaluate the correctness of the submitted Python 2 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n robots driving along an OX axis. There are also two walls: one is at coordinate 0 and one is at coordinate m. The i-th robot starts at an integer coordinate x_i~(0 < x_i < m) and mo...
instruction
0
88,673
3
177,346
No
output
1
88,673
3
177,347
Evaluate the correctness of the submitted Python 2 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n robots driving along an OX axis. There are also two walls: one is at coordinate 0 and one is at coordinate m. The i-th robot starts at an integer coordinate x_i~(0 < x_i < m) and mo...
instruction
0
88,674
3
177,348
No
output
1
88,674
3
177,349
Provide tags and a correct Python 3 solution for this coding contest problem. Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value. However, all Mike has is lots of identical resistors with unit resistance R0 = 1. Elements with other ...
instruction
0
88,734
3
177,468
Tags: math, number theory Correct Solution: ``` ###### ### ####### ####### ## # ##### ### ##### # # # # # # # # # # # # # ### # # # # # # # # # # # # # ### ###### ####...
output
1
88,734
3
177,469
Provide tags and a correct Python 3 solution for this coding contest problem. Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value. However, all Mike has is lots of identical resistors with unit resistance R0 = 1. Elements with other ...
instruction
0
88,735
3
177,470
Tags: math, number theory Correct Solution: ``` def sol(a,b): global ans ans+=a//b a=a%b if a==0: return 0 return sol(b,a) ans=0 a,b=map(int,input().split()) sol(max(a,b),min(a,b)) print(ans) ```
output
1
88,735
3
177,471
Provide tags and a correct Python 3 solution for this coding contest problem. Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value. However, all Mike has is lots of identical resistors with unit resistance R0 = 1. Elements with other ...
instruction
0
88,736
3
177,472
Tags: math, number theory Correct Solution: ``` a=[0]+[int(i)for i in input().split()] while a[1]*a[2]!=0: a=[a[0]+a[1]//a[2],a[2],a[1]%a[2]] print(a[0]) ```
output
1
88,736
3
177,473
Provide tags and a correct Python 3 solution for this coding contest problem. Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value. However, all Mike has is lots of identical resistors with unit resistance R0 = 1. Elements with other ...
instruction
0
88,737
3
177,474
Tags: math, number theory Correct Solution: ``` a,b=map(int,input().split()) ans=0 while a and b: ans+=a//b a,b=b,a%b print(ans) ```
output
1
88,737
3
177,475
Provide tags and a correct Python 3 solution for this coding contest problem. Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value. However, all Mike has is lots of identical resistors with unit resistance R0 = 1. Elements with other ...
instruction
0
88,738
3
177,476
Tags: math, number theory Correct Solution: ``` #!/usr/bin/env python from __future__ import division, print_function import math import os import sys from fractions import * from sys import * from decimal import * from io import BytesIO, IOBase from itertools import * from collections import * # sys.setrecursionlimit...
output
1
88,738
3
177,477
Provide tags and a correct Python 3 solution for this coding contest problem. Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value. However, all Mike has is lots of identical resistors with unit resistance R0 = 1. Elements with other ...
instruction
0
88,739
3
177,478
Tags: math, number theory Correct Solution: ``` import sys import math MAXNUM = math.inf MINNUM = -1 * math.inf def getInts(): return map(int, sys.stdin.readline().rstrip().split(" ")) def getString(): return sys.stdin.readline().rstrip() def solve(a, b): counter = 1 while a != 1 and b != 1: # a...
output
1
88,739
3
177,479
Provide tags and a correct Python 3 solution for this coding contest problem. Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value. However, all Mike has is lots of identical resistors with unit resistance R0 = 1. Elements with other ...
instruction
0
88,740
3
177,480
Tags: math, number theory Correct Solution: ``` def gcd(a,b): if b==0: return 0 return a//b+gcd(b,a%b) a,b=map(int,input().split()) print(gcd(a,b)) ```
output
1
88,740
3
177,481
Provide tags and a correct Python 3 solution for this coding contest problem. Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value. However, all Mike has is lots of identical resistors with unit resistance R0 = 1. Elements with other ...
instruction
0
88,741
3
177,482
Tags: math, number theory Correct Solution: ``` import sys import string import math import heapq from collections import defaultdict from collections import deque from collections import Counter from functools import lru_cache from fractions import Fraction def mi(s): return map(int, s.strip().split()) def lmi(s...
output
1
88,741
3
177,483
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value. However, all Mike has is lots of identical resistors wi...
instruction
0
88,742
3
177,484
Yes
output
1
88,742
3
177,485
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value. However, all Mike has is lots of identical resistors wi...
instruction
0
88,743
3
177,486
Yes
output
1
88,743
3
177,487
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value. However, all Mike has is lots of identical resistors wi...
instruction
0
88,744
3
177,488
Yes
output
1
88,744
3
177,489
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value. However, all Mike has is lots of identical resistors wi...
instruction
0
88,745
3
177,490
Yes
output
1
88,745
3
177,491
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value. However, all Mike has is lots of identical resistors wi...
instruction
0
88,746
3
177,492
No
output
1
88,746
3
177,493
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value. However, all Mike has is lots of identical resistors wi...
instruction
0
88,747
3
177,494
No
output
1
88,747
3
177,495
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value. However, all Mike has is lots of identical resistors wi...
instruction
0
88,748
3
177,496
No
output
1
88,748
3
177,497
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Mad scientist Mike is building a time machine in his spare time. To finish the work, he needs a resistor with a certain resistance value. However, all Mike has is lots of identical resistors wi...
instruction
0
88,749
3
177,498
No
output
1
88,749
3
177,499
Provide tags and a correct Python 3 solution for this coding contest problem. Andrewid the Android is a galaxy-famous detective. He is now investigating a case of frauds who make fake copies of the famous Stolp's gears, puzzles that are as famous as the Rubik's cube once was. Its most important components are a butto...
instruction
0
88,833
3
177,666
Tags: brute force, implementation Correct Solution: ``` import sys from functools import lru_cache, cmp_to_key from heapq import merge, heapify, heappop, heappush from math import * from collections import defaultdict as dd, deque, Counter as C from itertools import combinations as comb, permutations as perm from bisec...
output
1
88,833
3
177,667
Provide tags and a correct Python 3 solution for this coding contest problem. Andrewid the Android is a galaxy-famous detective. He is now investigating a case of frauds who make fake copies of the famous Stolp's gears, puzzles that are as famous as the Rubik's cube once was. Its most important components are a butto...
instruction
0
88,834
3
177,668
Tags: brute force, implementation Correct Solution: ``` n = int(input()) l = [int(i) for i in input().split()] d = (n - l[0]) % n for i in range(1, n): r = n if i & 1 == 0: if i >= l[i]: r = i - l[i] else: r = i - l[i] + n else: if i <= l[i]: r = l...
output
1
88,834
3
177,669
Provide tags and a correct Python 3 solution for this coding contest problem. Andrewid the Android is a galaxy-famous detective. He is now investigating a case of frauds who make fake copies of the famous Stolp's gears, puzzles that are as famous as the Rubik's cube once was. Its most important components are a butto...
instruction
0
88,835
3
177,670
Tags: brute force, implementation Correct Solution: ``` n = int(input()) a = list(map(int, input().split(' '))) count = n - a[0] for i in range(n): if i % 2 == 0: a[i] = (a[i] + count + n) % n else: a[i] = (a[i] - count + n) % n if a[i] != i: print("No") exit() print("Yes")...
output
1
88,835
3
177,671
Provide tags and a correct Python 3 solution for this coding contest problem. Andrewid the Android is a galaxy-famous detective. He is now investigating a case of frauds who make fake copies of the famous Stolp's gears, puzzles that are as famous as the Rubik's cube once was. Its most important components are a butto...
instruction
0
88,836
3
177,672
Tags: brute force, implementation Correct Solution: ``` n = int(input()) a = [int(x) for x in input().split()] diff = (n - a[0]) % n for i in range(1, n): if i % 2 == 0: if (a[i] + diff) % n != i: #print((a[i] - diff) % n, i) print("No") exit() else: if (a[i] ...
output
1
88,836
3
177,673
Provide tags and a correct Python 3 solution for this coding contest problem. Andrewid the Android is a galaxy-famous detective. He is now investigating a case of frauds who make fake copies of the famous Stolp's gears, puzzles that are as famous as the Rubik's cube once was. Its most important components are a butto...
instruction
0
88,837
3
177,674
Tags: brute force, implementation Correct Solution: ``` n, a, move = int(input()), list(map(int, input().split())), [] for i in range(n): if i & 1: move.append(((a[i] + 1) + (n - 1 - i)) % n) else: move.append((n - a[i] + i) % n) print('Yes' if len(set(move)) == 1 else 'NO') ```
output
1
88,837
3
177,675
Provide tags and a correct Python 3 solution for this coding contest problem. Andrewid the Android is a galaxy-famous detective. He is now investigating a case of frauds who make fake copies of the famous Stolp's gears, puzzles that are as famous as the Rubik's cube once was. Its most important components are a butto...
instruction
0
88,838
3
177,676
Tags: brute force, implementation Correct Solution: ``` from sys import stdout n = int(input()) gears = list(map(int, input().split())) targetGears = [] for i in range(0, n): targetGears.append(i) def check(): for i in range(0, n): if(gears == targetGears): stdout.write('Yes') ...
output
1
88,838
3
177,677
Provide tags and a correct Python 3 solution for this coding contest problem. Andrewid the Android is a galaxy-famous detective. He is now investigating a case of frauds who make fake copies of the famous Stolp's gears, puzzles that are as famous as the Rubik's cube once was. Its most important components are a butto...
instruction
0
88,839
3
177,678
Tags: brute force, implementation Correct Solution: ``` import functools as ft if __name__ == '__main__': n = int(input()) a = list(map(int, input().split())) b = [i for i in range(n)] for i in range(1, n + 1): a = [(a[j] + 1) % n if not j % 2 else (a[j] - 1) % n for j in range(n)] cnt...
output
1
88,839
3
177,679
Provide tags and a correct Python 3 solution for this coding contest problem. Andrewid the Android is a galaxy-famous detective. He is now investigating a case of frauds who make fake copies of the famous Stolp's gears, puzzles that are as famous as the Rubik's cube once was. Its most important components are a butto...
instruction
0
88,840
3
177,680
Tags: brute force, implementation Correct Solution: ``` n = int(input()) g = list(map(int,input().split())) left = g[0] right = n-g[0] # check left i = 0 while i<n and (g[i]+[-left,+left][i%2])%n == i: i += 1 if i == n: print ("Yes") exit() i = 0 #(g[i]-[-left,right][i%2])%n while i<n and (g[i]+[right,-...
output
1
88,840
3
177,681
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Andrewid the Android is a galaxy-famous detective. He is now investigating a case of frauds who make fake copies of the famous Stolp's gears, puzzles that are as famous as the Rubik's cube once ...
instruction
0
88,841
3
177,682
Yes
output
1
88,841
3
177,683
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Andrewid the Android is a galaxy-famous detective. He is now investigating a case of frauds who make fake copies of the famous Stolp's gears, puzzles that are as famous as the Rubik's cube once ...
instruction
0
88,842
3
177,684
Yes
output
1
88,842
3
177,685
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Andrewid the Android is a galaxy-famous detective. He is now investigating a case of frauds who make fake copies of the famous Stolp's gears, puzzles that are as famous as the Rubik's cube once ...
instruction
0
88,843
3
177,686
Yes
output
1
88,843
3
177,687
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Andrewid the Android is a galaxy-famous detective. He is now investigating a case of frauds who make fake copies of the famous Stolp's gears, puzzles that are as famous as the Rubik's cube once ...
instruction
0
88,844
3
177,688
Yes
output
1
88,844
3
177,689
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Andrewid the Android is a galaxy-famous detective. He is now investigating a case of frauds who make fake copies of the famous Stolp's gears, puzzles that are as famous as the Rubik's cube once ...
instruction
0
88,845
3
177,690
No
output
1
88,845
3
177,691
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Andrewid the Android is a galaxy-famous detective. He is now investigating a case of frauds who make fake copies of the famous Stolp's gears, puzzles that are as famous as the Rubik's cube once ...
instruction
0
88,846
3
177,692
No
output
1
88,846
3
177,693
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Andrewid the Android is a galaxy-famous detective. He is now investigating a case of frauds who make fake copies of the famous Stolp's gears, puzzles that are as famous as the Rubik's cube once ...
instruction
0
88,847
3
177,694
No
output
1
88,847
3
177,695
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Andrewid the Android is a galaxy-famous detective. He is now investigating a case of frauds who make fake copies of the famous Stolp's gears, puzzles that are as famous as the Rubik's cube once ...
instruction
0
88,848
3
177,696
No
output
1
88,848
3
177,697
Provide tags and a correct Python 3 solution for this coding contest problem. Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a plane, the i-th watchman is located at point (xi, yi). They need to arrange a plan, but t...
instruction
0
88,868
3
177,736
Tags: data structures, geometry, math Correct Solution: ``` from collections import defaultdict as dc x=int(input()) dx=dc(lambda:0) dy=dc(lambda:0) dxy=dc(lambda:0) for n in range(x): a,b=map(int,input().split()) dx[a]+=1 dy[b]+=1 dxy[(a,b)]+=1 res=0 for n in dx: res+=int(dx[n]!=1)*(dx[n]*(dx[n]-...
output
1
88,868
3
177,737
Provide tags and a correct Python 3 solution for this coding contest problem. Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a plane, the i-th watchman is located at point (xi, yi). They need to arrange a plan, but t...
instruction
0
88,869
3
177,738
Tags: data structures, geometry, math Correct Solution: ``` n = int(input()) z=n x={} y={} xy={} ans = 0 while z: a=0 b=0 a,b=input().split(" ") a=int(a) b=int(b) try: x[a]=x[a]+1 except: x[a]=1 try: y[b]=y[b]+1 except: y[b]=1 try: xy[(a,b)]=xy[(a,b)]+1 except: xy[(a,b)]=1 ans+=x[a]+y[...
output
1
88,869
3
177,739
Provide tags and a correct Python 3 solution for this coding contest problem. Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a plane, the i-th watchman is located at point (xi, yi). They need to arrange a plan, but t...
instruction
0
88,870
3
177,740
Tags: data structures, geometry, math Correct Solution: ``` n = int(input()) dict_x = {} dict_y = {} dict_xy = {} for _ in range(n): x, y = map(int, input().split()) try: dict_xy[(x, y)] += 1 except KeyError: dict_xy[(x, y)] = 1 try: dict_x[x] += 1 except KeyError: d...
output
1
88,870
3
177,741
Provide tags and a correct Python 3 solution for this coding contest problem. Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a plane, the i-th watchman is located at point (xi, yi). They need to arrange a plan, but t...
instruction
0
88,871
3
177,742
Tags: data structures, geometry, math Correct Solution: ``` from sys import stdin input = stdin.readline n = int(input()) x, y, s, ans = dict(), dict(), dict(), 0 for i in range(n): a, b = [int(i) for i in input().split()] s[(a, b)] = 1 if (a, b) not in s.keys() else s[(a, b)] + 1 x[a] = 1 if a not in x.key...
output
1
88,871
3
177,743
Provide tags and a correct Python 3 solution for this coding contest problem. Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a plane, the i-th watchman is located at point (xi, yi). They need to arrange a plan, but t...
instruction
0
88,872
3
177,744
Tags: data structures, geometry, math Correct Solution: ``` n = int(input()) Dx = dict() Dy = dict() Dxy = dict() for _ in range(n): x,y = map(int,input().split()) if x in Dx: Dx[x] += 1 else: Dx[x] = 1 if y in Dy: Dy[y] += 1 else: Dy[y] = 1 if (x,y) in Dxy: Dxy[(x,y)] += 1 else: D...
output
1
88,872
3
177,745
Provide tags and a correct Python 3 solution for this coding contest problem. Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a plane, the i-th watchman is located at point (xi, yi). They need to arrange a plan, but t...
instruction
0
88,873
3
177,746
Tags: data structures, geometry, math Correct Solution: ``` def main(): n = int(input()) xs = {} ys = {} xys = {} total = 0 for i in range(n): ab = list(map(int, input().split())) a = ab[0] b = ab[1] if a in xs: xs[a] += 1 total += xs[a] ...
output
1
88,873
3
177,747
Provide tags and a correct Python 3 solution for this coding contest problem. Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a plane, the i-th watchman is located at point (xi, yi). They need to arrange a plan, but t...
instruction
0
88,874
3
177,748
Tags: data structures, geometry, math Correct Solution: ``` x={} y={} d={} ans=0 for i in range(int(input())): a,b=map(int,input().split()) if a in x: x[a]+=1 else: x[a]=1 if b in y: y[b]+=1 else: y[b]=1 if (a,b) in d: d[(a,b)]+=1 else: d[(a,b)...
output
1
88,874
3
177,749
Provide tags and a correct Python 3 solution for this coding contest problem. Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a plane, the i-th watchman is located at point (xi, yi). They need to arrange a plan, but t...
instruction
0
88,875
3
177,750
Tags: data structures, geometry, math Correct Solution: ``` n = int(input()) arr = list() for i in range(n): x, y = map(int, input().split()) arr.append((x, y)) arr.sort() c = 0 x = 1 for i in range(n - 1): if arr[i][0] == arr[i + 1][0]: x += 1 else: c += x * (x - 1) // 2 x ...
output
1
88,875
3
177,751
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a plane, the i-th watchman is located at poin...
instruction
0
88,876
3
177,752
Yes
output
1
88,876
3
177,753
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a plane, the i-th watchman is located at poin...
instruction
0
88,877
3
177,754
Yes
output
1
88,877
3
177,755
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a plane, the i-th watchman is located at poin...
instruction
0
88,878
3
177,756
Yes
output
1
88,878
3
177,757
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a plane, the i-th watchman is located at poin...
instruction
0
88,879
3
177,758
Yes
output
1
88,879
3
177,759