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.
Let's consider a table consisting of n rows and n columns. The cell located at the intersection of i-th row and j-th column contains number i × j. The rows and columns are numbered starting from... | instruction | 0 | 13,699 | 23 | 27,398 |
Yes | output | 1 | 13,699 | 23 | 27,399 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Let's consider a table consisting of n rows and n columns. The cell located at the intersection of i-th row and j-th column contains number i × j. The rows and columns are numbered starting from... | instruction | 0 | 13,702 | 23 | 27,404 |
No | output | 1 | 13,702 | 23 | 27,405 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given set of n points in 5-dimensional space. The points are labeled from 1 to n. No two points coincide.
We will call point a bad if there are different points b and c, not equal to a, from the given set such that angle between vec... | instruction | 0 | 13,820 | 23 | 27,640 |
Tags: brute force, geometry, math
Correct Solution:
```
n = int(input())
points = []
for p in range(n):
points.append(list(map(int, input().split())))
def dot(x, y):
res = 0
for a, b in zip(x, y):
res += a*b
return res
def minus(x, y):
res = []
for a, b in zip(x, y):
res.append(a-b)
return res
indices = s... | output | 1 | 13,820 | 23 | 27,641 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given set of n points in 5-dimensional space. The points are labeled from 1 to n. No two points coincide.
We will call point a bad if there are different points b and c, not equal to a, from the given set such that angle between vec... | instruction | 0 | 13,821 | 23 | 27,642 |
Tags: brute force, geometry, math
Correct Solution:
```
d = lambda i, j, k: sum((a - c) * (b - c) for a, b, c in zip(p[i], p[j], p[k])) * (i != j)
n = int(input())
r = range(n)
p = [list(map(int, input().split())) for i in r]
t = [k + 1 for k in r if all(d(i, j, k) <= 0 for i in r for j in r)] if n < 12 else []
for q i... | output | 1 | 13,821 | 23 | 27,643 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given set of n points in 5-dimensional space. The points are labeled from 1 to n. No two points coincide.
We will call point a bad if there are different points b and c, not equal to a, from the given set such that angle between vec... | instruction | 0 | 13,822 | 23 | 27,644 |
Tags: brute force, geometry, math
Correct Solution:
```
def check(coor1, coor2, coor3):
v1 = [coor2[i] - coor1[i] for i in range(5)]
v2 = [coor3[i] - coor1[i] for i in range(5)]
# print(v1, v2)
return scalar_product(v1, v2)
def scalar_product(coor1, coor2):
a1, a2, a3, a4, a5 = coor1
b1, b2, b3... | output | 1 | 13,822 | 23 | 27,645 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given set of n points in 5-dimensional space. The points are labeled from 1 to n. No two points coincide.
We will call point a bad if there are different points b and c, not equal to a, from the given set such that angle between vec... | instruction | 0 | 13,823 | 23 | 27,646 |
Tags: brute force, geometry, math
Correct Solution:
```
import sys
import math
n = int(input())
if(n > 20):
print(0)
sys.exit()
points = []
for i in range(n):
p = list(map(int, input().split()))
points.append(p)
good = []
class Vector:
def __init__(self, first, last):
self.elems = [last[... | output | 1 | 13,823 | 23 | 27,647 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given set of n points in 5-dimensional space. The points are labeled from 1 to n. No two points coincide.
We will call point a bad if there are different points b and c, not equal to a, from the given set such that angle between vec... | instruction | 0 | 13,824 | 23 | 27,648 |
Tags: brute force, geometry, math
Correct Solution:
```
n = int(input());
a = [];
used = [0 for i in range(n)];
def judge(s1, s2, s3):
sum = 0;
for i in range(5):
sum += (a[s1][i] - a[s3][i]) * (a[s2][i] - a[s3][i]);
if sum <= 0:
return 1;
else:
return 0;
for i in range(n):
... | output | 1 | 13,824 | 23 | 27,649 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given set of n points in 5-dimensional space. The points are labeled from 1 to n. No two points coincide.
We will call point a bad if there are different points b and c, not equal to a, from the given set such that angle between vec... | instruction | 0 | 13,825 | 23 | 27,650 |
Tags: brute force, geometry, math
Correct Solution:
```
#Code by Sounak, IIESTS
#------------------------------warmup----------------------------
import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import ... | output | 1 | 13,825 | 23 | 27,651 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given set of n points in 5-dimensional space. The points are labeled from 1 to n. No two points coincide.
We will call point a bad if there are different points b and c, not equal to a, from the given set such that angle between vec... | instruction | 0 | 13,826 | 23 | 27,652 |
Tags: brute force, geometry, math
Correct Solution:
```
# ------------------- fast io --------------------
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
self.buffer = BytesIO()
... | output | 1 | 13,826 | 23 | 27,653 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given set of n points in 5-dimensional space. The points are labeled from 1 to n. No two points coincide.
We will call point a bad if there are different points b and c, not equal to a, from the given set such that angle between vec... | instruction | 0 | 13,827 | 23 | 27,654 |
Tags: brute force, geometry, math
Correct Solution:
```
n = int(input())
points = []
for i in range(n):
pt = list(map(int, input().split()))
points.append(pt)
flag = [1] * n
for i in range(n):
a = points[i]
ok = False
for j in range(n):
if ok:
break
if j == i:
... | output | 1 | 13,827 | 23 | 27,655 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given set of n points in 5-dimensional space. The points are labeled from 1 to n. No two points coincide.
We will call point a bad if there are different points b and c, not equal to a,... | instruction | 0 | 13,828 | 23 | 27,656 |
Yes | output | 1 | 13,828 | 23 | 27,657 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given set of n points in 5-dimensional space. The points are labeled from 1 to n. No two points coincide.
We will call point a bad if there are different points b and c, not equal to a,... | instruction | 0 | 13,829 | 23 | 27,658 |
Yes | output | 1 | 13,829 | 23 | 27,659 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given set of n points in 5-dimensional space. The points are labeled from 1 to n. No two points coincide.
We will call point a bad if there are different points b and c, not equal to a,... | instruction | 0 | 13,830 | 23 | 27,660 |
Yes | output | 1 | 13,830 | 23 | 27,661 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given set of n points in 5-dimensional space. The points are labeled from 1 to n. No two points coincide.
We will call point a bad if there are different points b and c, not equal to a,... | instruction | 0 | 13,831 | 23 | 27,662 |
Yes | output | 1 | 13,831 | 23 | 27,663 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given set of n points in 5-dimensional space. The points are labeled from 1 to n. No two points coincide.
We will call point a bad if there are different points b and c, not equal to a,... | instruction | 0 | 13,832 | 23 | 27,664 |
No | output | 1 | 13,832 | 23 | 27,665 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given set of n points in 5-dimensional space. The points are labeled from 1 to n. No two points coincide.
We will call point a bad if there are different points b and c, not equal to a,... | instruction | 0 | 13,833 | 23 | 27,666 |
No | output | 1 | 13,833 | 23 | 27,667 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given set of n points in 5-dimensional space. The points are labeled from 1 to n. No two points coincide.
We will call point a bad if there are different points b and c, not equal to a,... | instruction | 0 | 13,834 | 23 | 27,668 |
No | output | 1 | 13,834 | 23 | 27,669 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given set of n points in 5-dimensional space. The points are labeled from 1 to n. No two points coincide.
We will call point a bad if there are different points b and c, not equal to a,... | instruction | 0 | 13,835 | 23 | 27,670 |
No | output | 1 | 13,835 | 23 | 27,671 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a long blackboard with 2 rows and N columns in a classroom of Kyoto University. This blackboard is so long that it is impossible to tell which cells are already used and which unused.
... | instruction | 0 | 14,025 | 23 | 28,050 |
No | output | 1 | 14,025 | 23 | 28,051 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a long blackboard with 2 rows and N columns in a classroom of Kyoto University. This blackboard is so long that it is impossible to tell which cells are already used and which unused.
... | instruction | 0 | 14,026 | 23 | 28,052 |
No | output | 1 | 14,026 | 23 | 28,053 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a long blackboard with 2 rows and N columns in a classroom of Kyoto University. This blackboard is so long that it is impossible to tell which cells are already used and which unused.
... | instruction | 0 | 14,027 | 23 | 28,054 |
No | output | 1 | 14,027 | 23 | 28,055 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a long blackboard with 2 rows and N columns in a classroom of Kyoto University. This blackboard is so long that it is impossible to tell which cells are already used and which unused.
... | instruction | 0 | 14,028 | 23 | 28,056 |
No | output | 1 | 14,028 | 23 | 28,057 |
Provide a correct Python 3 solution for this coding contest problem.
There is a plan view consisting of 12 vertical and 12 horizontal squares showing the terrain. Each square is painted white or black. White represents the sea and black represents the land. When two black squares touch each other vertically or horizon... | instruction | 0 | 14,029 | 23 | 28,058 |
"Correct Solution:
```
def f1():
t = 0
for y, line in enumerate(M):
for x, cell in enumerate(line):
if M[y][x] == '1':
f2(x, y)
t += 1
return t
def f2(x, y):
if x < 0 or len(M[0]) == x or y < 0 or len(M) == y:
return
if M[y][x] == '1':
... | output | 1 | 14,029 | 23 | 28,059 |
Provide a correct Python 3 solution for this coding contest problem.
There is a plan view consisting of 12 vertical and 12 horizontal squares showing the terrain. Each square is painted white or black. White represents the sea and black represents the land. When two black squares touch each other vertically or horizon... | instruction | 0 | 14,030 | 23 | 28,060 |
"Correct Solution:
```
def f(a,x,y):
if 0<=x<12 and 0<=y<12 and a[y][x]=='1':
a[y][x]='0'
for dx,dy in [[-1,0],[1,0],[0,-1],[0,1]]:f(a,x+dx,y+dy)
while 1:
try:
a=[list(input()) for _ in [0]*12]
b=0
for i in range(12):
for j in range(12):
if a[... | output | 1 | 14,030 | 23 | 28,061 |
Provide a correct Python 3 solution for this coding contest problem.
There is a plan view consisting of 12 vertical and 12 horizontal squares showing the terrain. Each square is painted white or black. White represents the sea and black represents the land. When two black squares touch each other vertically or horizon... | instruction | 0 | 14,031 | 23 | 28,062 |
"Correct Solution:
```
import sys
dx = [0, 0, -1, 1]
dy = [1, -1, 0, 0]
def main():
while True:
map = []
count = 0
for i in range(12):
map.append([x for x in input()])
for i in range(12):
for j in range(12):
if map[i][j] == '1':
... | output | 1 | 14,031 | 23 | 28,063 |
Provide a correct Python 3 solution for this coding contest problem.
There is a plan view consisting of 12 vertical and 12 horizontal squares showing the terrain. Each square is painted white or black. White represents the sea and black represents the land. When two black squares touch each other vertically or horizon... | instruction | 0 | 14,032 | 23 | 28,064 |
"Correct Solution:
```
import sys
def solve(f, i, j):
if 0<=i<12 and 0<=j<12 and f[j][i] == 1:
f[j][i] = 0
for dx, dy in [[0,1],[0,-1],[1,0],[-1,0]]: solve(f, i+dx, j+dy)
while True:
field = [[int(c) for c in sys.stdin.readline().strip()] for _ in range(12)]
ans = 0
for i in range(12):... | output | 1 | 14,032 | 23 | 28,065 |
Provide a correct Python 3 solution for this coding contest problem.
There is a plan view consisting of 12 vertical and 12 horizontal squares showing the terrain. Each square is painted white or black. White represents the sea and black represents the land. When two black squares touch each other vertically or horizon... | instruction | 0 | 14,033 | 23 | 28,066 |
"Correct Solution:
```
direct = ((0, -1), (0, 1), (-1, 0), (1, 0)) #移動方向
def search(x, y, mp):
if mp[x][y] == "1": #1を見つけたら0に書き換える
mp[x][y] = "0"
for dx, dy in direct: #4方向について繰り返す
search(x + dx, y + dy, mp)
while True:
#mp...全体のマップ、上下左右を0で囲っておく
mp = [list("0" + input() + "0") for _ in range(12)... | output | 1 | 14,033 | 23 | 28,067 |
Provide a correct Python 3 solution for this coding contest problem.
There is a plan view consisting of 12 vertical and 12 horizontal squares showing the terrain. Each square is painted white or black. White represents the sea and black represents the land. When two black squares touch each other vertically or horizon... | instruction | 0 | 14,034 | 23 | 28,068 |
"Correct Solution:
```
def fill(x, y, board):
board[y][x] = 2
points = [[y, x + 1], [y, x - 1], [y + 1, x], [y - 1, x]]
if y == 0:
points.remove([y-1, x])
elif y == 11:
points.remove([y+1, x])
if x == 0:
points.remove([y, x - 1])
elif x == 11:
points.remove([y, x... | output | 1 | 14,034 | 23 | 28,069 |
Provide a correct Python 3 solution for this coding contest problem.
There is a plan view consisting of 12 vertical and 12 horizontal squares showing the terrain. Each square is painted white or black. White represents the sea and black represents the land. When two black squares touch each other vertically or horizon... | instruction | 0 | 14,035 | 23 | 28,070 |
"Correct Solution:
```
while True:
lst = []
for i in range(12):
ls = []
s = input()
for j in range(12):
ls.append(int(s[j]))
lst.append(ls)
xd = [0,1,0,-1]
yd = [1,0,-1,0]
count = 0
def check(pt):
if 11 < pt[0] or pt[0] < 0 or 11 < pt[1] or pt[1] < 0:
return False
elif(ls... | output | 1 | 14,035 | 23 | 28,071 |
Provide a correct Python 3 solution for this coding contest problem.
There is a plan view consisting of 12 vertical and 12 horizontal squares showing the terrain. Each square is painted white or black. White represents the sea and black represents the land. When two black squares touch each other vertically or horizon... | instruction | 0 | 14,036 | 23 | 28,072 |
"Correct Solution:
```
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0067
"""
import sys
import copy
def solve(map):
num_of_land = 0
work = []
lmap = copy.deepcopy(map)
for i, line in enumerate(lmap[1:], start=1):
while 1 in line[1:-1]:
j = lin... | output | 1 | 14,036 | 23 | 28,073 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a plan view consisting of 12 vertical and 12 horizontal squares showing the terrain. Each square is painted white or black. White represents the sea and black represents the land. When ... | instruction | 0 | 14,037 | 23 | 28,074 |
Yes | output | 1 | 14,037 | 23 | 28,075 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a plan view consisting of 12 vertical and 12 horizontal squares showing the terrain. Each square is painted white or black. White represents the sea and black represents the land. When ... | instruction | 0 | 14,038 | 23 | 28,076 |
Yes | output | 1 | 14,038 | 23 | 28,077 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a plan view consisting of 12 vertical and 12 horizontal squares showing the terrain. Each square is painted white or black. White represents the sea and black represents the land. When ... | instruction | 0 | 14,039 | 23 | 28,078 |
Yes | output | 1 | 14,039 | 23 | 28,079 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a plan view consisting of 12 vertical and 12 horizontal squares showing the terrain. Each square is painted white or black. White represents the sea and black represents the land. When ... | instruction | 0 | 14,040 | 23 | 28,080 |
Yes | output | 1 | 14,040 | 23 | 28,081 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a plan view consisting of 12 vertical and 12 horizontal squares showing the terrain. Each square is painted white or black. White represents the sea and black represents the land. When ... | instruction | 0 | 14,041 | 23 | 28,082 |
No | output | 1 | 14,041 | 23 | 28,083 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a plan view consisting of 12 vertical and 12 horizontal squares showing the terrain. Each square is painted white or black. White represents the sea and black represents the land. When ... | instruction | 0 | 14,042 | 23 | 28,084 |
No | output | 1 | 14,042 | 23 | 28,085 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a plan view consisting of 12 vertical and 12 horizontal squares showing the terrain. Each square is painted white or black. White represents the sea and black represents the land. When ... | instruction | 0 | 14,043 | 23 | 28,086 |
No | output | 1 | 14,043 | 23 | 28,087 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a plan view consisting of 12 vertical and 12 horizontal squares showing the terrain. Each square is painted white or black. White represents the sea and black represents the land. When ... | instruction | 0 | 14,044 | 23 | 28,088 |
No | output | 1 | 14,044 | 23 | 28,089 |
Provide a correct Python 3 solution for this coding contest problem.
You are given N points in the xy-plane. You have a circle of radius one and move it on the xy-plane, so as to enclose as many of the points as possible. Find how many points can be simultaneously enclosed at the maximum. A point is considered enclose... | instruction | 0 | 14,068 | 23 | 28,136 |
"Correct Solution:
```
import cmath
def counter(z,a):
count= 0
for i in a:
if abs(i-z)<=1.0001:
count+=1
return count
while True:
n= int(input())
if n==0:
break
elif n==1:
a= input()
print("1")
continue
a=[]
for i in range(n):
... | output | 1 | 14,068 | 23 | 28,137 |
Provide a correct Python 3 solution for this coding contest problem.
You are given N points in the xy-plane. You have a circle of radius one and move it on the xy-plane, so as to enclose as many of the points as possible. Find how many points can be simultaneously enclosed at the maximum. A point is considered enclose... | instruction | 0 | 14,069 | 23 | 28,138 |
"Correct Solution:
```
import cmath
EPS = 1e-5
while True:
n = int(input())
if n == 0:
break
d = []
for _ in range(n):
x, y = list(map(float, input().split()))
d.append(complex(x, y))
res = 1
for i in range(n):
o1 = d[i]
cnt0 = 1
for j in range(n):
if j == i:
continue
o2 = d[j]
if abs(o... | output | 1 | 14,069 | 23 | 28,139 |
Provide a correct Python 3 solution for this coding contest problem.
You are given N points in the xy-plane. You have a circle of radius one and move it on the xy-plane, so as to enclose as many of the points as possible. Find how many points can be simultaneously enclosed at the maximum. A point is considered enclose... | instruction | 0 | 14,070 | 23 | 28,140 |
"Correct Solution:
```
#2006_D
"""
import sys
from collections import defaultdict
def dfs(d,y,x,f):
global ans
if d >= 10:
return
f_ = defaultdict(int)
for i in f.keys():
f_[i] = f[i]
for t,s in vr[(y,x)]:
if a[t][s] == 3:
ans = min(ans,d+1)
break
... | output | 1 | 14,070 | 23 | 28,141 |
Provide a correct Python 3 solution for this coding contest problem.
You are given N points in the xy-plane. You have a circle of radius one and move it on the xy-plane, so as to enclose as many of the points as possible. Find how many points can be simultaneously enclosed at the maximum. A point is considered enclose... | instruction | 0 | 14,071 | 23 | 28,142 |
"Correct Solution:
```
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**13
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
def LI(): return [int... | output | 1 | 14,071 | 23 | 28,143 |
Provide a correct Python 3 solution for this coding contest problem.
You are given N points in the xy-plane. You have a circle of radius one and move it on the xy-plane, so as to enclose as many of the points as possible. Find how many points can be simultaneously enclosed at the maximum. A point is considered enclose... | instruction | 0 | 14,072 | 23 | 28,144 |
"Correct Solution:
```
from math import sqrt
def center(a,b):
m = (a+b)/2
d = abs(a-m)
vec= complex((b-a).imag,(a-b).real)
length = sqrt(1-d**2)
c1,c2 = m+vec*(length/(2*d)),m-vec*(length/(2*d))
return c1,c2
def check(c):
cnt = 0
for loc in location:
if abs(c-loc) <= 1.0+EPS:... | output | 1 | 14,072 | 23 | 28,145 |
Provide a correct Python 3 solution for this coding contest problem.
You are given N points in the xy-plane. You have a circle of radius one and move it on the xy-plane, so as to enclose as many of the points as possible. Find how many points can be simultaneously enclosed at the maximum. A point is considered enclose... | instruction | 0 | 14,073 | 23 | 28,146 |
"Correct Solution:
```
import math
def count(a, b, P):
if abs(a-b) > 2:
return 0
if a == b:
return 0
m = (a+b)/2
c = m + (m-a)*(math.sqrt(1-abs(m-a)**2))*1j/abs(m-a)
cnt = 0
for x in P:
if abs(x-c) <=1.0001:
cnt += 1
return cnt
while True:
N = int(inp... | output | 1 | 14,073 | 23 | 28,147 |
Provide a correct Python 3 solution for this coding contest problem.
You are given N points in the xy-plane. You have a circle of radius one and move it on the xy-plane, so as to enclose as many of the points as possible. Find how many points can be simultaneously enclosed at the maximum. A point is considered enclose... | instruction | 0 | 14,074 | 23 | 28,148 |
"Correct Solution:
```
#教室内の位置は右*中央
#問題は「Circle and Points」(http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1132)
#提出が大幅に遅れてしまい、大変申し訳ありません
#方針としてはヒントで与えられた通り、全ての2点の組み合わせに対し、
#その2点を通るような円の中心を求めます(このような円が存在する場合、2通り存在します)
#それぞれの円について全ての点を舐めて、中心からの距離が1以下になる数の最大値を出力します
#この場合点の数Nに対して計算量はO(N^3)です
#先ずは中心2点を求める関数cent... | output | 1 | 14,074 | 23 | 28,149 |
Provide a correct Python 3 solution for this coding contest problem.
You are given N points in the xy-plane. You have a circle of radius one and move it on the xy-plane, so as to enclose as many of the points as possible. Find how many points can be simultaneously enclosed at the maximum. A point is considered enclose... | instruction | 0 | 14,075 | 23 | 28,150 |
"Correct Solution:
```
import math
def find_point(x1, y1, x2, y2):
# 二頂点(x1,y1),(x2,y2)を円周上にもつ時の半径1の円の中心
if (x1-x2)**2+(y1-y2)**2 > 4:
return False
mx, my = (x1+x2)/2, (y1+y2)/2
L = math.sqrt((y2-y1)**2+(x2-x1)**2)
k = math.sqrt(1-((y2-y1)**2+(x2-x1)**2)/4)
# (mx,my)+-(k/L)(-y2+y1,x2-x... | output | 1 | 14,075 | 23 | 28,151 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given N points in the xy-plane. You have a circle of radius one and move it on the xy-plane, so as to enclose as many of the points as possible. Find how many points can be simultaneousl... | instruction | 0 | 14,076 | 23 | 28,152 |
Yes | output | 1 | 14,076 | 23 | 28,153 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given N points in the xy-plane. You have a circle of radius one and move it on the xy-plane, so as to enclose as many of the points as possible. Find how many points can be simultaneousl... | instruction | 0 | 14,077 | 23 | 28,154 |
Yes | output | 1 | 14,077 | 23 | 28,155 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given N points in the xy-plane. You have a circle of radius one and move it on the xy-plane, so as to enclose as many of the points as possible. Find how many points can be simultaneousl... | instruction | 0 | 14,078 | 23 | 28,156 |
No | output | 1 | 14,078 | 23 | 28,157 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given N points in the xy-plane. You have a circle of radius one and move it on the xy-plane, so as to enclose as many of the points as possible. Find how many points can be simultaneousl... | instruction | 0 | 14,079 | 23 | 28,158 |
No | output | 1 | 14,079 | 23 | 28,159 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.