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 a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively.
<image>
An example of a trapezoid
Find the area of this trapezoid.
Constraints... | instruction | 0 | 30,839 | 23 | 61,678 |
Yes | output | 1 | 30,839 | 23 | 61,679 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively.
<image>
An example of a trapezoid
Find the area of this trapezoid.
Constraints... | instruction | 0 | 30,840 | 23 | 61,680 |
Yes | output | 1 | 30,840 | 23 | 61,681 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively.
<image>
An example of a trapezoid
Find the area of this trapezoid.
Constraints... | instruction | 0 | 30,841 | 23 | 61,682 |
Yes | output | 1 | 30,841 | 23 | 61,683 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively.
<image>
An example of a trapezoid
Find the area of this trapezoid.
Constraints... | instruction | 0 | 30,842 | 23 | 61,684 |
Yes | output | 1 | 30,842 | 23 | 61,685 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively.
<image>
An example of a trapezoid
Find the area of this trapezoid.
Constraints... | instruction | 0 | 30,843 | 23 | 61,686 |
No | output | 1 | 30,843 | 23 | 61,687 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively.
<image>
An example of a trapezoid
Find the area of this trapezoid.
Constraints... | instruction | 0 | 30,844 | 23 | 61,688 |
No | output | 1 | 30,844 | 23 | 61,689 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively.
<image>
An example of a trapezoid
Find the area of this trapezoid.
Constraints... | instruction | 0 | 30,845 | 23 | 61,690 |
No | output | 1 | 30,845 | 23 | 61,691 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively.
<image>
An example of a trapezoid
Find the area of this trapezoid.
Constraints... | instruction | 0 | 30,846 | 23 | 61,692 |
No | output | 1 | 30,846 | 23 | 61,693 |
Provide a correct Python 3 solution for this coding contest problem.
Mr. Yamada Springfield Tanaka was appointed as Deputy Deputy Director of the National Land Readjustment Business Bureau. Currently, his country is in the midst of a major land readjustment, and if this land readjustment can be completed smoothly, his... | instruction | 0 | 30,913 | 23 | 61,826 |
"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 | 30,913 | 23 | 61,827 |
Provide a correct Python 3 solution for this coding contest problem.
Mr. Yamada Springfield Tanaka was appointed as Deputy Deputy Director of the National Land Readjustment Business Bureau. Currently, his country is in the midst of a major land readjustment, and if this land readjustment can be completed smoothly, his... | instruction | 0 | 30,914 | 23 | 61,828 |
"Correct Solution:
```
def _f(px, py, qx, qy, rx, ry):
return (qx - px) * (ry - py) - (qy - py) * (rx - px)
def intersect(px, py, qx, qy, rx, ry, sx, sy):
f1 = _f(px, py, qx, qy, rx, ry)
f2 = _f(px, py, qx, qy, sx, sy)
f3 = _f(rx, ry, sx, sy, px, py)
f4 = _f(rx, ry, sx, sy, qx, qy)
return ... | output | 1 | 30,914 | 23 | 61,829 |
Provide a correct Python 3 solution for this coding contest problem.
Mr. Yamada Springfield Tanaka was appointed as Deputy Deputy Director of the National Land Readjustment Business Bureau. Currently, his country is in the midst of a major land readjustment, and if this land readjustment can be completed smoothly, his... | instruction | 0 | 30,915 | 23 | 61,830 |
"Correct Solution:
```
def make_line(line_str):
x1, y1, x2, y2 = map(int, line_str.split())
return (x1 + 1j * y1, x2 + 1j * y2)
def cross_point(l1, l2):
(p1, p2), (p3, p4) = l1, l2
v34, v12, v23, v31 = p4 - p3, p2 - p1, p3 - p2, p1 - p3
s1 = v34.real * v31.imag - v34.imag * v31.real
s2 = v34.r... | output | 1 | 30,915 | 23 | 61,831 |
Provide a correct Python 3 solution for this coding contest problem.
Mr. Yamada Springfield Tanaka was appointed as Deputy Deputy Director of the National Land Readjustment Business Bureau. Currently, his country is in the midst of a major land readjustment, and if this land readjustment can be completed smoothly, his... | instruction | 0 | 30,916 | 23 | 61,832 |
"Correct Solution:
```
def make_line(line_str):
x1, y1, x2, y2 = map(int, line_str.split())
return (x1 + 1j * y1, x2 + 1j * y2)
def cross_point(l1, l2):
(p1, p2), (p3, p4) = l1, l2
v34, v12, v23, v31 = p4 - p3, p2 - p1, p3 - p2, p1 - p3
s1 = v34.real * v31.imag - v34.imag * v31.real
s2 = v34.r... | output | 1 | 30,916 | 23 | 61,833 |
Provide a correct Python 3 solution for this coding contest problem.
Mr. Yamada Springfield Tanaka was appointed as Deputy Deputy Director of the National Land Readjustment Business Bureau. Currently, his country is in the midst of a major land readjustment, and if this land readjustment can be completed smoothly, his... | instruction | 0 | 30,917 | 23 | 61,834 |
"Correct Solution:
```
import math
EPS = 1e-10
def eq(a, b):
return (abs(a-b) < EPS)
def eqv(a, b):
return (eq(a.real, b.real) and eq(a.imag, b.imag))
def cross(a, b):
return a.real * b.imag - a.imag * b.real
def is_intersected_ls(a1, a2, b1, b2):
return (cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1) < EPS) an... | output | 1 | 30,917 | 23 | 61,835 |
Provide a correct Python 3 solution for this coding contest problem.
Mr. Yamada Springfield Tanaka was appointed as Deputy Deputy Director of the National Land Readjustment Business Bureau. Currently, his country is in the midst of a major land readjustment, and if this land readjustment can be completed smoothly, his... | instruction | 0 | 30,918 | 23 | 61,836 |
"Correct Solution:
```
#!/usr/bin/env python
from collections import deque
import itertools as it
import sys
import math
sys.setrecursionlimit(1000000)
def gcd(a, b):
if b == 0:
return a
a1 = b
b1 = a % b
return gcd(a1, b1)
while True:
n = int(input())
if n == 0:
break
li... | output | 1 | 30,918 | 23 | 61,837 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Mr. Yamada Springfield Tanaka was appointed as Deputy Deputy Director of the National Land Readjustment Business Bureau. Currently, his country is in the midst of a major land readjustment, and ... | instruction | 0 | 30,919 | 23 | 61,838 |
No | output | 1 | 30,919 | 23 | 61,839 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Mr. Yamada Springfield Tanaka was appointed as Deputy Deputy Director of the National Land Readjustment Business Bureau. Currently, his country is in the midst of a major land readjustment, and ... | instruction | 0 | 30,920 | 23 | 61,840 |
No | output | 1 | 30,920 | 23 | 61,841 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Mr. Yamada Springfield Tanaka was appointed as Deputy Deputy Director of the National Land Readjustment Business Bureau. Currently, his country is in the midst of a major land readjustment, and ... | instruction | 0 | 30,921 | 23 | 61,842 |
No | output | 1 | 30,921 | 23 | 61,843 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Mr. Yamada Springfield Tanaka was appointed as Deputy Deputy Director of the National Land Readjustment Business Bureau. Currently, his country is in the midst of a major land readjustment, and ... | instruction | 0 | 30,922 | 23 | 61,844 |
No | output | 1 | 30,922 | 23 | 61,845 |
Provide a correct Python 3 solution for this coding contest problem.
For given two circles $c1$ and $c2$, print the coordinates of the cross points of them.
Constraints
* The given circle have at least one cross point and have different center coordinates.
* $-10,000 \leq c1x, c1y, c2x, c2y \leq 10,000$
* $1 \leq c1... | instruction | 0 | 30,929 | 23 | 61,858 |
"Correct Solution:
```
from math import sqrt
if __name__ == "__main__":
c1x, c1y, c1r = map(float, input().split())
c2x, c2y, c2r = map(float, input().split())
dx, dy = c2x - c1x, c2y - c1y
cdist = dx ** 2 + dy ** 2
a = (cdist + c1r ** 2 - c2r ** 2) / 2
df = sqrt(cdist * c1r ** 2 - a ** 2)
... | output | 1 | 30,929 | 23 | 61,859 |
Provide a correct Python 3 solution for this coding contest problem.
For given two circles $c1$ and $c2$, print the coordinates of the cross points of them.
Constraints
* The given circle have at least one cross point and have different center coordinates.
* $-10,000 \leq c1x, c1y, c2x, c2y \leq 10,000$
* $1 \leq c1... | instruction | 0 | 30,930 | 23 | 61,860 |
"Correct Solution:
```
import math
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
def __add__(self, other):
return Point(self.x + other.x, self.y + other.y)
def __sub__(self, other):
return Point(self.x - other.x, self.y - other.y)
def __mul__(self, other):... | output | 1 | 30,930 | 23 | 61,861 |
Provide a correct Python 3 solution for this coding contest problem.
For given two circles $c1$ and $c2$, print the coordinates of the cross points of them.
Constraints
* The given circle have at least one cross point and have different center coordinates.
* $-10,000 \leq c1x, c1y, c2x, c2y \leq 10,000$
* $1 \leq c1... | instruction | 0 | 30,931 | 23 | 61,862 |
"Correct Solution:
```
# -*- coding: utf-8 -*-
import collections
import math
class Vector2(collections.namedtuple("Vector2", ["x", "y"])):
def __add__(self, other):
return Vector2(self.x + other.x, self.y + other.y)
def __sub__(self, other):
return Vector2(self.x - other.x, self.y - other... | output | 1 | 30,931 | 23 | 61,863 |
Provide a correct Python 3 solution for this coding contest problem.
For given two circles $c1$ and $c2$, print the coordinates of the cross points of them.
Constraints
* The given circle have at least one cross point and have different center coordinates.
* $-10,000 \leq c1x, c1y, c2x, c2y \leq 10,000$
* $1 \leq c1... | instruction | 0 | 30,932 | 23 | 61,864 |
"Correct Solution:
```
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10 ** 9)
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
INF=float('inf')
class Geometry:
EPS = 10 ** -9
... | output | 1 | 30,932 | 23 | 61,865 |
Provide a correct Python 3 solution for this coding contest problem.
For given two circles $c1$ and $c2$, print the coordinates of the cross points of them.
Constraints
* The given circle have at least one cross point and have different center coordinates.
* $-10,000 \leq c1x, c1y, c2x, c2y \leq 10,000$
* $1 \leq c1... | instruction | 0 | 30,933 | 23 | 61,866 |
"Correct Solution:
```
# coding: utf-8
# Your code here!
import math
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... | output | 1 | 30,933 | 23 | 61,867 |
Provide a correct Python 3 solution for this coding contest problem.
For given two circles $c1$ and $c2$, print the coordinates of the cross points of them.
Constraints
* The given circle have at least one cross point and have different center coordinates.
* $-10,000 \leq c1x, c1y, c2x, c2y \leq 10,000$
* $1 \leq c1... | instruction | 0 | 30,934 | 23 | 61,868 |
"Correct Solution:
```
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_7_E
"""
import sys
from math import sqrt, atan2, acos, sin, cos
from sys import stdin
input = stdin.readline
class Point(object):
epsilon = 1e-10
def __init__(self, x=0.0, y=0.0):
if isins... | output | 1 | 30,934 | 23 | 61,869 |
Provide a correct Python 3 solution for this coding contest problem.
For given two circles $c1$ and $c2$, print the coordinates of the cross points of them.
Constraints
* The given circle have at least one cross point and have different center coordinates.
* $-10,000 \leq c1x, c1y, c2x, c2y \leq 10,000$
* $1 \leq c1... | instruction | 0 | 30,935 | 23 | 61,870 |
"Correct Solution:
```
import math
from typing import Union
class Point(object):
__slots__ = ['x', 'y']
def __init__(self, x, y):
self.x = x
self.y = y
def __add__(self, other):
return Point(self.x + other.x, self.y + other.y)
def __sub__(self, other):
return Point(s... | output | 1 | 30,935 | 23 | 61,871 |
Provide a correct Python 3 solution for this coding contest problem.
For given two circles $c1$ and $c2$, print the coordinates of the cross points of them.
Constraints
* The given circle have at least one cross point and have different center coordinates.
* $-10,000 \leq c1x, c1y, c2x, c2y \leq 10,000$
* $1 \leq c1... | instruction | 0 | 30,936 | 23 | 61,872 |
"Correct Solution:
```
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
input:
0 0 2
2 0 2
output:
1.00000000 -1.73205080 1.00000000 1.73205080
"""
import sys
from math import sin, cos, atan2, acos
from operator import attrgetter
class Circle(object):
__slots__ = ('centre', 'radius')
def __init__(self, c... | output | 1 | 30,936 | 23 | 61,873 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
For given two circles $c1$ and $c2$, print the coordinates of the cross points of them.
Constraints
* The given circle have at least one cross point and have different center coordinates.
* $-... | instruction | 0 | 30,937 | 23 | 61,874 |
Yes | output | 1 | 30,937 | 23 | 61,875 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
For given two circles $c1$ and $c2$, print the coordinates of the cross points of them.
Constraints
* The given circle have at least one cross point and have different center coordinates.
* $-... | instruction | 0 | 30,938 | 23 | 61,876 |
Yes | output | 1 | 30,938 | 23 | 61,877 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
For given two circles $c1$ and $c2$, print the coordinates of the cross points of them.
Constraints
* The given circle have at least one cross point and have different center coordinates.
* $-... | instruction | 0 | 30,939 | 23 | 61,878 |
Yes | output | 1 | 30,939 | 23 | 61,879 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
For given two circles $c1$ and $c2$, print the coordinates of the cross points of them.
Constraints
* The given circle have at least one cross point and have different center coordinates.
* $-... | instruction | 0 | 30,940 | 23 | 61,880 |
Yes | output | 1 | 30,940 | 23 | 61,881 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
For given two circles $c1$ and $c2$, print the coordinates of the cross points of them.
Constraints
* The given circle have at least one cross point and have different center coordinates.
* $-... | instruction | 0 | 30,941 | 23 | 61,882 |
No | output | 1 | 30,941 | 23 | 61,883 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
For given two circles $c1$ and $c2$, print the coordinates of the cross points of them.
Constraints
* The given circle have at least one cross point and have different center coordinates.
* $-... | instruction | 0 | 30,942 | 23 | 61,884 |
No | output | 1 | 30,942 | 23 | 61,885 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
For given two circles $c1$ and $c2$, print the coordinates of the cross points of them.
Constraints
* The given circle have at least one cross point and have different center coordinates.
* $-... | instruction | 0 | 30,943 | 23 | 61,886 |
No | output | 1 | 30,943 | 23 | 61,887 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
For given two circles $c1$ and $c2$, print the coordinates of the cross points of them.
Constraints
* The given circle have at least one cross point and have different center coordinates.
* $-... | instruction | 0 | 30,944 | 23 | 61,888 |
No | output | 1 | 30,944 | 23 | 61,889 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given some Tetris field consisting of n columns. The initial height of the i-th column of the field is a_i blocks. On top of these columns you can place only figures of size 2 × 1 (i.e. ... | instruction | 0 | 31,127 | 23 | 62,254 |
Yes | output | 1 | 31,127 | 23 | 62,255 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given some Tetris field consisting of n columns. The initial height of the i-th column of the field is a_i blocks. On top of these columns you can place only figures of size 2 × 1 (i.e. ... | instruction | 0 | 31,128 | 23 | 62,256 |
Yes | output | 1 | 31,128 | 23 | 62,257 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given some Tetris field consisting of n columns. The initial height of the i-th column of the field is a_i blocks. On top of these columns you can place only figures of size 2 × 1 (i.e. ... | instruction | 0 | 31,129 | 23 | 62,258 |
Yes | output | 1 | 31,129 | 23 | 62,259 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given some Tetris field consisting of n columns. The initial height of the i-th column of the field is a_i blocks. On top of these columns you can place only figures of size 2 × 1 (i.e. ... | instruction | 0 | 31,130 | 23 | 62,260 |
Yes | output | 1 | 31,130 | 23 | 62,261 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given some Tetris field consisting of n columns. The initial height of the i-th column of the field is a_i blocks. On top of these columns you can place only figures of size 2 × 1 (i.e. ... | instruction | 0 | 31,131 | 23 | 62,262 |
No | output | 1 | 31,131 | 23 | 62,263 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given some Tetris field consisting of n columns. The initial height of the i-th column of the field is a_i blocks. On top of these columns you can place only figures of size 2 × 1 (i.e. ... | instruction | 0 | 31,132 | 23 | 62,264 |
No | output | 1 | 31,132 | 23 | 62,265 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given some Tetris field consisting of n columns. The initial height of the i-th column of the field is a_i blocks. On top of these columns you can place only figures of size 2 × 1 (i.e. ... | instruction | 0 | 31,133 | 23 | 62,266 |
No | output | 1 | 31,133 | 23 | 62,267 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given some Tetris field consisting of n columns. The initial height of the i-th column of the field is a_i blocks. On top of these columns you can place only figures of size 2 × 1 (i.e. ... | instruction | 0 | 31,134 | 23 | 62,268 |
No | output | 1 | 31,134 | 23 | 62,269 |
Provide a correct Python 3 solution for this coding contest problem.
A tatami mat, a Japanese traditional floor cover, has a rectangular form with aspect ratio 1:2. When spreading tatami mats on a floor, it is prohibited to make a cross with the border of the tatami mats, because it is believed to bring bad luck.
You... | instruction | 0 | 31,743 | 23 | 63,486 |
"Correct Solution:
```
def solve():
H, W = map(int, input().split())
if H == 0:
return False
if H*W % 2 == 1:
print(0)
return True
state = [[-1]*W for i in range(H)]
def dfs(k):
if k == H*W:
return 1
i, j = divmod(k, W)
if state[i][j] != -1... | output | 1 | 31,743 | 23 | 63,487 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Inaka has a disc, the circumference of which is n units. The circumference is equally divided by n points numbered clockwise from 1 to n, such that points i and i + 1 (1 ≤ i < n) are adjacent, and so are points n and 1.
There are m straight... | instruction | 0 | 31,814 | 23 | 63,628 |
Tags: brute force, strings
Correct Solution:
```
from collections import defaultdict
import sys
n, m = [int(item) for item in sys.stdin.readline().strip().split()]
s = []
for _ in range(m):
s.append(sorted([int(item)
for item in sys.stdin.readline().strip().split()]))
rights = defaultdict(se... | output | 1 | 31,814 | 23 | 63,629 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Inaka has a disc, the circumference of which is n units. The circumference is equally divided by n points numbered clockwise from 1 to n, such that points i and i + 1 (1 ≤ i < n) are adjacent, and so are points n and 1.
There are m straight... | instruction | 0 | 31,815 | 23 | 63,630 |
Tags: brute force, strings
Correct Solution:
```
n, m = map(int, input().split())
a = set()
for i in range(m):
c, d = map(int, input().split())
c %= n
d %= n
a.add((min(c, d), max(c, d)))
def comprobar(x):
global a, n
b = set()
for c, d in a:
c += x
d += x
c %= n
d %= n
if (min(c, d), max(c, d)) not... | output | 1 | 31,815 | 23 | 63,631 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Inaka has a disc, the circumference of which is n units. The circumference is equally divided by n points numbered clockwise from 1 to n, such that points i and i + 1 (1 ≤ i < n) are adjacent, and so are points n and 1.
There are m straight... | instruction | 0 | 31,816 | 23 | 63,632 |
Tags: brute force, strings
Correct Solution:
```
from collections import defaultdict
import sys
n, m = [int(item) for item in sys.stdin.readline().strip().split()]
s = []
for line in sys.stdin.readlines():
s.append([int(item) for item in line.strip().split()])
divs = []
for i in range(1, n):
if n % i == 0:
... | output | 1 | 31,816 | 23 | 63,633 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Inaka has a disc, the circumference of which is n units. The circumference is equally divided by n points numbered clockwise from 1 to n, such that points i and i + 1 (1 ≤ i < n) are adjacent, and so are points n and 1.
There are m straight... | instruction | 0 | 31,817 | 23 | 63,634 |
Tags: brute force, strings
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 default... | output | 1 | 31,817 | 23 | 63,635 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Inaka has a disc, the circumference of which is n units. The circumference is equally divided by n points numbered clockwise from 1 to n, such that points i and i + 1 (1 ≤ i < n) are adjacent, and so are points n and 1.
There are m straight... | instruction | 0 | 31,818 | 23 | 63,636 |
Tags: brute force, strings
Correct Solution:
```
def gcd(x,y):
while y:
x,y = y,x%y
return x
def lcm(a,b): return (a*b)//gcd(a,b)
import io,os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
kk=lambda:map(int,input().split())
k2=lambda:map(lambda x:int(x)-1, input().split())
ll=lambda:list(kk())
n,m=k... | output | 1 | 31,818 | 23 | 63,637 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Inaka has a disc, the circumference of which is n units. The circumference is equally divided by n points numbered clockwise from 1 to n, such that points i and i + 1 (1 ≤ i < n) are adjacent, and so are points n and 1.
There are m straight... | instruction | 0 | 31,819 | 23 | 63,638 |
Tags: brute force, strings
Correct Solution:
```
"""
Satwik_Tiwari ;) .
30th july , 2020 - Thursday
"""
#===============================================================================================
#importing some useful libraries.
from __future__ import division, print_function
from fractions import Frac... | output | 1 | 31,819 | 23 | 63,639 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Inaka has a disc, the circumference of which is n units. The circumference is equally divided by n points numbered clockwise from 1 to n, such that points i and i + 1 (1 ≤ i < n) are adjacent, and so are points n and 1.
There are m straight... | instruction | 0 | 31,820 | 23 | 63,640 |
Tags: brute force, strings
Correct Solution:
```
#!/usr/bin/env python
"""<https://github.com/cheran-senthil/PyRival>"""
from __future__ import division, print_function
import os
import sys
from collections import Counter
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
from __builtin__ import xrange as... | output | 1 | 31,820 | 23 | 63,641 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.