message
stringlengths
2
44.5k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
276
109k
cluster
float64
23
23
__index_level_0__
int64
552
217k
Provide tags and a correct Python 3 solution for this coding contest problem. Vasily the bear has a favorite rectangle, it has one vertex at point (0, 0), and the opposite vertex at point (x, y). Of course, the sides of Vasya's favorite rectangle are parallel to the coordinate axes. Vasya also loves triangles, if th...
instruction
0
55,917
23
111,834
Tags: implementation, math Correct Solution: ``` import sys, os.path if(os.path.exists('in_py.txt')): sys.stdin = open("in_py.txt","r") sys.stdout = open("out_py.txt","w") def get_ints(): return map(int, sys.stdin.readline().strip().split()) n=1 x,y=get_ints() x2=y2=x3=y3=0 while(n>0): n=n-1 if(x>0 and ...
output
1
55,917
23
111,835
Provide tags and a correct Python 3 solution for this coding contest problem. Vasily the bear has a favorite rectangle, it has one vertex at point (0, 0), and the opposite vertex at point (x, y). Of course, the sides of Vasya's favorite rectangle are parallel to the coordinate axes. Vasya also loves triangles, if th...
instruction
0
55,918
23
111,836
Tags: implementation, math Correct Solution: ``` x,y=[int(x) for x in input().split(' ')] if(x>0 and y>0): print(0,x+y,x+y,0) elif(x<0 and y>0): print(x-y,0,0,y-x) elif(x>0 and y<0): print(0,y-x,x-y,0) else: print(x+y,0,0,x+y) ```
output
1
55,918
23
111,837
Provide tags and a correct Python 3 solution for this coding contest problem. Vasily the bear has a favorite rectangle, it has one vertex at point (0, 0), and the opposite vertex at point (x, y). Of course, the sides of Vasya's favorite rectangle are parallel to the coordinate axes. Vasya also loves triangles, if th...
instruction
0
55,919
23
111,838
Tags: implementation, math Correct Solution: ``` x,y = [int(i) for i in input().split()] b = abs(y) if(x>0 and y>0): print(0,x+b,x+b,0) elif(x>0 and y<0): print(0,-x-b,x+b,0) elif(x<0 and y>0): print(x-b,0,0,abs(x)+b) elif(x<0 and y<0): print(y+x,0,0,y+x) ```
output
1
55,919
23
111,839
Provide tags and a correct Python 3 solution for this coding contest problem. Vasily the bear has a favorite rectangle, it has one vertex at point (0, 0), and the opposite vertex at point (x, y). Of course, the sides of Vasya's favorite rectangle are parallel to the coordinate axes. Vasya also loves triangles, if th...
instruction
0
55,920
23
111,840
Tags: implementation, math Correct Solution: ``` arr = input().split() a = int(arr[0]) b = int(arr[1]) l = abs(a) + abs(b) if a >= 0: x = l else: x = -1*l if b >= 0: y = l else: y = -1*l if x > 0: print('0 ' + str(y) + ' ' + str(x) + ' 0') else: print(str(x) + ' 0 0 ' + str(y) ) ```
output
1
55,920
23
111,841
Provide tags and a correct Python 3 solution for this coding contest problem. Vasily the bear has a favorite rectangle, it has one vertex at point (0, 0), and the opposite vertex at point (x, y). Of course, the sides of Vasya's favorite rectangle are parallel to the coordinate axes. Vasya also loves triangles, if th...
instruction
0
55,921
23
111,842
Tags: implementation, math Correct Solution: ``` def sgn(n): if n>0: return 1 return -1 x,y=map(int,input().split()) v=abs(x)+abs(y) l=[[v*sgn(x),0],[0,v*sgn(y)]] if l[0][0]>l[1][0]: l[0],l[1]=l[1],l[0] for x in l: print(*x,end=' ') ```
output
1
55,921
23
111,843
Provide tags and a correct Python 3 solution for this coding contest problem. Vasily the bear has a favorite rectangle, it has one vertex at point (0, 0), and the opposite vertex at point (x, y). Of course, the sides of Vasya's favorite rectangle are parallel to the coordinate axes. Vasya also loves triangles, if th...
instruction
0
55,922
23
111,844
Tags: implementation, math Correct Solution: ``` x, y = [int(i) for i in input().split()] sign = lambda n: n // abs(n) x1 = (abs(x) + abs(y)) * sign(x) y1 = (abs(x) + abs(y)) * sign(y) if x1 < 0: print(x1, 0, 0, y1) else: print(0, y1, x1, 0) ```
output
1
55,922
23
111,845
Provide tags and a correct Python 3 solution for this coding contest problem. Vasily the bear has a favorite rectangle, it has one vertex at point (0, 0), and the opposite vertex at point (x, y). Of course, the sides of Vasya's favorite rectangle are parallel to the coordinate axes. Vasya also loves triangles, if th...
instruction
0
55,923
23
111,846
Tags: implementation, math Correct Solution: ``` p=input().split() x=int(p[0]) y=int(p[1]) if x>0 and y>0: a=0 b=x+y c=x+y d=0 elif x<0 and y>0: a=x-y b=0 c=0 d=y-x elif x<0 and y<0: a=x+y b=0 c=0 d=x+y elif x>0 and y<0: a=0 b=y-x c=x-y d=0 ...
output
1
55,923
23
111,847
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasily the bear has a favorite rectangle, it has one vertex at point (0, 0), and the opposite vertex at point (x, y). Of course, the sides of Vasya's favorite rectangle are parallel to the coord...
instruction
0
55,924
23
111,848
Yes
output
1
55,924
23
111,849
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasily the bear has a favorite rectangle, it has one vertex at point (0, 0), and the opposite vertex at point (x, y). Of course, the sides of Vasya's favorite rectangle are parallel to the coord...
instruction
0
55,925
23
111,850
Yes
output
1
55,925
23
111,851
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasily the bear has a favorite rectangle, it has one vertex at point (0, 0), and the opposite vertex at point (x, y). Of course, the sides of Vasya's favorite rectangle are parallel to the coord...
instruction
0
55,926
23
111,852
Yes
output
1
55,926
23
111,853
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasily the bear has a favorite rectangle, it has one vertex at point (0, 0), and the opposite vertex at point (x, y). Of course, the sides of Vasya's favorite rectangle are parallel to the coord...
instruction
0
55,927
23
111,854
Yes
output
1
55,927
23
111,855
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasily the bear has a favorite rectangle, it has one vertex at point (0, 0), and the opposite vertex at point (x, y). Of course, the sides of Vasya's favorite rectangle are parallel to the coord...
instruction
0
55,928
23
111,856
No
output
1
55,928
23
111,857
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasily the bear has a favorite rectangle, it has one vertex at point (0, 0), and the opposite vertex at point (x, y). Of course, the sides of Vasya's favorite rectangle are parallel to the coord...
instruction
0
55,929
23
111,858
No
output
1
55,929
23
111,859
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasily the bear has a favorite rectangle, it has one vertex at point (0, 0), and the opposite vertex at point (x, y). Of course, the sides of Vasya's favorite rectangle are parallel to the coord...
instruction
0
55,930
23
111,860
No
output
1
55,930
23
111,861
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasily the bear has a favorite rectangle, it has one vertex at point (0, 0), and the opposite vertex at point (x, y). Of course, the sides of Vasya's favorite rectangle are parallel to the coord...
instruction
0
55,931
23
111,862
No
output
1
55,931
23
111,863
Provide tags and a correct Python 3 solution for this coding contest problem. Iahub isn't well prepared on geometry problems, but he heard that this year there will be a lot of geometry problems on the IOI selection camp. Scared, Iahub locked himself in the basement and started thinking of new problems of this kind. O...
instruction
0
55,964
23
111,928
Tags: constructive algorithms, sortings Correct Solution: ``` n, m = map(int, input().split()) a = [int(i) for i in input().split()] b = sorted([[a[i], i] for i in range(n)]) for i in range(m): l, r = map(int, input().split()) for i in range(n): a[b[i][1]] = str(i%2) print(' '.join(a)) ```
output
1
55,964
23
111,929
Provide tags and a correct Python 3 solution for this coding contest problem. Iahub isn't well prepared on geometry problems, but he heard that this year there will be a lot of geometry problems on the IOI selection camp. Scared, Iahub locked himself in the basement and started thinking of new problems of this kind. O...
instruction
0
55,965
23
111,930
Tags: constructive algorithms, sortings Correct Solution: ``` input() P=list(map(int,input().split())) for a,b in sorted([[P.index(p),i%2]for i,p in enumerate(sorted(P))]):print(b) ```
output
1
55,965
23
111,931
Provide tags and a correct Python 3 solution for this coding contest problem. Iahub isn't well prepared on geometry problems, but he heard that this year there will be a lot of geometry problems on the IOI selection camp. Scared, Iahub locked himself in the basement and started thinking of new problems of this kind. O...
instruction
0
55,966
23
111,932
Tags: constructive algorithms, sortings Correct Solution: ``` n, m = map(int, input().split()) arr = list(map(int, input().split())) for i in range(n): arr[i] = (arr[i], i) arr.sort() res = [0] * n for i in range(n): res[arr[i][1]] = i % 2 print(*res) ```
output
1
55,966
23
111,933
Provide tags and a correct Python 3 solution for this coding contest problem. Iahub isn't well prepared on geometry problems, but he heard that this year there will be a lot of geometry problems on the IOI selection camp. Scared, Iahub locked himself in the basement and started thinking of new problems of this kind. O...
instruction
0
55,967
23
111,934
Tags: constructive algorithms, sortings Correct Solution: ``` import operator as a input() l = sorted([[p,i,0] for i,p in enumerate (map(int,input().split()))]) for i in range(len(l)):l[i][2]=i%2 l.sort(key=a.itemgetter(1)) print(' '.join ([str(ll[2]) for ll in l])) ```
output
1
55,967
23
111,935
Provide tags and a correct Python 3 solution for this coding contest problem. Iahub isn't well prepared on geometry problems, but he heard that this year there will be a lot of geometry problems on the IOI selection camp. Scared, Iahub locked himself in the basement and started thinking of new problems of this kind. O...
instruction
0
55,968
23
111,936
Tags: constructive algorithms, sortings Correct Solution: ``` n, m = map(int, input().split()) points = list(map(int, input().split())) segments = [input().split() for _ in range(m)] sorted_points = sorted(points) ans = [-1] * n for i in range(n): c = '0' if i % 2 else '1' ans[points.index(sorted_points[i])] =...
output
1
55,968
23
111,937
Provide tags and a correct Python 3 solution for this coding contest problem. Iahub isn't well prepared on geometry problems, but he heard that this year there will be a lot of geometry problems on the IOI selection camp. Scared, Iahub locked himself in the basement and started thinking of new problems of this kind. O...
instruction
0
55,969
23
111,938
Tags: constructive algorithms, sortings Correct Solution: ``` from operator import * R = lambda: map(int, input().split()) n, m = R() x = sorted(enumerate(R()), key=itemgetter(1)) y = [0] * n for i in range(n): y[x[i][0]] = i % 2 print(' '.join(map(str, y))) ```
output
1
55,969
23
111,939
Provide tags and a correct Python 3 solution for this coding contest problem. Iahub isn't well prepared on geometry problems, but he heard that this year there will be a lot of geometry problems on the IOI selection camp. Scared, Iahub locked himself in the basement and started thinking of new problems of this kind. O...
instruction
0
55,970
23
111,940
Tags: constructive algorithms, sortings Correct Solution: ``` import sys import math import random n, m = map(int, input().split()) a = list(map(int, input().split())) b = sorted(a) for i in range(len(a)): for j in range(len(b)): if a[i] == b[j]: if j % 2 == 0: print('1 ', end =...
output
1
55,970
23
111,941
Provide tags and a correct Python 3 solution for this coding contest problem. Iahub isn't well prepared on geometry problems, but he heard that this year there will be a lot of geometry problems on the IOI selection camp. Scared, Iahub locked himself in the basement and started thinking of new problems of this kind. O...
instruction
0
55,971
23
111,942
Tags: constructive algorithms, sortings Correct Solution: ``` n,m=list(map(int,input().split())) points = [(v,i) for i,v in enumerate(map(int,input().split()))] for _ in range(m): input() blue=True ans=[0]*n points = sorted(points) for p in points: v,i = p ans[i] = int(blue) blue=not blue for v in ans: ...
output
1
55,971
23
111,943
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Iahub isn't well prepared on geometry problems, but he heard that this year there will be a lot of geometry problems on the IOI selection camp. Scared, Iahub locked himself in the basement and s...
instruction
0
55,972
23
111,944
Yes
output
1
55,972
23
111,945
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Iahub isn't well prepared on geometry problems, but he heard that this year there will be a lot of geometry problems on the IOI selection camp. Scared, Iahub locked himself in the basement and s...
instruction
0
55,973
23
111,946
Yes
output
1
55,973
23
111,947
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Iahub isn't well prepared on geometry problems, but he heard that this year there will be a lot of geometry problems on the IOI selection camp. Scared, Iahub locked himself in the basement and s...
instruction
0
55,974
23
111,948
Yes
output
1
55,974
23
111,949
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Iahub isn't well prepared on geometry problems, but he heard that this year there will be a lot of geometry problems on the IOI selection camp. Scared, Iahub locked himself in the basement and s...
instruction
0
55,975
23
111,950
Yes
output
1
55,975
23
111,951
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Iahub isn't well prepared on geometry problems, but he heard that this year there will be a lot of geometry problems on the IOI selection camp. Scared, Iahub locked himself in the basement and s...
instruction
0
55,976
23
111,952
No
output
1
55,976
23
111,953
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Iahub isn't well prepared on geometry problems, but he heard that this year there will be a lot of geometry problems on the IOI selection camp. Scared, Iahub locked himself in the basement and s...
instruction
0
55,977
23
111,954
No
output
1
55,977
23
111,955
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Iahub isn't well prepared on geometry problems, but he heard that this year there will be a lot of geometry problems on the IOI selection camp. Scared, Iahub locked himself in the basement and s...
instruction
0
55,978
23
111,956
No
output
1
55,978
23
111,957
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Iahub isn't well prepared on geometry problems, but he heard that this year there will be a lot of geometry problems on the IOI selection camp. Scared, Iahub locked himself in the basement and s...
instruction
0
55,979
23
111,958
No
output
1
55,979
23
111,959
Provide tags and a correct Python 3 solution for this coding contest problem. Berlanders like to eat cones after a hard day. Misha Square and Sasha Circle are local authorities of Berland. Each of them controls its points of cone trade. Misha has n points, Sasha β€” m. Since their subordinates constantly had conflicts w...
instruction
0
56,032
23
112,064
Tags: geometry, math Correct Solution: ``` nm = input() nOm = nm.split() n = int(nOm[0]) m = int(nOm[1]) a = b = [] for i in range(0, n): a.append(input()) for i in range(0, m): b.append(input()) if(n == 2 and m == 2 and a[0] == '-1 0') or (n == 2 and m == 3 and a[0] == '-1 0') or (n == 3 and m == 3 and a[0] == '-...
output
1
56,032
23
112,065
Provide tags and a correct Python 3 solution for this coding contest problem. <image> As some of you know, cubism is a trend in art, where the problem of constructing volumetrical shape on a plane with a combination of three-dimensional geometric shapes comes to the fore. A famous sculptor Cicasso, whose self-portr...
instruction
0
56,053
23
112,106
Tags: constructive algorithms, geometry Correct Solution: ``` n=int(input()) l=list(map(int,input().split())) p=max(l) sum=0 for i in l: sum+=i print(2*p-sum+1) ```
output
1
56,053
23
112,107
Provide tags and a correct Python 3 solution for this coding contest problem. <image> As some of you know, cubism is a trend in art, where the problem of constructing volumetrical shape on a plane with a combination of three-dimensional geometric shapes comes to the fore. A famous sculptor Cicasso, whose self-portr...
instruction
0
56,054
23
112,108
Tags: constructive algorithms, geometry Correct Solution: ``` n = int(input()) l = list(map(int,input().split())) l.sort(reverse=True) total = sum(l) answer = 2*l[0] - total +1 print(answer) ```
output
1
56,054
23
112,109
Provide tags and a correct Python 3 solution for this coding contest problem. <image> As some of you know, cubism is a trend in art, where the problem of constructing volumetrical shape on a plane with a combination of three-dimensional geometric shapes comes to the fore. A famous sculptor Cicasso, whose self-portr...
instruction
0
56,055
23
112,110
Tags: constructive algorithms, geometry Correct Solution: ``` n = int(input()) arr = list(map(int, input().split())) res = 2 * max(arr) - sum(arr) + 1 print(res) ```
output
1
56,055
23
112,111
Provide tags and a correct Python 3 solution for this coding contest problem. <image> As some of you know, cubism is a trend in art, where the problem of constructing volumetrical shape on a plane with a combination of three-dimensional geometric shapes comes to the fore. A famous sculptor Cicasso, whose self-portr...
instruction
0
56,056
23
112,112
Tags: constructive algorithms, geometry Correct Solution: ``` # coding: utf-8 from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import import math import string import itertools import fractions import heapq import collections ...
output
1
56,056
23
112,113
Provide tags and a correct Python 3 solution for this coding contest problem. <image> As some of you know, cubism is a trend in art, where the problem of constructing volumetrical shape on a plane with a combination of three-dimensional geometric shapes comes to the fore. A famous sculptor Cicasso, whose self-portr...
instruction
0
56,057
23
112,114
Tags: constructive algorithms, geometry Correct Solution: ``` n=int(input()) a=list(map(int,input().split())) x=max(a) print(x-(sum(a)-x)+1) ```
output
1
56,057
23
112,115
Provide tags and a correct Python 3 solution for this coding contest problem. <image> As some of you know, cubism is a trend in art, where the problem of constructing volumetrical shape on a plane with a combination of three-dimensional geometric shapes comes to the fore. A famous sculptor Cicasso, whose self-portr...
instruction
0
56,058
23
112,116
Tags: constructive algorithms, geometry Correct Solution: ``` n = int(input()) l = list(map(int, input().split(' '))) l.sort() ll = l[-1] l_sum = sum(l) - ll print(ll - l_sum + 1) ```
output
1
56,058
23
112,117
Provide tags and a correct Python 3 solution for this coding contest problem. <image> As some of you know, cubism is a trend in art, where the problem of constructing volumetrical shape on a plane with a combination of three-dimensional geometric shapes comes to the fore. A famous sculptor Cicasso, whose self-portr...
instruction
0
56,059
23
112,118
Tags: constructive algorithms, geometry Correct Solution: ``` n=int(input()) L=[int(x) for x in input().split()] print(1+2*max(L)-sum(L)) ```
output
1
56,059
23
112,119
Provide tags and a correct Python 3 solution for this coding contest problem. <image> As some of you know, cubism is a trend in art, where the problem of constructing volumetrical shape on a plane with a combination of three-dimensional geometric shapes comes to the fore. A famous sculptor Cicasso, whose self-portr...
instruction
0
56,060
23
112,120
Tags: constructive algorithms, geometry Correct Solution: ``` n = int(input()) arr = [*map(int, input().split(' '))] print(max(arr)*2 - sum(arr) + 1) ```
output
1
56,060
23
112,121
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. <image> As some of you know, cubism is a trend in art, where the problem of constructing volumetrical shape on a plane with a combination of three-dimensional geometric shapes comes to the fore...
instruction
0
56,061
23
112,122
Yes
output
1
56,061
23
112,123
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. <image> As some of you know, cubism is a trend in art, where the problem of constructing volumetrical shape on a plane with a combination of three-dimensional geometric shapes comes to the fore...
instruction
0
56,062
23
112,124
Yes
output
1
56,062
23
112,125
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. <image> As some of you know, cubism is a trend in art, where the problem of constructing volumetrical shape on a plane with a combination of three-dimensional geometric shapes comes to the fore...
instruction
0
56,063
23
112,126
Yes
output
1
56,063
23
112,127
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. <image> As some of you know, cubism is a trend in art, where the problem of constructing volumetrical shape on a plane with a combination of three-dimensional geometric shapes comes to the fore...
instruction
0
56,064
23
112,128
Yes
output
1
56,064
23
112,129
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. <image> As some of you know, cubism is a trend in art, where the problem of constructing volumetrical shape on a plane with a combination of three-dimensional geometric shapes comes to the fore...
instruction
0
56,065
23
112,130
No
output
1
56,065
23
112,131
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. <image> As some of you know, cubism is a trend in art, where the problem of constructing volumetrical shape on a plane with a combination of three-dimensional geometric shapes comes to the fore...
instruction
0
56,066
23
112,132
No
output
1
56,066
23
112,133
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. <image> As some of you know, cubism is a trend in art, where the problem of constructing volumetrical shape on a plane with a combination of three-dimensional geometric shapes comes to the fore...
instruction
0
56,067
23
112,134
No
output
1
56,067
23
112,135
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. <image> As some of you know, cubism is a trend in art, where the problem of constructing volumetrical shape on a plane with a combination of three-dimensional geometric shapes comes to the fore...
instruction
0
56,068
23
112,136
No
output
1
56,068
23
112,137
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Owl Sonya gave a huge lake puzzle of size n Γ— m to hedgehog Filya as a birthday present. Friends immediately started to assemble the puzzle, but some parts of it turned out to be empty β€” there w...
instruction
0
56,069
23
112,138
No
output
1
56,069
23
112,139
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Owl Sonya gave a huge lake puzzle of size n Γ— m to hedgehog Filya as a birthday present. Friends immediately started to assemble the puzzle, but some parts of it turned out to be empty β€” there w...
instruction
0
56,070
23
112,140
No
output
1
56,070
23
112,141