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 |
|---|---|---|---|---|---|
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given n rectangles, each of height 1. Each rectangle's width is a power of 2 (i. e. it can be represented as 2^x for some non-negative integer x).
You are also given a two-dimensional ... | instruction | 0 | 10,183 | 23 | 20,366 |
Yes | output | 1 | 10,183 | 23 | 20,367 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given n rectangles, each of height 1. Each rectangle's width is a power of 2 (i. e. it can be represented as 2^x for some non-negative integer x).
You are also given a two-dimensional ... | instruction | 0 | 10,184 | 23 | 20,368 |
Yes | output | 1 | 10,184 | 23 | 20,369 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given n rectangles, each of height 1. Each rectangle's width is a power of 2 (i. e. it can be represented as 2^x for some non-negative integer x).
You are also given a two-dimensional ... | instruction | 0 | 10,185 | 23 | 20,370 |
Yes | output | 1 | 10,185 | 23 | 20,371 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given n rectangles, each of height 1. Each rectangle's width is a power of 2 (i. e. it can be represented as 2^x for some non-negative integer x).
You are also given a two-dimensional ... | instruction | 0 | 10,186 | 23 | 20,372 |
Yes | output | 1 | 10,186 | 23 | 20,373 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given n rectangles, each of height 1. Each rectangle's width is a power of 2 (i. e. it can be represented as 2^x for some non-negative integer x).
You are also given a two-dimensional ... | instruction | 0 | 10,187 | 23 | 20,374 |
No | output | 1 | 10,187 | 23 | 20,375 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given n rectangles, each of height 1. Each rectangle's width is a power of 2 (i. e. it can be represented as 2^x for some non-negative integer x).
You are also given a two-dimensional ... | instruction | 0 | 10,188 | 23 | 20,376 |
No | output | 1 | 10,188 | 23 | 20,377 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given n rectangles, each of height 1. Each rectangle's width is a power of 2 (i. e. it can be represented as 2^x for some non-negative integer x).
You are also given a two-dimensional ... | instruction | 0 | 10,189 | 23 | 20,378 |
No | output | 1 | 10,189 | 23 | 20,379 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given n rectangles, each of height 1. Each rectangle's width is a power of 2 (i. e. it can be represented as 2^x for some non-negative integer x).
You are also given a two-dimensional ... | instruction | 0 | 10,190 | 23 | 20,380 |
No | output | 1 | 10,190 | 23 | 20,381 |
Provide tags and a correct Python 3 solution for this coding contest problem.
As Valeric and Valerko were watching one of the last Euro Championship games in a sports bar, they broke a mug. Of course, the guys paid for it but the barman said that he will let them watch football in his bar only if they help his son com... | instruction | 0 | 10,233 | 23 | 20,466 |
Tags: geometry, math, sortings
Correct Solution:
```
def GCD(a, b):
return GCD(b,a%b) if b>0 else a
def main():
n=int(input())
S=set()
for i in range (n):
k,b=map(int,input().split())
if k:
G=GCD(abs(k),abs(b))
k//=G
b//=G
if k<0:
... | output | 1 | 10,233 | 23 | 20,467 |
Provide tags and a correct Python 3 solution for this coding contest problem.
As Valeric and Valerko were watching one of the last Euro Championship games in a sports bar, they broke a mug. Of course, the guys paid for it but the barman said that he will let them watch football in his bar only if they help his son com... | instruction | 0 | 10,234 | 23 | 20,468 |
Tags: geometry, math, sortings
Correct Solution:
```
from decimal import *
n = int(input())
a = set()
for i in range(n):
k, b = map(int, input().split())
if k != 0:
a.add(Decimal(b) / Decimal(k))
print(len(a))
``` | output | 1 | 10,234 | 23 | 20,469 |
Provide tags and a correct Python 3 solution for this coding contest problem.
As Valeric and Valerko were watching one of the last Euro Championship games in a sports bar, they broke a mug. Of course, the guys paid for it but the barman said that he will let them watch football in his bar only if they help his son com... | instruction | 0 | 10,235 | 23 | 20,470 |
Tags: geometry, math, sortings
Correct Solution:
```
from decimal import *
getcontext().prec = 35
index=0
t=int(input())
slo=list([])
while(t!=0):
k,b=map(int, input().split())
if(k!=0):
slo.append(Decimal(-b)/Decimal(k))
index+=1
t-=1
slo.sort()
res=0
i=0
slo.append(0)
slo.append(0)
while(i... | output | 1 | 10,235 | 23 | 20,471 |
Provide tags and a correct Python 3 solution for this coding contest problem.
As Valeric and Valerko were watching one of the last Euro Championship games in a sports bar, they broke a mug. Of course, the guys paid for it but the barman said that he will let them watch football in his bar only if they help his son com... | instruction | 0 | 10,236 | 23 | 20,472 |
Tags: geometry, math, sortings
Correct Solution:
```
from sys import stdin
from math import gcd
n = int(stdin.readline())
iset = set()
for _ in range(n):
k,b = map(int,stdin.readline().split())
if k!=0:
if b==0:
iset.add((0,1))
else:
x = gcd(k,b)
if k*b>0:
... | output | 1 | 10,236 | 23 | 20,473 |
Provide tags and a correct Python 3 solution for this coding contest problem.
As Valeric and Valerko were watching one of the last Euro Championship games in a sports bar, they broke a mug. Of course, the guys paid for it but the barman said that he will let them watch football in his bar only if they help his son com... | instruction | 0 | 10,237 | 23 | 20,474 |
Tags: geometry, math, sortings
Correct Solution:
```
from sys import stdin, stdout
from decimal import Decimal
n = int(stdin.readline())
visit = []
for i in range(n):
k, b = map(Decimal, stdin.readline().split())
if not k:
continue
visit.append(-b/k)
visit.sort()
if len(visit):
... | output | 1 | 10,237 | 23 | 20,475 |
Provide tags and a correct Python 3 solution for this coding contest problem.
As Valeric and Valerko were watching one of the last Euro Championship games in a sports bar, they broke a mug. Of course, the guys paid for it but the barman said that he will let them watch football in his bar only if they help his son com... | instruction | 0 | 10,238 | 23 | 20,476 |
Tags: geometry, math, sortings
Correct Solution:
```
from fractions import gcd
s = set()
for _ in range(int(input())):
k, b = map(int, input().split())
if b and k:
g = gcd(k, b)
s.add((k // g, b // g))
elif k:
s.add((0, 0))
print(len(s))
``` | output | 1 | 10,238 | 23 | 20,477 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As Valeric and Valerko were watching one of the last Euro Championship games in a sports bar, they broke a mug. Of course, the guys paid for it but the barman said that he will let them watch fo... | instruction | 0 | 10,239 | 23 | 20,478 |
No | output | 1 | 10,239 | 23 | 20,479 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As Valeric and Valerko were watching one of the last Euro Championship games in a sports bar, they broke a mug. Of course, the guys paid for it but the barman said that he will let them watch fo... | instruction | 0 | 10,240 | 23 | 20,480 |
No | output | 1 | 10,240 | 23 | 20,481 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As Valeric and Valerko were watching one of the last Euro Championship games in a sports bar, they broke a mug. Of course, the guys paid for it but the barman said that he will let them watch fo... | instruction | 0 | 10,241 | 23 | 20,482 |
No | output | 1 | 10,241 | 23 | 20,483 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As Valeric and Valerko were watching one of the last Euro Championship games in a sports bar, they broke a mug. Of course, the guys paid for it but the barman said that he will let them watch fo... | instruction | 0 | 10,242 | 23 | 20,484 |
No | output | 1 | 10,242 | 23 | 20,485 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Given is a permutation P of \\{1, 2, \ldots, N\\}.
For a pair (L, R) (1 \le L \lt R \le N), let X_{L, R} be the second largest value among P_L, P_{L+1}, \ldots, P_R.
Find \displaystyle \sum_{L... | instruction | 0 | 10,578 | 23 | 21,156 |
No | output | 1 | 10,578 | 23 | 21,157 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi has an N \times N grid. The square at the i-th row and the j-th column of the grid is denoted by (i,j). Particularly, the top-left square of the grid is (1,1), and the bottom-right square is (N,N).
An integer, 0 or 1, is written on M of th... | instruction | 0 | 10,598 | 23 | 21,196 |
"Correct Solution:
```
from collections import Counter
import sys
MOD = 998244353
n, m = map(int, input().split())
d = Counter()
ans = 1
d_num = 0
def kaijou(a, n):
x = 1
while n > 0:
if n & 1 == 1:
x = (x * a) % MOD
a = (a ** 2) % MOD
n >>= 1
return x
for _ in range(m):
a, b, c = map(int, input().split())... | output | 1 | 10,598 | 23 | 21,197 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi has an N \times N grid. The square at the i-th row and the j-th column of the grid is denoted by (i,j). Particularly, the top-left square of the grid is (1,1), and the bottom-right square is (N,N).
An integer, 0 or 1, is written on M of th... | instruction | 0 | 10,599 | 23 | 21,198 |
"Correct Solution:
```
from collections import Counter
import sys
MOD = 998244353
n, m = map(int, input().split())
d = Counter()
ans = 1
d_num = 0
def k(a, n):
x = 1
while n > 0:
if n&1 == 1:
x = (x*a) % MOD
a = (a**2) % MOD
n >>= 1
return x
for _ in range(m):
a, b, c = map(int, input().split())
d[(a-1)*n... | output | 1 | 10,599 | 23 | 21,199 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi has an N \times N grid. The square at the i-th row and the j-th column of the grid is denoted by (i,j). Particularly, the top-left square of the grid is (1,1), and the bottom-right square is (N,N).
An integer, 0 or 1, is written on M of th... | instruction | 0 | 10,600 | 23 | 21,200 |
"Correct Solution:
```
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
"""
・適当な部分空間なので、達成可能でありさえすれば数え上げは簡単
・対角成分に関して向かい側はまとめる。「必ず0」「必ず1」「free」
・対角から遠いところについては調整不可能。「必ず1」がここにあると死亡
・そうでない場合、対角~対角+2までを矛盾なく作れれば勝ち
"""
import itertools
MOD = 998244353
N,... | output | 1 | 10,600 | 23 | 21,201 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi has an N \times N grid. The square at the i-th row and the j-th column of the grid is denoted by (i,j). Particularly, the top-left square of the grid is (1,1), and the bottom-right square is (N,N).
An integer, 0 or 1, is written on M of th... | instruction | 0 | 10,601 | 23 | 21,202 |
"Correct Solution:
```
from collections import Counter
import sys
MOD = 998244353
n, m = map(int, input().split())
decided = Counter()
ans = 1
d_num = 0
def kaijou(a, n):
x = 1
while n > 0:
if n & 1 == 1:
x = (x * a) % MOD
a = (a ** 2) % MOD
n >>= 1
return x
for _ in range(m):
a, b, c = map(int, input().... | output | 1 | 10,601 | 23 | 21,203 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi has an N \times N grid. The square at the i-th row and the j-th column of the grid is denoted by (i,j). Particularly, the top-left square of the grid is (1,1), and the bottom-right square is (N,N).
An integer, 0 or 1, is written on M of th... | instruction | 0 | 10,602 | 23 | 21,204 |
"Correct Solution:
```
"""
https://atcoder.jp/contests/caddi2018/tasks/caddi2018_d
インラインdpを習得したから再挑戦
2*2→3*3…と塗っていくと、毎回2個を決めることとなる
新たに塗る2箇所をどう決められるかを考える
→偶奇を反転させる場合、01 or 10で塗り、させない場合は11 or 00で塗る
→1箇所までなら塗られていても自由度が下がるだけ?
→両方塗られていたらまずい場合がある
基本的に4列目以降は00 01の対以外不可能になる
→すでに片側置かれていたら1択、両側でダメだったら0になる
→つまり、考えるべきは3列目までであ... | output | 1 | 10,602 | 23 | 21,205 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi has an N \times N grid. The square at the i-th row and the j-th column of the grid is denoted by (i,j). Particularly, the top-left square of the grid is (1,1), and the bottom-right square is (N,N).
An integer, 0 or 1, is written on M of th... | instruction | 0 | 10,603 | 23 | 21,206 |
"Correct Solution:
```
import sys
from collections import Counter, defaultdict, deque
readline = sys.stdin.readline
MOD = 998244353
def calc():
N, M = map(int, readline().split())
D = Counter()
Grid = defaultdict(lambda: -1)
flag = True
geta = N
co = 0
for _ in range(M):
a, b, c = m... | output | 1 | 10,603 | 23 | 21,207 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Takahashi has an N \times N grid. The square at the i-th row and the j-th column of the grid is denoted by (i,j). Particularly, the top-left square of the grid is (1,1), and the bottom-right squ... | instruction | 0 | 10,604 | 23 | 21,208 |
No | output | 1 | 10,604 | 23 | 21,209 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Takahashi has an N \times N grid. The square at the i-th row and the j-th column of the grid is denoted by (i,j). Particularly, the top-left square of the grid is (1,1), and the bottom-right squ... | instruction | 0 | 10,605 | 23 | 21,210 |
No | output | 1 | 10,605 | 23 | 21,211 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Takahashi has an N \times N grid. The square at the i-th row and the j-th column of the grid is denoted by (i,j). Particularly, the top-left square of the grid is (1,1), and the bottom-right squ... | instruction | 0 | 10,606 | 23 | 21,212 |
No | output | 1 | 10,606 | 23 | 21,213 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Takahashi has an N \times N grid. The square at the i-th row and the j-th column of the grid is denoted by (i,j). Particularly, the top-left square of the grid is (1,1), and the bottom-right squ... | instruction | 0 | 10,607 | 23 | 21,214 |
No | output | 1 | 10,607 | 23 | 21,215 |
Provide a correct Python 3 solution for this coding contest problem.
Mr. A came to Aizu for sightseeing. You can overlook the Aizu Basin from the window of the hotel where you stayed. As I was looking at the scenery, I noticed a piece of the photo on the floor. Apparently I took the outside view from the window. "Whic... | instruction | 0 | 10,687 | 23 | 21,374 |
"Correct Solution:
```
from sys import stdin
readline = stdin.readline
from itertools import product
from operator import itemgetter
from math import isinf
def scrap_top_left(picture):
for py, px in product(range(len(picture)), repeat=2):
if picture[py][px] != -1:
return px, py
def is_matc... | output | 1 | 10,687 | 23 | 21,375 |
Provide a correct Python 3 solution for this coding contest problem.
Mr. A came to Aizu for sightseeing. You can overlook the Aizu Basin from the window of the hotel where you stayed. As I was looking at the scenery, I noticed a piece of the photo on the floor. Apparently I took the outside view from the window. "Whic... | instruction | 0 | 10,688 | 23 | 21,376 |
"Correct Solution:
```
from sys import stdin
from itertools import product
# from line_profiler import LineProfiler
def rotate_clockwise(matrix):
return list(map(list, zip(*matrix)))[::-1]
def main():
while(True):
n,m = map(int, stdin.readline().split())
if not n:
break
w =... | output | 1 | 10,688 | 23 | 21,377 |
Provide a correct Python 3 solution for this coding contest problem.
Mr. A came to Aizu for sightseeing. You can overlook the Aizu Basin from the window of the hotel where you stayed. As I was looking at the scenery, I noticed a piece of the photo on the floor. Apparently I took the outside view from the window. "Whic... | instruction | 0 | 10,689 | 23 | 21,378 |
"Correct Solution:
```
while 1:
N, M = map(int, input().split())
if N == 0:
break
W = [list(map(int, input().split())) for i in range(N)]
P = [list(map(int, input().split())) for i in range(M)]
P0 = [[0]*M for i in range(M)]
ans = []
for t in range(4):
P1 = []
for i ... | output | 1 | 10,689 | 23 | 21,379 |
Provide a correct Python 3 solution for this coding contest problem.
Mr. A came to Aizu for sightseeing. You can overlook the Aizu Basin from the window of the hotel where you stayed. As I was looking at the scenery, I noticed a piece of the photo on the floor. Apparently I took the outside view from the window. "Whic... | instruction | 0 | 10,690 | 23 | 21,380 |
"Correct Solution:
```
from itertools import product
def rotate(a):
return [[a[y][x] for y in range(len(a)-1, -1, -1)] for x in range(len(a))]
while True:
n, m = map(int, input().split())
if n == 0:
break
picture = [list(map(int, input().split())) for _ in [0]*n]
piece = [list(map(int, i... | output | 1 | 10,690 | 23 | 21,381 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Mr. A came to Aizu for sightseeing. You can overlook the Aizu Basin from the window of the hotel where you stayed. As I was looking at the scenery, I noticed a piece of the photo on the floor. A... | instruction | 0 | 10,691 | 23 | 21,382 |
No | output | 1 | 10,691 | 23 | 21,383 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Mr. A came to Aizu for sightseeing. You can overlook the Aizu Basin from the window of the hotel where you stayed. As I was looking at the scenery, I noticed a piece of the photo on the floor. A... | instruction | 0 | 10,692 | 23 | 21,384 |
No | output | 1 | 10,692 | 23 | 21,385 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Mr. A came to Aizu for sightseeing. You can overlook the Aizu Basin from the window of the hotel where you stayed. As I was looking at the scenery, I noticed a piece of the photo on the floor. A... | instruction | 0 | 10,693 | 23 | 21,386 |
No | output | 1 | 10,693 | 23 | 21,387 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Mr. A came to Aizu for sightseeing. You can overlook the Aizu Basin from the window of the hotel where you stayed. As I was looking at the scenery, I noticed a piece of the photo on the floor. A... | instruction | 0 | 10,694 | 23 | 21,388 |
No | output | 1 | 10,694 | 23 | 21,389 |
Provide a correct Python 3 solution for this coding contest problem.
Find the diameter of a convex polygon g. In other words, find a pair of points that have maximum distance between them.
Constraints
* 3 ≤ n ≤ 80000
* -100 ≤ xi, yi ≤ 100
* No point in the g will occur more than once.
Input
n
x1 y1
x2 y2
:
xn yn
... | instruction | 0 | 10,772 | 23 | 21,544 |
"Correct Solution:
```
import cmath
EPS = 1e-10
#外積
def OuterProduct(one, two):
tmp = one.conjugate() * two
return tmp.imag
#3点が反時計回りか
#一直線上のときの例外処理できていない→とりあえずT
def CCW(p, q, r):
one, two = q-p, r-q
if OuterProduct(one, two) > -EPS:
return True
else:
return False
#凸包の直径
def ConvexDiameter(qs):
n = len(qs)... | output | 1 | 10,772 | 23 | 21,545 |
Provide a correct Python 3 solution for this coding contest problem.
Find the diameter of a convex polygon g. In other words, find a pair of points that have maximum distance between them.
Constraints
* 3 ≤ n ≤ 80000
* -100 ≤ xi, yi ≤ 100
* No point in the g will occur more than once.
Input
n
x1 y1
x2 y2
:
xn yn
... | instruction | 0 | 10,773 | 23 | 21,546 |
"Correct Solution:
```
from sys import stdin
readline = stdin.readline
def cross(a, b):
return a.real * b.imag - a.imag * b.real
def dot(a, b):
return a.real * b.real + a.imag * b.imag
def diff(p, i):
return p[(i + 1) % len(p)] - p[i]
# http://www.prefield.com/algorithm/geometry/convex_diameter.html
... | output | 1 | 10,773 | 23 | 21,547 |
Provide a correct Python 3 solution for this coding contest problem.
Find the diameter of a convex polygon g. In other words, find a pair of points that have maximum distance between them.
Constraints
* 3 ≤ n ≤ 80000
* -100 ≤ xi, yi ≤ 100
* No point in the g will occur more than once.
Input
n
x1 y1
x2 y2
:
xn yn
... | instruction | 0 | 10,774 | 23 | 21,548 |
"Correct Solution:
```
import cmath
import math
import os
import sys
if os.getenv("LOCAL"):
sys.stdin = open("_in.txt", "r")
sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353
PI = cmath.pi
TAU = cmath.pi * 2
EPS = 1e-8
class Point:
"""
2次元空間上の点
""... | output | 1 | 10,774 | 23 | 21,549 |
Provide a correct Python 3 solution for this coding contest problem.
Find the diameter of a convex polygon g. In other words, find a pair of points that have maximum distance between them.
Constraints
* 3 ≤ n ≤ 80000
* -100 ≤ xi, yi ≤ 100
* No point in the g will occur more than once.
Input
n
x1 y1
x2 y2
:
xn yn
... | instruction | 0 | 10,775 | 23 | 21,550 |
"Correct Solution:
```
def diff(i):
cp, np = points[i:i + 2]
return np - cp
def cross(a, b):
return a.real * b.imag - a.imag * b.real
def diameter(i, j):
return abs(points[i] - points[j])
n = int(input())
t_points = [tuple(map(float, input().split())) for _ in range(n)]
i = min(range(n), key=lambd... | output | 1 | 10,775 | 23 | 21,551 |
Provide a correct Python 3 solution for this coding contest problem.
Find the diameter of a convex polygon g. In other words, find a pair of points that have maximum distance between them.
Constraints
* 3 ≤ n ≤ 80000
* -100 ≤ xi, yi ≤ 100
* No point in the g will occur more than once.
Input
n
x1 y1
x2 y2
:
xn yn
... | instruction | 0 | 10,776 | 23 | 21,552 |
"Correct Solution:
```
# Cross product
def cross(p1, p2, q1, q2):
p = p2 - p1
q = q2 - q1
return p.real * q.imag - p.imag * q.real
# Rotating calipers
er = 1e-16
def convex_diameter(points, n):
points.append(points[0])
p0 = points[0]
p1 = points[1]
for i, (q1, q2) in enumerate(zip(points[1... | output | 1 | 10,776 | 23 | 21,553 |
Provide a correct Python 3 solution for this coding contest problem.
Find the diameter of a convex polygon g. In other words, find a pair of points that have maximum distance between them.
Constraints
* 3 ≤ n ≤ 80000
* -100 ≤ xi, yi ≤ 100
* No point in the g will occur more than once.
Input
n
x1 y1
x2 y2
:
xn yn
... | instruction | 0 | 10,777 | 23 | 21,554 |
"Correct Solution:
```
from typing import List
def cross(a: complex, b: complex) -> float:
return a.real * b.imag - a.imag * b.real
def distance(i: int, j: int, coordinates: List[complex]) -> float:
return abs(coordinates[i] - coordinates[j])
if __name__ == "__main__":
n = int(input())
points = [t... | output | 1 | 10,777 | 23 | 21,555 |
Provide a correct Python 3 solution for this coding contest problem.
Find the diameter of a convex polygon g. In other words, find a pair of points that have maximum distance between them.
Constraints
* 3 ≤ n ≤ 80000
* -100 ≤ xi, yi ≤ 100
* No point in the g will occur more than once.
Input
n
x1 y1
x2 y2
:
xn yn
... | instruction | 0 | 10,778 | 23 | 21,556 |
"Correct Solution:
```
#!/usr/bin/python3
import array
from fractions import Fraction
import functools
import itertools
import math
import os
import sys
def main():
N = read_int()
P = []
for _ in range(N):
x, y = [Fraction(s) for s in inp().split()]
P.append(Vec(x, y))
print(solve(N, ... | output | 1 | 10,778 | 23 | 21,557 |
Provide a correct Python 3 solution for this coding contest problem.
Find the diameter of a convex polygon g. In other words, find a pair of points that have maximum distance between them.
Constraints
* 3 ≤ n ≤ 80000
* -100 ≤ xi, yi ≤ 100
* No point in the g will occur more than once.
Input
n
x1 y1
x2 y2
:
xn yn
... | instruction | 0 | 10,779 | 23 | 21,558 |
"Correct Solution:
```
#!/usr/bin/env python3
# CGL_4_B: Convex Polygon - Diameter of a Convex Polygon
from operator import itemgetter
from math import sqrt
def distance(p0, p1):
x0, y0 = p0
x1, y1 = p1
return sqrt((x1-x0)**2 + (y1-y0)**2)
def cross(p0, p1, p2, p3):
x0, y0 = p0
x1, y1 = p1
... | output | 1 | 10,779 | 23 | 21,559 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Find the diameter of a convex polygon g. In other words, find a pair of points that have maximum distance between them.
Constraints
* 3 ≤ n ≤ 80000
* -100 ≤ xi, yi ≤ 100
* No point in the g wi... | instruction | 0 | 10,780 | 23 | 21,560 |
No | output | 1 | 10,780 | 23 | 21,561 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Find the diameter of a convex polygon g. In other words, find a pair of points that have maximum distance between them.
Constraints
* 3 ≤ n ≤ 80000
* -100 ≤ xi, yi ≤ 100
* No point in the g wi... | instruction | 0 | 10,781 | 23 | 21,562 |
No | output | 1 | 10,781 | 23 | 21,563 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Find the diameter of a convex polygon g. In other words, find a pair of points that have maximum distance between them.
Constraints
* 3 ≤ n ≤ 80000
* -100 ≤ xi, yi ≤ 100
* No point in the g wi... | instruction | 0 | 10,782 | 23 | 21,564 |
No | output | 1 | 10,782 | 23 | 21,565 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Find the diameter of a convex polygon g. In other words, find a pair of points that have maximum distance between them.
Constraints
* 3 ≤ n ≤ 80000
* -100 ≤ xi, yi ≤ 100
* No point in the g wi... | instruction | 0 | 10,783 | 23 | 21,566 |
No | output | 1 | 10,783 | 23 | 21,567 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a rectangular parallelepiped with sides of positive integer lengths A, B and C.
Find the number of different groups of three integers (a, b, c) such that 1≤ a≤ b≤ c and parallelepiped A× B× C can be paved with parallelepipeds... | instruction | 0 | 10,797 | 23 | 21,594 |
Tags: bitmasks, brute force, combinatorics, math, number theory
Correct Solution:
```
from sys import stdin
from math import gcd
def main():
input()
l = stdin.read().splitlines()
d = [3., 1., 2., 2., 2., 1.] * 16667
for i in range(4, 100001):
for j in range(i, 100001, i):
d[j] += 1... | output | 1 | 10,797 | 23 | 21,595 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.