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.
There is a square of size 10^6 × 10^6 on the coordinate plane with four points (0, 0), (0, 10^6), (10^6, 0), and (10^6, 10^6) as its vertices.
You are going to draw segments on the plane. All s... | instruction | 0 | 32,715 | 23 | 65,430 |
No | output | 1 | 32,715 | 23 | 65,431 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have a set of dominoes. Each domino is a rectangular tile with a line dividing its face into two square ends. Can you put all dominoes in a line one by one from left to right so that any two dominoes touched with the sides that had the s... | instruction | 0 | 32,809 | 23 | 65,618 |
Tags: dfs and similar, graphs
Correct Solution:
```
def euler(start):
s = [(start,0)]
ans = []
while s:
i,e = s[-1]
if i in mark:
mark.remove(i)
if degree[i]==0:
ans.append(e)
s.pop()
else:
for j,e in graph[i]:
... | output | 1 | 32,809 | 23 | 65,619 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have a set of dominoes. Each domino is a rectangular tile with a line dividing its face into two square ends. Can you put all dominoes in a line one by one from left to right so that any two... | instruction | 0 | 32,810 | 23 | 65,620 |
No | output | 1 | 32,810 | 23 | 65,621 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have a set of dominoes. Each domino is a rectangular tile with a line dividing its face into two square ends. Can you put all dominoes in a line one by one from left to right so that any two... | instruction | 0 | 32,811 | 23 | 65,622 |
No | output | 1 | 32,811 | 23 | 65,623 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have a set of dominoes. Each domino is a rectangular tile with a line dividing its face into two square ends. Can you put all dominoes in a line one by one from left to right so that any two... | instruction | 0 | 32,812 | 23 | 65,624 |
No | output | 1 | 32,812 | 23 | 65,625 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have a set of dominoes. Each domino is a rectangular tile with a line dividing its face into two square ends. Can you put all dominoes in a line one by one from left to right so that any two... | instruction | 0 | 32,813 | 23 | 65,626 |
No | output | 1 | 32,813 | 23 | 65,627 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Chris is a huge fan of linear algebra. This time he has been given a homework about the unusual square of a square matrix.
The dot product of two integer number vectors x and y of size n is the sum of the products of the correspondin... | instruction | 0 | 32,877 | 23 | 65,754 |
Tags: implementation, math
Correct Solution:
```
from sys import stdin
input=stdin.readline
n = int(input())
matrix = []
diagOnes = 0
for i in range(n):
row = input().split()
if row[i] == '1':
diagOnes += 1
matrix.append(row)
q = int(input())
result = []
for _ in range(q):
a = input().rstrip()
... | output | 1 | 32,877 | 23 | 65,755 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Chris is a huge fan of linear algebra. This time he has been given a homework about the unusual square of a square matrix.
The dot product of two integer number vectors x and y of size n is the sum of the products of the correspondin... | instruction | 0 | 32,878 | 23 | 65,756 |
Tags: implementation, math
Correct Solution:
```
from sys import stdin
input=stdin.readline
n = int(input())
matrix = []
diagOnes = 0
for i in range(n):
row = input().split()
if row[i] == '1':
diagOnes += 1
matrix.append(row)
diagOnes%=2
ans=[]
q=int(input())
for _ in range(q):
x=input().split()
... | output | 1 | 32,878 | 23 | 65,757 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Chris is a huge fan of linear algebra. This time he has been given a homework about the unusual square of a square matrix.
The dot product of two integer number vectors x and y of size n is the sum of the products of the correspondin... | instruction | 0 | 32,879 | 23 | 65,758 |
Tags: implementation, math
Correct Solution:
```
#------------------------template--------------------------#
import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import*
from io import BytesIO, IOBase
def vsInput():
sys.stdin = open('input.txt', ... | output | 1 | 32,879 | 23 | 65,759 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Chris is a huge fan of linear algebra. This time he has been given a homework about the unusual square of a square matrix.
The dot product of two integer number vectors x and y of size n is the sum of the products of the correspondin... | instruction | 0 | 32,880 | 23 | 65,760 |
Tags: implementation, math
Correct Solution:
```
def main():
from sys import stdin
from operator import xor
from functools import reduce
x, res = reduce(xor, (input()[i] == '1' for i in range(0, int(input()) * 2, 2))), []
input()
for s in stdin.read().splitlines():
if s == '3':
... | output | 1 | 32,880 | 23 | 65,761 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Chris is a huge fan of linear algebra. This time he has been given a homework about the unusual square of a square matrix.
The dot product of two integer number vectors x and y of size n is the sum of the products of the correspondin... | instruction | 0 | 32,881 | 23 | 65,762 |
Tags: implementation, math
Correct Solution:
```
import sys
input=sys.stdin.readline
n=int(input())
a=[list(map(int,input().split())) for i in range(n)]
s=0
for i in range(n):
for j in range(n):
s+=a[i][j]*a[j][i]
s%=2
ans=[]
q=int(input())
for _ in range(q):
x=input().split()
if x[0]=="1" or x[0]=="2":
s... | output | 1 | 32,881 | 23 | 65,763 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Chris is a huge fan of linear algebra. This time he has been given a homework about the unusual square of a square matrix.
The dot product of two integer number vectors x and y of size n is the sum of the products of the correspondin... | instruction | 0 | 32,882 | 23 | 65,764 |
Tags: implementation, math
Correct Solution:
```
from sys import stdin
input = stdin.readline
n = int(input())
lis=list(list(map(int, input().split())) for _ in range(n))
u=0
for i in range(n):
for j in range(n):
if i==j:
u^=lis[i][j]
ans =[]
k = int(input())
for i in range(k):
s = input()
... | output | 1 | 32,882 | 23 | 65,765 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Chris is a huge fan of linear algebra. This time he has been given a homework about the unusual square of a square matrix.
The dot product of two integer number vectors x and y of size n is the sum of the products of the correspondin... | instruction | 0 | 32,883 | 23 | 65,766 |
Tags: implementation, math
Correct Solution:
```
import sys
import math
MAXNUM = math.inf
MINNUM = -1 * math.inf
def getInt():
return int(sys.stdin.readline().rstrip())
def getInts():
return map(int, sys.stdin.readline().rstrip().split(" "))
def getString():
return sys.stdin.readline().rstrip()
def... | output | 1 | 32,883 | 23 | 65,767 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Chris is a huge fan of linear algebra. This time he has been given a homework about the unusual square of a square matrix.
The dot product of two integer number vectors x and y of size n is the sum of the products of the correspondin... | instruction | 0 | 32,884 | 23 | 65,768 |
Tags: implementation, math
Correct Solution:
```
# from operator import and_, xor
# from functools import reduce
# from itertools import chain
from sys import stdin
input = stdin.readline
n = int(input())
l = list(list(map(int, input().split())) for _ in range(n))
q = int(input())
output = []
ans = 0
# We don't care ... | output | 1 | 32,884 | 23 | 65,769 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Chris is a huge fan of linear algebra. This time he has been given a homework about the unusual square of a square matrix.
The dot product of two integer number vectors x and y of size n... | instruction | 0 | 32,885 | 23 | 65,770 |
Yes | output | 1 | 32,885 | 23 | 65,771 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Chris is a huge fan of linear algebra. This time he has been given a homework about the unusual square of a square matrix.
The dot product of two integer number vectors x and y of size n... | instruction | 0 | 32,886 | 23 | 65,772 |
No | output | 1 | 32,886 | 23 | 65,773 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Chris is a huge fan of linear algebra. This time he has been given a homework about the unusual square of a square matrix.
The dot product of two integer number vectors x and y of size n... | instruction | 0 | 32,887 | 23 | 65,774 |
No | output | 1 | 32,887 | 23 | 65,775 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Chris is a huge fan of linear algebra. This time he has been given a homework about the unusual square of a square matrix.
The dot product of two integer number vectors x and y of size n... | instruction | 0 | 32,888 | 23 | 65,776 |
No | output | 1 | 32,888 | 23 | 65,777 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Chris is a huge fan of linear algebra. This time he has been given a homework about the unusual square of a square matrix.
The dot product of two integer number vectors x and y of size n... | instruction | 0 | 32,889 | 23 | 65,778 |
No | output | 1 | 32,889 | 23 | 65,779 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In a two-dimensional plane, we have a rectangle R whose vertices are (0,0), (W,0), (0,H), and (W,H), where W and H are positive integers. Here, find the number of triangles \Delta in the plane t... | instruction | 0 | 33,129 | 23 | 66,258 |
No | output | 1 | 33,129 | 23 | 66,259 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In a two-dimensional plane, we have a rectangle R whose vertices are (0,0), (W,0), (0,H), and (W,H), where W and H are positive integers. Here, find the number of triangles \Delta in the plane t... | instruction | 0 | 33,130 | 23 | 66,260 |
No | output | 1 | 33,130 | 23 | 66,261 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In a two-dimensional plane, we have a rectangle R whose vertices are (0,0), (W,0), (0,H), and (W,H), where W and H are positive integers. Here, find the number of triangles \Delta in the plane t... | instruction | 0 | 33,131 | 23 | 66,262 |
No | output | 1 | 33,131 | 23 | 66,263 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In a two-dimensional plane, we have a rectangle R whose vertices are (0,0), (W,0), (0,H), and (W,H), where W and H are positive integers. Here, find the number of triangles \Delta in the plane t... | instruction | 0 | 33,132 | 23 | 66,264 |
No | output | 1 | 33,132 | 23 | 66,265 |
Provide a correct Python 3 solution for this coding contest problem.
You received a card with an integer $S$ and a multiplication table of infinite size. All the elements in the table are integers, and an integer at the $i$-th row from the top and the $j$-th column from the left is $A_{i,j} = i \times j$ ($i,j \geq 1$... | instruction | 0 | 33,288 | 23 | 66,576 |
"Correct Solution:
```
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.st... | output | 1 | 33,288 | 23 | 66,577 |
Provide a correct Python 3 solution for this coding contest problem.
For given two segments s1 and s2, print the distance between them.
s1 is formed by end points p0 and p1, and s2 is formed by end points p2 and p3.
Constraints
* 1 ≤ q ≤ 1000
* -10000 ≤ xpi, ypi ≤ 10000
* p0 ≠ p1 and p2 ≠ p3.
Input
The entire inp... | instruction | 0 | 33,289 | 23 | 66,578 |
"Correct Solution:
```
EPS = 1e-4
#点と線分の距離
def PointSegmentDistance(point, begin, end):
point, begin, end = point-begin, 0, end-begin
point = (point / end) * abs(end)
end = abs(end)
if -EPS <= point.real <= abs(end):
return abs(point.imag)
else:
return min(abs(point), abs(point - end))
#外積
def OuterProduct(o... | output | 1 | 33,289 | 23 | 66,579 |
Provide a correct Python 3 solution for this coding contest problem.
For given two segments s1 and s2, print the distance between them.
s1 is formed by end points p0 and p1, and s2 is formed by end points p2 and p3.
Constraints
* 1 ≤ q ≤ 1000
* -10000 ≤ xpi, ypi ≤ 10000
* p0 ≠ p1 and p2 ≠ p3.
Input
The entire inp... | instruction | 0 | 33,290 | 23 | 66,580 |
"Correct Solution:
```
import math
EPS = 1e-10
def equals(a, b):
return abs(a - b) < EPS
class Point:
def __init__(self, x=0, y=0):
self.x = x
self.y = y
def __add__(self, p):
return Point(self.x + p.x, self.y + p.y)
def __sub__(self, p):
return Point(self.x - p.x, ... | output | 1 | 33,290 | 23 | 66,581 |
Provide a correct Python 3 solution for this coding contest problem.
For given two segments s1 and s2, print the distance between them.
s1 is formed by end points p0 and p1, and s2 is formed by end points p2 and p3.
Constraints
* 1 ≤ q ≤ 1000
* -10000 ≤ xpi, ypi ≤ 10000
* p0 ≠ p1 and p2 ≠ p3.
Input
The entire inp... | instruction | 0 | 33,291 | 23 | 66,582 |
"Correct Solution:
```
class Point:
def __init__(self, x , y):
self.x = x
self.y = y
def __sub__(self, p):
x_sub = self.x - p.x
y_sub = self.y - p.y
return Point(x_sub, y_sub)
class Vector:
def __init__(self, p):
self.x = p.x
self.y = p.y
self... | output | 1 | 33,291 | 23 | 66,583 |
Provide a correct Python 3 solution for this coding contest problem.
For given two segments s1 and s2, print the distance between them.
s1 is formed by end points p0 and p1, and s2 is formed by end points p2 and p3.
Constraints
* 1 ≤ q ≤ 1000
* -10000 ≤ xpi, ypi ≤ 10000
* p0 ≠ p1 and p2 ≠ p3.
Input
The entire inp... | instruction | 0 | 33,292 | 23 | 66,584 |
"Correct Solution:
```
#!/usr/bin/env python3
# CGL_2_D: Segments/Lines - Distance
from math import sqrt
class Segment:
def __init__(self, p0, p1):
self.end_points = (p0, p1)
def another(self, p):
if p == self.end_points[0]:
return self.end_points[1]
else:
ret... | output | 1 | 33,292 | 23 | 66,585 |
Provide a correct Python 3 solution for this coding contest problem.
For given two segments s1 and s2, print the distance between them.
s1 is formed by end points p0 and p1, and s2 is formed by end points p2 and p3.
Constraints
* 1 ≤ q ≤ 1000
* -10000 ≤ xpi, ypi ≤ 10000
* p0 ≠ p1 and p2 ≠ p3.
Input
The entire inp... | instruction | 0 | 33,293 | 23 | 66,586 |
"Correct Solution:
```
EPS = 10**(-9)
def is_equal(a,b):
return abs(a-b) < EPS
def norm(v,i=2):
import math
ret = 0
n = len(v)
for j in range(n):
ret += abs(v[j])**i
return math.pow(ret,1/i)
class Vector(list):
"""
ベクトルクラス
対応演算子
+ : ベクトル和
- : ベクトル差
* : スカラー倍... | output | 1 | 33,293 | 23 | 66,587 |
Provide a correct Python 3 solution for this coding contest problem.
For given two segments s1 and s2, print the distance between them.
s1 is formed by end points p0 and p1, and s2 is formed by end points p2 and p3.
Constraints
* 1 ≤ q ≤ 1000
* -10000 ≤ xpi, ypi ≤ 10000
* p0 ≠ p1 and p2 ≠ p3.
Input
The entire inp... | instruction | 0 | 33,294 | 23 | 66,588 |
"Correct Solution:
```
import sys
from collections import namedtuple
from itertools import starmap
readline = sys.stdin.readline
EPS = 1e-9
class Segment(object):
__slots__ = ('fi', 'se')
def __init__(self, fi, se):
self.fi = fi
self.se = se
def cross(a, b):
return a.real * b.imag - a.imag *... | output | 1 | 33,294 | 23 | 66,589 |
Provide a correct Python 3 solution for this coding contest problem.
For given two segments s1 and s2, print the distance between them.
s1 is formed by end points p0 and p1, and s2 is formed by end points p2 and p3.
Constraints
* 1 ≤ q ≤ 1000
* -10000 ≤ xpi, ypi ≤ 10000
* p0 ≠ p1 and p2 ≠ p3.
Input
The entire inp... | instruction | 0 | 33,295 | 23 | 66,590 |
"Correct Solution:
```
#! /usr/bin/env python3
from typing import List, Tuple
from math import sqrt
EPS = 1e-10
def float_equal(x: float, y: float) -> bool:
return abs(x - y) < EPS
class Point:
def __init__(self, x: float=0.0, y: float=0.0) -> None:
self.x = x
self.y = y
def __repr__... | output | 1 | 33,295 | 23 | 66,591 |
Provide a correct Python 3 solution for this coding contest problem.
For given two segments s1 and s2, print the distance between them.
s1 is formed by end points p0 and p1, and s2 is formed by end points p2 and p3.
Constraints
* 1 ≤ q ≤ 1000
* -10000 ≤ xpi, ypi ≤ 10000
* p0 ≠ p1 and p2 ≠ p3.
Input
The entire inp... | instruction | 0 | 33,296 | 23 | 66,592 |
"Correct Solution:
```
# coding: utf-8
# Your code here!
EPS = 0.0000000001
COUNTER_CLOCKWISE = 1
CLOCKWISE = -1
ONLINE_BACK = 2
ONLINE_FRONT = -2
ON_SEGMENT = 0
class Point:
global EPS
def __init__(self, x = 0, y = 0):
self.x = x
self.y = y
def __add__(a, b):
... | output | 1 | 33,296 | 23 | 66,593 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
For given two segments s1 and s2, print the distance between them.
s1 is formed by end points p0 and p1, and s2 is formed by end points p2 and p3.
Constraints
* 1 ≤ q ≤ 1000
* -10000 ≤ xpi, y... | instruction | 0 | 33,297 | 23 | 66,594 |
Yes | output | 1 | 33,297 | 23 | 66,595 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
For given two segments s1 and s2, print the distance between them.
s1 is formed by end points p0 and p1, and s2 is formed by end points p2 and p3.
Constraints
* 1 ≤ q ≤ 1000
* -10000 ≤ xpi, y... | instruction | 0 | 33,298 | 23 | 66,596 |
Yes | output | 1 | 33,298 | 23 | 66,597 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
For given two segments s1 and s2, print the distance between them.
s1 is formed by end points p0 and p1, and s2 is formed by end points p2 and p3.
Constraints
* 1 ≤ q ≤ 1000
* -10000 ≤ xpi, y... | instruction | 0 | 33,299 | 23 | 66,598 |
Yes | output | 1 | 33,299 | 23 | 66,599 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
For given two segments s1 and s2, print the distance between them.
s1 is formed by end points p0 and p1, and s2 is formed by end points p2 and p3.
Constraints
* 1 ≤ q ≤ 1000
* -10000 ≤ xpi, y... | instruction | 0 | 33,300 | 23 | 66,600 |
Yes | output | 1 | 33,300 | 23 | 66,601 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
For given two segments s1 and s2, print the distance between them.
s1 is formed by end points p0 and p1, and s2 is formed by end points p2 and p3.
Constraints
* 1 ≤ q ≤ 1000
* -10000 ≤ xpi, y... | instruction | 0 | 33,301 | 23 | 66,602 |
No | output | 1 | 33,301 | 23 | 66,603 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
For given two segments s1 and s2, print the distance between them.
s1 is formed by end points p0 and p1, and s2 is formed by end points p2 and p3.
Constraints
* 1 ≤ q ≤ 1000
* -10000 ≤ xpi, y... | instruction | 0 | 33,302 | 23 | 66,604 |
No | output | 1 | 33,302 | 23 | 66,605 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
For given two segments s1 and s2, print the distance between them.
s1 is formed by end points p0 and p1, and s2 is formed by end points p2 and p3.
Constraints
* 1 ≤ q ≤ 1000
* -10000 ≤ xpi, y... | instruction | 0 | 33,303 | 23 | 66,606 |
No | output | 1 | 33,303 | 23 | 66,607 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
For given two segments s1 and s2, print the distance between them.
s1 is formed by end points p0 and p1, and s2 is formed by end points p2 and p3.
Constraints
* 1 ≤ q ≤ 1000
* -10000 ≤ xpi, y... | instruction | 0 | 33,304 | 23 | 66,608 |
No | output | 1 | 33,304 | 23 | 66,609 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya has got three integers n, m and k. He'd like to find three integer points (x_1, y_1), (x_2, y_2), (x_3, y_3), such that 0 ≤ x_1, x_2, x_3 ≤ n, 0 ≤ y_1, y_2, y_3 ≤ m and the area of the triangle formed by these points is equal to nm/k.
... | instruction | 0 | 33,336 | 23 | 66,672 |
Tags: geometry, number theory
Correct Solution:
```
def check(d1, k1, d2, k2):
n1 = n*k1 // d1
m1 = m*k2 // d2
if n1 * m1 == 2 * n * m // k and n1 <= n and m1 <= m:
print("YES")
print(0, 0)
print(n1, 0)
print(0, m1)
exit()
read = lambda: map(int, input().split(... | output | 1 | 33,336 | 23 | 66,673 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya has got three integers n, m and k. He'd like to find three integer points (x_1, y_1), (x_2, y_2), (x_3, y_3), such that 0 ≤ x_1, x_2, x_3 ≤ n, 0 ≤ y_1, y_2, y_3 ≤ m and the area of the triangle formed by these points is equal to nm/k.
... | instruction | 0 | 33,337 | 23 | 66,674 |
Tags: geometry, number theory
Correct Solution:
```
def gcd(a, b):
if a==0:
return b
elif b==0:
return a
else:
if a>b:
return gcd (a%b, b)
else:
return gcd (a, b%a)
n, m, k = map(int, input().split())
n1, m1, k1=n, m, k
f=0
if (2*m*n)%k!=0:
print ("NO")
else:
f=0
if k%2==0:
... | output | 1 | 33,337 | 23 | 66,675 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya has got three integers n, m and k. He'd like to find three integer points (x_1, y_1), (x_2, y_2), (x_3, y_3), such that 0 ≤ x_1, x_2, x_3 ≤ n, 0 ≤ y_1, y_2, y_3 ≤ m and the area of the triangle formed by these points is equal to nm/k.
... | instruction | 0 | 33,338 | 23 | 66,676 |
Tags: geometry, number theory
Correct Solution:
```
from collections import Counter as __Counter
import sys as __sys
def find_points_vasya_want(size_x, size_y, k):
if 2*size_x*size_y % k != 0:
raise ValueError("can't make such triangle")
size_x_factors = __represent_as_prime_factors(size_x)
s... | output | 1 | 33,338 | 23 | 66,677 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya has got three integers n, m and k. He'd like to find three integer points (x_1, y_1), (x_2, y_2), (x_3, y_3), such that 0 ≤ x_1, x_2, x_3 ≤ n, 0 ≤ y_1, y_2, y_3 ≤ m and the area of the triangle formed by these points is equal to nm/k.
... | instruction | 0 | 33,339 | 23 | 66,678 |
Tags: geometry, number theory
Correct Solution:
```
from collections import defaultdict
def generate(factors, arr, ind, current):
if ind == len(arr):
factors.add(current)
return
num = 1
for i in range(arr[ind][1]+1):
generate(factors, arr, ind+1, current*num)
num *= arr[ind][0]
n, m, k = map(int, input().s... | output | 1 | 33,339 | 23 | 66,679 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya has got three integers n, m and k. He'd like to find three integer points (x_1, y_1), (x_2, y_2), (x_3, y_3), such that 0 ≤ x_1, x_2, x_3 ≤ n, 0 ≤ y_1, y_2, y_3 ≤ m and the area of the triangle formed by these points is equal to nm/k.
... | instruction | 0 | 33,340 | 23 | 66,680 |
Tags: geometry, number theory
Correct Solution:
```
from math import gcd
n,m,k=map(int,input().split())
tt,pp=n,m
xx=gcd(n,k)
k=k//xx
n=n//xx
xx=gcd(m,k)
k=k//xx
m=m//xx
if k>2:
print('NO')
else:
if k==1:
x=0
print('YES')
print(0,0)
if 2*n<=tt:
print(2*n,0)
... | output | 1 | 33,340 | 23 | 66,681 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya has got three integers n, m and k. He'd like to find three integer points (x_1, y_1), (x_2, y_2), (x_3, y_3), such that 0 ≤ x_1, x_2, x_3 ≤ n, 0 ≤ y_1, y_2, y_3 ≤ m and the area of the triangle formed by these points is equal to nm/k.
... | instruction | 0 | 33,341 | 23 | 66,682 |
Tags: geometry, number theory
Correct Solution:
```
from sys import stdin
input=lambda : stdin.readline().strip()
lin=lambda :list(map(int,input().split()))
iin=lambda :int(input())
main=lambda :map(int,input().split())
from math import ceil,sqrt,factorial,log
from collections import deque
from bisect import bisect_lef... | output | 1 | 33,341 | 23 | 66,683 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya has got three integers n, m and k. He'd like to find three integer points (x_1, y_1), (x_2, y_2), (x_3, y_3), such that 0 ≤ x_1, x_2, x_3 ≤ n, 0 ≤ y_1, y_2, y_3 ≤ m and the area of the triangle formed by these points is equal to nm/k.
... | instruction | 0 | 33,342 | 23 | 66,684 |
Tags: geometry, number theory
Correct Solution:
```
n, m, k = map(int, input().split())
n1 = n
def gcd(a, b):
if b == 0:
return a
else:
return gcd(b, a % b)
n, k = n // gcd(n, k), k // gcd(n, k)
m, k = m // gcd(m, k), k // gcd(m, k)
if 2 < k:
print("NO")
elif 2 == k:
print("YES")
... | output | 1 | 33,342 | 23 | 66,685 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya has got three integers n, m and k. He'd like to find three integer points (x_1, y_1), (x_2, y_2), (x_3, y_3), such that 0 ≤ x_1, x_2, x_3 ≤ n, 0 ≤ y_1, y_2, y_3 ≤ m and the area of the triangle formed by these points is equal to nm/k.
... | instruction | 0 | 33,343 | 23 | 66,686 |
Tags: geometry, number theory
Correct Solution:
```
def factorization(n):
ans = []
while (n % 2 == 0):
n //= 2
yield 2
d = 3
while d * d <= n:
while n % d == 0:
n //= d
yield d
d += 2
if n > 1:
yield n
def solve1(n, m, k):
kmod2 =... | output | 1 | 33,343 | 23 | 66,687 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vasya has got three integers n, m and k. He'd like to find three integer points (x_1, y_1), (x_2, y_2), (x_3, y_3), such that 0 ≤ x_1, x_2, x_3 ≤ n, 0 ≤ y_1, y_2, y_3 ≤ m and the area of the tri... | instruction | 0 | 33,344 | 23 | 66,688 |
Yes | output | 1 | 33,344 | 23 | 66,689 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vasya has got three integers n, m and k. He'd like to find three integer points (x_1, y_1), (x_2, y_2), (x_3, y_3), such that 0 ≤ x_1, x_2, x_3 ≤ n, 0 ≤ y_1, y_2, y_3 ≤ m and the area of the tri... | instruction | 0 | 33,345 | 23 | 66,690 |
Yes | output | 1 | 33,345 | 23 | 66,691 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.