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.
On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular convex n-gon (regular convex polygon with n si... | instruction | 0 | 65,346 | 23 | 130,692 |
Tags: constructive algorithms, geometry, math
Correct Solution:
```
import sys
n,a=(int(a) for a in input('').split())
res=-1
diff=sys.maxsize
for i in range(1,n-1):
resangle=180*i/n
if abs(resangle-a)<diff:
diff=abs(resangle-a)
res=i
print('1 '+str(res+2)+' '+str(res+1))
``` | output | 1 | 65,346 | 23 | 130,693 |
Provide tags and a correct Python 3 solution for this coding contest problem.
On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular convex n-gon (regular convex polygon with n si... | instruction | 0 | 65,347 | 23 | 130,694 |
Tags: constructive algorithms, geometry, math
Correct Solution:
```
n, a = list(map(int, input().split()))
c = round(n*a / 180.0) + 2
if c == 2:
c = 3
if c > n:
c = n
print(2, 1, c)
``` | output | 1 | 65,347 | 23 | 130,695 |
Provide tags and a correct Python 3 solution for this coding contest problem.
On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular convex n-gon (regular convex polygon with n si... | instruction | 0 | 65,348 | 23 | 130,696 |
Tags: constructive algorithms, geometry, math
Correct Solution:
```
n,a = map(int,input().split())
k = (a*n) // 180
asdf = (a*n) % 180
if(asdf > 90):
ans = k+1
else:
ans = k
ans = min(max(ans, 1), n-2)
print(1,2,n+1-ans)
``` | output | 1 | 65,348 | 23 | 130,697 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular... | instruction | 0 | 65,349 | 23 | 130,698 |
Yes | output | 1 | 65,349 | 23 | 130,699 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular... | instruction | 0 | 65,350 | 23 | 130,700 |
Yes | output | 1 | 65,350 | 23 | 130,701 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular... | instruction | 0 | 65,351 | 23 | 130,702 |
Yes | output | 1 | 65,351 | 23 | 130,703 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular... | instruction | 0 | 65,352 | 23 | 130,704 |
Yes | output | 1 | 65,352 | 23 | 130,705 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular... | instruction | 0 | 65,353 | 23 | 130,706 |
No | output | 1 | 65,353 | 23 | 130,707 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular... | instruction | 0 | 65,354 | 23 | 130,708 |
No | output | 1 | 65,354 | 23 | 130,709 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular... | instruction | 0 | 65,355 | 23 | 130,710 |
No | output | 1 | 65,355 | 23 | 130,711 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular... | instruction | 0 | 65,356 | 23 | 130,712 |
No | output | 1 | 65,356 | 23 | 130,713 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya has a polygon consisting of n vertices. All sides of the Petya's polygon are parallel to the coordinate axes, and each two adjacent sides of the Petya's polygon are perpendicular. It is gu... | instruction | 0 | 65,391 | 23 | 130,782 |
No | output | 1 | 65,391 | 23 | 130,783 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya has a polygon consisting of n vertices. All sides of the Petya's polygon are parallel to the coordinate axes, and each two adjacent sides of the Petya's polygon are perpendicular. It is gu... | instruction | 0 | 65,392 | 23 | 130,784 |
No | output | 1 | 65,392 | 23 | 130,785 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya has a polygon consisting of n vertices. All sides of the Petya's polygon are parallel to the coordinate axes, and each two adjacent sides of the Petya's polygon are perpendicular. It is gu... | instruction | 0 | 65,393 | 23 | 130,786 |
No | output | 1 | 65,393 | 23 | 130,787 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya has a polygon consisting of n vertices. All sides of the Petya's polygon are parallel to the coordinate axes, and each two adjacent sides of the Petya's polygon are perpendicular. It is gu... | instruction | 0 | 65,394 | 23 | 130,788 |
No | output | 1 | 65,394 | 23 | 130,789 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
It happened at the times of the Great Berland Empire. Once the Emperor dreamt that the Messenger from the gods ordered to build a temple whose base would be a convex polygon with n angles. Next ... | instruction | 0 | 65,973 | 23 | 131,946 |
No | output | 1 | 65,973 | 23 | 131,947 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
It happened at the times of the Great Berland Empire. Once the Emperor dreamt that the Messenger from the gods ordered to build a temple whose base would be a convex polygon with n angles. Next ... | instruction | 0 | 65,974 | 23 | 131,948 |
No | output | 1 | 65,974 | 23 | 131,949 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
It happened at the times of the Great Berland Empire. Once the Emperor dreamt that the Messenger from the gods ordered to build a temple whose base would be a convex polygon with n angles. Next ... | instruction | 0 | 65,975 | 23 | 131,950 |
No | output | 1 | 65,975 | 23 | 131,951 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A map of some object is a rectangular field consisting of n rows and n columns. Each cell is initially occupied by the sea but you can cover some some cells of the map with sand so that exactly k islands appear on the map. We will call a set... | instruction | 0 | 66,008 | 23 | 132,016 |
Tags: constructive algorithms, implementation
Correct Solution:
```
import math
n,k=map(int,input().split())
p=n/2
p=math.ceil(p)
max1=p-1
rem=n-p
if n%2==0:
max=2*(p*p)
else:
max=(p*p)+(max1*rem)
if k>max:
print("NO")
else:
a=[['S' for j in range(n)]for i in range(n)]
for i in range(n):
if ... | output | 1 | 66,008 | 23 | 132,017 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A map of some object is a rectangular field consisting of n rows and n columns. Each cell is initially occupied by the sea but you can cover some some cells of the map with sand so that exactly k islands appear on the map. We will call a set... | instruction | 0 | 66,009 | 23 | 132,018 |
Tags: constructive algorithms, implementation
Correct Solution:
```
S=input().split();n=int(S[0]);k=int(S[1])
ans=[]
try:
cnt=0
for i in range(n):
ans.append("")
for j in range(n):
if (i+j)%2==0 and cnt<k:
ans[i]=ans[i]+'L';cnt=cnt+1
else :
... | output | 1 | 66,009 | 23 | 132,019 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A map of some object is a rectangular field consisting of n rows and n columns. Each cell is initially occupied by the sea but you can cover some some cells of the map with sand so that exactly k islands appear on the map. We will call a set... | instruction | 0 | 66,010 | 23 | 132,020 |
Tags: constructive algorithms, implementation
Correct Solution:
```
[n, k] = [int(i) for i in input().split()]
islands = 0
result = []
for i in range(n):
if i % 2 == 0 and islands < k:
result.append('L')
islands += 1
else:
result.append('S')
for j in range(n - 1):
if result[-... | output | 1 | 66,010 | 23 | 132,021 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A map of some object is a rectangular field consisting of n rows and n columns. Each cell is initially occupied by the sea but you can cover some some cells of the map with sand so that exactly k islands appear on the map. We will call a set... | instruction | 0 | 66,011 | 23 | 132,022 |
Tags: constructive algorithms, implementation
Correct Solution:
```
import sys
import math
import collections
import bisect
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def get_list(): return list(map(int, sys.stdin.readline().strip().split()))
def get_string(): return sys.stdin.readline().stri... | output | 1 | 66,011 | 23 | 132,023 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A map of some object is a rectangular field consisting of n rows and n columns. Each cell is initially occupied by the sea but you can cover some some cells of the map with sand so that exactly k islands appear on the map. We will call a set... | instruction | 0 | 66,012 | 23 | 132,024 |
Tags: constructive algorithms, implementation
Correct Solution:
```
from math import *
from bisect import *
from collections import Counter,defaultdict
from sys import stdin, stdout
input = stdin.readline
I =lambda:int(input())
M =lambda:map(int,input().split())
LI=lambda:list(map(int,input().split()))
n,k=M()
if (n*n+... | output | 1 | 66,012 | 23 | 132,025 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A map of some object is a rectangular field consisting of n rows and n columns. Each cell is initially occupied by the sea but you can cover some some cells of the map with sand so that exactly k islands appear on the map. We will call a set... | instruction | 0 | 66,014 | 23 | 132,028 |
Tags: constructive algorithms, implementation
Correct Solution:
```
'''
/\
/ `.
,' `.
/`.________ ( :
\ `. _\_______ )
\ `.----._ `. "`-.
) \ \ ` ,"__\
\ \ )... | output | 1 | 66,014 | 23 | 132,029 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A map of some object is a rectangular field consisting of n rows and n columns. Each cell is initially occupied by the sea but you can cover some some cells of the map with sand so that exactly k islands appear on the map. We will call a set... | instruction | 0 | 66,015 | 23 | 132,030 |
Tags: constructive algorithms, implementation
Correct Solution:
```
n, k = [int(x) for x in input().split()]
if (n * n + 1) // 2 < k:
print("NO")
else:
print("YES")
arr = ['L'] * k + ['S'] * ((n * n + 1) // 2 - k)
s = 'S'.join(arr)
if n % 2 == 0:
s += 'S'
turn = 1
while s:
pr... | output | 1 | 66,015 | 23 | 132,031 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A map of some object is a rectangular field consisting of n rows and n columns. Each cell is initially occupied by the sea but you can cover some some cells of the map with sand so that exactly ... | instruction | 0 | 66,016 | 23 | 132,032 |
Yes | output | 1 | 66,016 | 23 | 132,033 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A map of some object is a rectangular field consisting of n rows and n columns. Each cell is initially occupied by the sea but you can cover some some cells of the map with sand so that exactly ... | instruction | 0 | 66,017 | 23 | 132,034 |
Yes | output | 1 | 66,017 | 23 | 132,035 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A map of some object is a rectangular field consisting of n rows and n columns. Each cell is initially occupied by the sea but you can cover some some cells of the map with sand so that exactly ... | instruction | 0 | 66,018 | 23 | 132,036 |
Yes | output | 1 | 66,018 | 23 | 132,037 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A map of some object is a rectangular field consisting of n rows and n columns. Each cell is initially occupied by the sea but you can cover some some cells of the map with sand so that exactly ... | instruction | 0 | 66,019 | 23 | 132,038 |
Yes | output | 1 | 66,019 | 23 | 132,039 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A map of some object is a rectangular field consisting of n rows and n columns. Each cell is initially occupied by the sea but you can cover some some cells of the map with sand so that exactly ... | instruction | 0 | 66,020 | 23 | 132,040 |
No | output | 1 | 66,020 | 23 | 132,041 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A map of some object is a rectangular field consisting of n rows and n columns. Each cell is initially occupied by the sea but you can cover some some cells of the map with sand so that exactly ... | instruction | 0 | 66,021 | 23 | 132,042 |
No | output | 1 | 66,021 | 23 | 132,043 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A map of some object is a rectangular field consisting of n rows and n columns. Each cell is initially occupied by the sea but you can cover some some cells of the map with sand so that exactly ... | instruction | 0 | 66,022 | 23 | 132,044 |
No | output | 1 | 66,022 | 23 | 132,045 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A map of some object is a rectangular field consisting of n rows and n columns. Each cell is initially occupied by the sea but you can cover some some cells of the map with sand so that exactly ... | instruction | 0 | 66,023 | 23 | 132,046 |
No | output | 1 | 66,023 | 23 | 132,047 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Find the minimum area of a square land on which you can place two identical rectangular a Γ b houses. The sides of the houses should be parallel to the sides of the desired square land.
Formally,
* You are given two identical rectangles... | instruction | 0 | 66,588 | 23 | 133,176 |
Tags: greedy, math
Correct Solution:
```
t = int(input())
for i in range(t):
n,m = [int(i) for i in input().split()]
# print(n,m)
print((max(max(n,m),min(n,m)*2))**2)
``` | output | 1 | 66,588 | 23 | 133,177 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Find the minimum area of a square land on which you can place two identical rectangular a Γ b houses. The sides of the houses should be parallel to the sides of the desired square land.
Formally,
* You are given two identical rectangles... | instruction | 0 | 66,589 | 23 | 133,178 |
Tags: greedy, math
Correct Solution:
```
t=int(input())
for i in range(t):
a,b=map(int,input().split())
a,b=max(a,b),min(a,b)
if 2*b>=a:
print((2*b)**2)
else:
print(a**2)
``` | output | 1 | 66,589 | 23 | 133,179 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Find the minimum area of a square land on which you can place two identical rectangular a Γ b houses. The sides of the houses should be parallel to the sides of the desired square land.
Formally,
* You are given two identical rectangles... | instruction | 0 | 66,590 | 23 | 133,180 |
Tags: greedy, math
Correct Solution:
```
def find_area(x):
a,b = x.split()
a,b = int(a), int(b)
if(a>b):
min = b
max = a
else:
min = a
max = b
min2 = min*2
if(min2>max):
return min2**2
else:
return max**2
inputList = []
outputList = []
n =... | output | 1 | 66,590 | 23 | 133,181 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Find the minimum area of a square land on which you can place two identical rectangular a Γ b houses. The sides of the houses should be parallel to the sides of the desired square land.
Formally,
* You are given two identical rectangles... | instruction | 0 | 66,591 | 23 | 133,182 |
Tags: greedy, math
Correct Solution:
```
#------------------------template--------------------------#
import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase
def vsInput():
sys.stdin = open('input.txt', 'r')
sys.stdout = open('output.txt', 'w')
BUFS... | output | 1 | 66,591 | 23 | 133,183 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Find the minimum area of a square land on which you can place two identical rectangular a Γ b houses. The sides of the houses should be parallel to the sides of the desired square land.
Formally,
* You are given two identical rectangles... | instruction | 0 | 66,592 | 23 | 133,184 |
Tags: greedy, math
Correct Solution:
```
def minimal_square(a, b):
if a < b:
if a*2 >= b:
x = (a*2)**2
else:
x = b*b
else:
if b*2 >= a:
x = (b*2)**2
else:
x = a*a
return x
t = input()
a = []
b =[]
output = []
for i in range(0,i... | output | 1 | 66,592 | 23 | 133,185 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Find the minimum area of a square land on which you can place two identical rectangular a Γ b houses. The sides of the houses should be parallel to the sides of the desired square land.
Formally,
* You are given two identical rectangles... | instruction | 0 | 66,593 | 23 | 133,186 |
Tags: greedy, math
Correct Solution:
```
if __name__ == '__main__':
for _ in range(int(input())):
a, b = map(int, input().split())
print(max(min(a, b) * 2, max(a, b)) ** 2)
``` | output | 1 | 66,593 | 23 | 133,187 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Find the minimum area of a square land on which you can place two identical rectangular a Γ b houses. The sides of the houses should be parallel to the sides of the desired square land.
Formally,
* You are given two identical rectangles... | instruction | 0 | 66,594 | 23 | 133,188 |
Tags: greedy, math
Correct Solution:
```
for _ in range(int(input())):
a,b = map(int,input().split())
lis = []
lis.append(a+b)
if a>= 2*b:
lis.append(a)
if b >= 2*a:
lis.append(b)
if 2*a >= b:
lis.append(2*a)
if 2*b >= a:
lis.append(2*b)
print(min(lis)**2)... | output | 1 | 66,594 | 23 | 133,189 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Find the minimum area of a square land on which you can place two identical rectangular a Γ b houses. The sides of the houses should be parallel to the sides of the desired square land.
Formally,
* You are given two identical rectangles... | instruction | 0 | 66,595 | 23 | 133,190 |
Tags: greedy, math
Correct Solution:
```
cases = int(input())
for case in range(cases):
(a, b) = map(int,input().split())
lado = max(max(a,b),2*min(a,b))
print(lado*lado)
``` | output | 1 | 66,595 | 23 | 133,191 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Find the minimum area of a square land on which you can place two identical rectangular a Γ b houses. The sides of the houses should be parallel to the sides of the desired square land.
Formall... | instruction | 0 | 66,596 | 23 | 133,192 |
Yes | output | 1 | 66,596 | 23 | 133,193 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Find the minimum area of a square land on which you can place two identical rectangular a Γ b houses. The sides of the houses should be parallel to the sides of the desired square land.
Formall... | instruction | 0 | 66,597 | 23 | 133,194 |
Yes | output | 1 | 66,597 | 23 | 133,195 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Find the minimum area of a square land on which you can place two identical rectangular a Γ b houses. The sides of the houses should be parallel to the sides of the desired square land.
Formall... | instruction | 0 | 66,598 | 23 | 133,196 |
Yes | output | 1 | 66,598 | 23 | 133,197 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Find the minimum area of a square land on which you can place two identical rectangular a Γ b houses. The sides of the houses should be parallel to the sides of the desired square land.
Formall... | instruction | 0 | 66,599 | 23 | 133,198 |
Yes | output | 1 | 66,599 | 23 | 133,199 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Find the minimum area of a square land on which you can place two identical rectangular a Γ b houses. The sides of the houses should be parallel to the sides of the desired square land.
Formall... | instruction | 0 | 66,600 | 23 | 133,200 |
No | output | 1 | 66,600 | 23 | 133,201 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Find the minimum area of a square land on which you can place two identical rectangular a Γ b houses. The sides of the houses should be parallel to the sides of the desired square land.
Formall... | instruction | 0 | 66,601 | 23 | 133,202 |
No | output | 1 | 66,601 | 23 | 133,203 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Find the minimum area of a square land on which you can place two identical rectangular a Γ b houses. The sides of the houses should be parallel to the sides of the desired square land.
Formall... | instruction | 0 | 66,602 | 23 | 133,204 |
No | output | 1 | 66,602 | 23 | 133,205 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Find the minimum area of a square land on which you can place two identical rectangular a Γ b houses. The sides of the houses should be parallel to the sides of the desired square land.
Formall... | instruction | 0 | 66,603 | 23 | 133,206 |
No | output | 1 | 66,603 | 23 | 133,207 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You're given the centers of three equal sides of a strictly convex tetragon. Your task is to restore the initial tetragon.
Input
The first input line contains one number T β amount of tests (1... | instruction | 0 | 66,697 | 23 | 133,394 |
No | output | 1 | 66,697 | 23 | 133,395 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.