message stringlengths 2 44.5k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 276 109k | cluster float64 23 23 | __index_level_0__ int64 552 217k |
|---|---|---|---|---|---|
Provide a correct Python 3 solution for this coding contest problem.
There is a grid with R rows and C columns. We call the cell in the r-th row and c-th column (r,c).
Mr. Takahashi wrote non-negative integers into N of the cells, that is, he wrote a non-negative integer a_i into (r_i,c_i) for each i (1≤i≤N). After t... | instruction | 0 | 90,831 | 23 | 181,662 |
"Correct Solution:
```
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# D-Grid and Integers
from collections import defaultdict
import sys
sys.setrecursionlimit(10**6)
def ReadInput():
return [int(i) for i in input().split(" ")]
(R, C) = ReadInput()
N = int(input())
VectorSet = set()
Grid = defaultdict(list)
for i... | output | 1 | 90,831 | 23 | 181,663 |
Provide a correct Python 3 solution for this coding contest problem.
There is a grid with R rows and C columns. We call the cell in the r-th row and c-th column (r,c).
Mr. Takahashi wrote non-negative integers into N of the cells, that is, he wrote a non-negative integer a_i into (r_i,c_i) for each i (1≤i≤N). After t... | instruction | 0 | 90,832 | 23 | 181,664 |
"Correct Solution:
```
import sys
readline = sys.stdin.readline
class UFP():
def __init__(self, num):
self.par = [-1]*num
self.dist = [0]*num
def find(self, x):
if self.par[x] < 0:
return x
else:
res = 0
xo = x
while self.par[x] >= ... | output | 1 | 90,832 | 23 | 181,665 |
Provide a correct Python 3 solution for this coding contest problem.
There is a grid with R rows and C columns. We call the cell in the r-th row and c-th column (r,c).
Mr. Takahashi wrote non-negative integers into N of the cells, that is, he wrote a non-negative integer a_i into (r_i,c_i) for each i (1≤i≤N). After t... | instruction | 0 | 90,833 | 23 | 181,666 |
"Correct Solution:
```
from collections import defaultdict
import sys
sys.setrecursionlimit(10**6)
def ReadInput():
return [int(i) for i in input().split(" ")]
(R, C) = ReadInput()
N = int(input())
VectorSet = set()
Grid = defaultdict(list)
for i in range(N):
(r, c, a) = ReadInput()
Grid[("R", r)].append((("C", c),... | output | 1 | 90,833 | 23 | 181,667 |
Provide a correct Python 3 solution for this coding contest problem.
There is a grid with R rows and C columns. We call the cell in the r-th row and c-th column (r,c).
Mr. Takahashi wrote non-negative integers into N of the cells, that is, he wrote a non-negative integer a_i into (r_i,c_i) for each i (1≤i≤N). After t... | instruction | 0 | 90,834 | 23 | 181,668 |
"Correct Solution:
```
import sys
input = sys.stdin.readline
R, C = map(int, input().split())
n = int(input())
G = [[] for _ in range(R+C)]
for _ in range(n):
r, c, a = map(int, input().split())
r -= 1
c -= 1
G[r].append((R+c, a))
G[R+c].append((r, a))
D = [-1]*(R+C)
def dfs(v):
rmin, cmin = float("inf"), f... | output | 1 | 90,834 | 23 | 181,669 |
Provide a correct Python 3 solution for this coding contest problem.
There is a grid with R rows and C columns. We call the cell in the r-th row and c-th column (r,c).
Mr. Takahashi wrote non-negative integers into N of the cells, that is, he wrote a non-negative integer a_i into (r_i,c_i) for each i (1≤i≤N). After t... | instruction | 0 | 90,835 | 23 | 181,670 |
"Correct Solution:
```
from sys import exit, setrecursionlimit
from functools import reduce
from itertools import *
from collections import defaultdict
def read():
return int(input())
def reads():
return [int(x) for x in input().split()]
setrecursionlimit(1000000)
(R, C) = reads()
N = read()
d = defaultdict(li... | output | 1 | 90,835 | 23 | 181,671 |
Provide a correct Python 3 solution for this coding contest problem.
There is a grid with R rows and C columns. We call the cell in the r-th row and c-th column (r,c).
Mr. Takahashi wrote non-negative integers into N of the cells, that is, he wrote a non-negative integer a_i into (r_i,c_i) for each i (1≤i≤N). After t... | instruction | 0 | 90,836 | 23 | 181,672 |
"Correct Solution:
```
import sys
sys.setrecursionlimit(10**6)
class Edge:
def __init__(self, v1, v2, w):
self.v1 = v1
self.v2 = v2
self.w = w
def __repr__(self):
return 'Edges({},{},{})'.format(self.v1, self.v2, self.w)
def dfs(edges, v, visited, i, m, r):
m[0 if i<r else 1] = min(m[0 if i<r else 1], v[i]... | output | 1 | 90,836 | 23 | 181,673 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a grid with R rows and C columns. We call the cell in the r-th row and c-th column (r,c).
Mr. Takahashi wrote non-negative integers into N of the cells, that is, he wrote a non-negativ... | instruction | 0 | 90,838 | 23 | 181,676 |
Yes | output | 1 | 90,838 | 23 | 181,677 |
Provide a correct Python 3 solution for this coding contest problem.
The fundamental idea in the JPEG compression algorithm is to sort coeffi- cient of given image by zigzag path and encode it. In this problem, we don’t discuss about details of the algorithm, but you are asked to make simple pro- gram. You are given s... | instruction | 0 | 90,878 | 23 | 181,756 |
"Correct Solution:
```
import sys
def p(t):
for l in t:
for n in l:
print("{0:>3}".format(n),end="")
print("")
c = 0
for n in sys.stdin:
n = int(n)
if n == 0:
break
t = [ [ 0 for _ in range(n) ] for _ in range(n) ]
c += 1
print("Case {}:".format(c))
... | output | 1 | 90,878 | 23 | 181,757 |
Provide a correct Python 3 solution for this coding contest problem.
The fundamental idea in the JPEG compression algorithm is to sort coeffi- cient of given image by zigzag path and encode it. In this problem, we don’t discuss about details of the algorithm, but you are asked to make simple pro- gram. You are given s... | instruction | 0 | 90,880 | 23 | 181,760 |
"Correct Solution:
```
case = 1
while True:
n = int(input())
if not n:
break
jpeg = [[0] * n for _ in range(n)]
n1 = n - 1
px, cur = [0, 0], 1
while px[0] < n:
i, j = px
jpeg[i][j] = cur
odd = (i + j) % 2
if px[not odd] == n1:
px[odd] += 1
... | output | 1 | 90,880 | 23 | 181,761 |
Provide a correct Python 3 solution for this coding contest problem.
The fundamental idea in the JPEG compression algorithm is to sort coeffi- cient of given image by zigzag path and encode it. In this problem, we don’t discuss about details of the algorithm, but you are asked to make simple pro- gram. You are given s... | instruction | 0 | 90,881 | 23 | 181,762 |
"Correct Solution:
```
# AOJ 1007: JPEG Compression
# Python3 2018.7.5 bal4u
import sys
from sys import stdin
input = stdin.readline
cno = 0
while True:
n = int(input())
if n == 0: break
cno += 1
a = [[0 for j in range(12)] for i in range(12)]
m = k = f = 1;
while True:
if f:
for r in range(k-1, -1, -1):
... | output | 1 | 90,881 | 23 | 181,763 |
Provide a correct Python 3 solution for this coding contest problem.
The fundamental idea in the JPEG compression algorithm is to sort coeffi- cient of given image by zigzag path and encode it. In this problem, we don’t discuss about details of the algorithm, but you are asked to make simple pro- gram. You are given s... | instruction | 0 | 90,882 | 23 | 181,764 |
"Correct Solution:
```
t = 1
while 1:
N = int(input())
if N == 0:
break
print("Case %d:" % t); t += 1
M = [[0]*N for i in range(N)]
c = 1
for i in range(2*N-1):
for j in range(max(i-N+1, 0), min(N, i+1)):
if i % 2 == 0:
M[i-j][j] = "%3d" % c
... | output | 1 | 90,882 | 23 | 181,765 |
Provide a correct Python 3 solution for this coding contest problem.
Write a program which prints the central coordinate ($cx$,$cy$) and the radius $r$ of a circumscribed circle of a triangle which is constructed by three points ($x_1$, $y_1$), ($x_2$, $y_2$) and ($x_3$, $y_3$) on the plane surface.
Constraints
* $-... | instruction | 0 | 90,936 | 23 | 181,872 |
"Correct Solution:
```
from decimal import Decimal
x1, y1 = map(str, input().split())
x2, y2 = map(str, input().split())
x3, y3 = map(str, input().split())
x1, y1 = Decimal(x1), Decimal(y1)
x2, y2 = Decimal(x2), Decimal(y2)
x3, y3 = Decimal(x3), Decimal(y3)
#3辺の長さ
a = (((x1-x2)**Decimal('2'))+((y1-y2)**Decimal('2')))... | output | 1 | 90,936 | 23 | 181,873 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given an array a of length n and array b of length m both consisting of only integers 0 and 1. Consider a matrix c of size n × m formed by following rule: c_{i, j} = a_i ⋅ b_j (i.e. a_i multiplied by b_j). It's easy to see that c con... | instruction | 0 | 91,050 | 23 | 182,100 |
Tags: binary search, greedy, implementation
Correct Solution:
```
import math, collections, sys
input = sys.stdin.readline
factors = set()
def Divisors(n):
i = 1
while i <= math.sqrt(n):
if (n % i == 0):
factors.add(i)
factors.add(n//i)
i+=1
n, m, k = map(int, input().sp... | output | 1 | 91,050 | 23 | 182,101 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given an array a of length n and array b of length m both consisting of only integers 0 and 1. Consider a matrix c of size n × m formed by following rule: c_{i, j} = a_i ⋅ b_j (i.e. a_i multiplied by b_j). It's easy to see that c con... | instruction | 0 | 91,051 | 23 | 182,102 |
Tags: binary search, greedy, implementation
Correct Solution:
```
from sys import stdin
from math import sqrt, factorial, ceil
from collections import Counter, defaultdict
from heapq import heapify, heapreplace, heappush, heappop
from bisect import bisect_left
# def fac(n):
# f = []
# for i in range(1, int(sq... | output | 1 | 91,051 | 23 | 182,103 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given an array a of length n and array b of length m both consisting of only integers 0 and 1. Consider a matrix c of size n × m formed by following rule: c_{i, j} = a_i ⋅ b_j (i.e. a_i multiplied by b_j). It's easy to see that c con... | instruction | 0 | 91,052 | 23 | 182,104 |
Tags: binary search, greedy, implementation
Correct Solution:
```
from bisect import bisect_left as bl, bisect_right as br, insort
import sys
import heapq
from math import *
from collections import defaultdict as dd, deque
def data(): return sys.stdin.readline().strip()
def mdata(): return map(int, data().split())
#sys... | output | 1 | 91,052 | 23 | 182,105 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given an array a of length n and array b of length m both consisting of only integers 0 and 1. Consider a matrix c of size n × m formed by following rule: c_{i, j} = a_i ⋅ b_j (i.e. a_i multiplied by b_j). It's easy to see that c con... | instruction | 0 | 91,053 | 23 | 182,106 |
Tags: binary search, greedy, implementation
Correct Solution:
```
import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
ORDA = 97
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return list(map(int, input().split()))... | output | 1 | 91,053 | 23 | 182,107 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given an array a of length n and array b of length m both consisting of only integers 0 and 1. Consider a matrix c of size n × m formed by following rule: c_{i, j} = a_i ⋅ b_j (i.e. a_i multiplied by b_j). It's easy to see that c con... | instruction | 0 | 91,054 | 23 | 182,108 |
Tags: binary search, greedy, implementation
Correct Solution:
```
import sys
input = sys.stdin.readline
from collections import *
n, m, k = map(int, input().split())
a = list(map(int, input().split()))+[0]
b = list(map(int, input().split()))+[0]
cnt1 = [0]*(n+1)
now = 0
for i in range(n+1):
if a[i]==0:
fo... | output | 1 | 91,054 | 23 | 182,109 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given an array a of length n and array b of length m both consisting of only integers 0 and 1. Consider a matrix c of size n × m formed by following rule: c_{i, j} = a_i ⋅ b_j (i.e. a_i multiplied by b_j). It's easy to see that c con... | instruction | 0 | 91,055 | 23 | 182,110 |
Tags: binary search, greedy, implementation
Correct Solution:
```
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a_lenths = {}
curr_len = 0
for i in range(len(a)):
if a[i] == 1:
curr_len += 1
else:
a_lenths[curr_len] = a_lenths.get(curr_len, 0) + 1
c... | output | 1 | 91,055 | 23 | 182,111 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given an array a of length n and array b of length m both consisting of only integers 0 and 1. Consider a matrix c of size n × m formed by following rule: c_{i, j} = a_i ⋅ b_j (i.e. a_i multiplied by b_j). It's easy to see that c con... | instruction | 0 | 91,056 | 23 | 182,112 |
Tags: binary search, greedy, implementation
Correct Solution:
```
#!/usr/bin/env python3
import io, os
from sys import setrecursionlimit
from collections import defaultdict
from itertools import groupby
input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
def rint():
return map(int, input().split())
def o... | output | 1 | 91,056 | 23 | 182,113 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given an array a of length n and array b of length m both consisting of only integers 0 and 1. Consider a matrix c of size n × m formed by following rule: c_{i, j} = a_i ⋅ b_j (i.e. a_i multiplied by b_j). It's easy to see that c con... | instruction | 0 | 91,057 | 23 | 182,114 |
Tags: binary search, greedy, implementation
Correct Solution:
```
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
aa=[]
bb=[]
c=0
f=0
for i in range(n):
if(a[i]==1):
if(f==0):
c=1
f=1
else:
c+=1
else:... | output | 1 | 91,057 | 23 | 182,115 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given an array a of length n and array b of length m both consisting of only integers 0 and 1. Consider a matrix c of size n × m formed by following rule: c_{i, j} = a_i ⋅ b_j (i.e. a_i ... | instruction | 0 | 91,058 | 23 | 182,116 |
Yes | output | 1 | 91,058 | 23 | 182,117 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given an array a of length n and array b of length m both consisting of only integers 0 and 1. Consider a matrix c of size n × m formed by following rule: c_{i, j} = a_i ⋅ b_j (i.e. a_i ... | instruction | 0 | 91,059 | 23 | 182,118 |
Yes | output | 1 | 91,059 | 23 | 182,119 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given an array a of length n and array b of length m both consisting of only integers 0 and 1. Consider a matrix c of size n × m formed by following rule: c_{i, j} = a_i ⋅ b_j (i.e. a_i ... | instruction | 0 | 91,060 | 23 | 182,120 |
Yes | output | 1 | 91,060 | 23 | 182,121 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given an array a of length n and array b of length m both consisting of only integers 0 and 1. Consider a matrix c of size n × m formed by following rule: c_{i, j} = a_i ⋅ b_j (i.e. a_i ... | instruction | 0 | 91,061 | 23 | 182,122 |
Yes | output | 1 | 91,061 | 23 | 182,123 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given an array a of length n and array b of length m both consisting of only integers 0 and 1. Consider a matrix c of size n × m formed by following rule: c_{i, j} = a_i ⋅ b_j (i.e. a_i ... | instruction | 0 | 91,062 | 23 | 182,124 |
No | output | 1 | 91,062 | 23 | 182,125 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given an array a of length n and array b of length m both consisting of only integers 0 and 1. Consider a matrix c of size n × m formed by following rule: c_{i, j} = a_i ⋅ b_j (i.e. a_i ... | instruction | 0 | 91,063 | 23 | 182,126 |
No | output | 1 | 91,063 | 23 | 182,127 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given an array a of length n and array b of length m both consisting of only integers 0 and 1. Consider a matrix c of size n × m formed by following rule: c_{i, j} = a_i ⋅ b_j (i.e. a_i ... | instruction | 0 | 91,064 | 23 | 182,128 |
No | output | 1 | 91,064 | 23 | 182,129 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given an array a of length n and array b of length m both consisting of only integers 0 and 1. Consider a matrix c of size n × m formed by following rule: c_{i, j} = a_i ⋅ b_j (i.e. a_i ... | instruction | 0 | 91,065 | 23 | 182,130 |
No | output | 1 | 91,065 | 23 | 182,131 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Pashmak has fallen in love with an attractive girl called Parmida since one year ago...
Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that t... | instruction | 0 | 91,275 | 23 | 182,550 |
Tags: implementation
Correct Solution:
```
x1,y1,x2,y2=input().split()
x1,y1,x2,y2=[int(x1),int(y1),int(x2),int(y2)]
s1=abs(x2-x1)
s2=abs(y2-y1)
if(s1!=s2 and s1!=0 and s2!=0):
print("-1")
else:
if(x1==x2):
print(s2+x1,y1,s2+x2,y2)
elif(y1==y2):
print(x1,s1+y1,x2,s1+y2)
else:
pr... | output | 1 | 91,275 | 23 | 182,551 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Pashmak has fallen in love with an attractive girl called Parmida since one year ago...
Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that t... | instruction | 0 | 91,276 | 23 | 182,552 |
Tags: implementation
Correct Solution:
```
__author__ = 'myduomilia'
x1, y1, x2, y2 = list(map(int, input().split()))
b = False
if x1 != x2 and y1 != y2 and abs(x1 - x2) != abs(y1 - y2):
print(-1)
elif x1 == x2:
print(x1 + abs(y1 - y2), y1, x2 + abs(y1 - y2), y2)
elif y1 == y2:
print(x1, y1 + abs(x1 - x2),... | output | 1 | 91,276 | 23 | 182,553 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Pashmak has fallen in love with an attractive girl called Parmida since one year ago...
Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that t... | instruction | 0 | 91,277 | 23 | 182,554 |
Tags: implementation
Correct Solution:
```
x1,y1,x2,y2 = map(int,input().split())
a = abs(x2 - x1)
b = abs(y2 - y1)
g = (((a * a) + (b * b)) ** 0.5)
if ((a == 0) or (b == 0)):
g = (((a * a) + (b * b)) ** 0.5)
if (a == 0):
x3 = x1 + g
x4 = x2 + g
y3 = y1
y4 = y2
elif (b == 0):... | output | 1 | 91,277 | 23 | 182,555 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Pashmak has fallen in love with an attractive girl called Parmida since one year ago...
Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that t... | instruction | 0 | 91,278 | 23 | 182,556 |
Tags: implementation
Correct Solution:
```
x1,y1,x2,y2=map(int,input().split())
if x1==x2:
Dist=abs(y1-y2)
NewX=x1+Dist
print(NewX,y1,NewX,y2)
elif y1==y2:
Dist=abs(x1-x2)
NewY=y1+Dist
print(x1,NewY,x2,NewY)
else:
if(abs(y2-y1)/abs(x2-x1)==1):
print(x1,y2,x2,y1)
else:
pri... | output | 1 | 91,278 | 23 | 182,557 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Pashmak has fallen in love with an attractive girl called Parmida since one year ago...
Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that t... | instruction | 0 | 91,279 | 23 | 182,558 |
Tags: implementation
Correct Solution:
```
x1,y1,x2,y2=map(int,input().split())
t=abs(x1-x2)
a=abs(y1-y2)
if a!=t and t and a:
print(-1)
else:
if t==0:
print(x1+a,y1,x1+a,y2)
elif a==0:
print(x1,y1+t,x2,y1+t)
else:
print(x1,y2,x2,y1)
``` | output | 1 | 91,279 | 23 | 182,559 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Pashmak has fallen in love with an attractive girl called Parmida since one year ago...
Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that t... | instruction | 0 | 91,280 | 23 | 182,560 |
Tags: implementation
Correct Solution:
```
x1,y1,x2,y2=map(int,input().split())
if abs(x2-x1)==abs(y2-y1):
print(x1,y2,x2,y1)
elif abs(y2-y1)==0 :
print(max(x2,x1),abs(x2-x1)+y1,min(x2,x1),abs(x2-x1)+y1)
elif abs(x2-x1)==0:
print(abs(y2-y1)+x1,min(y2,y1),abs(y2-y1)+x1,max(y2,y1))
else:
print(-1)
``... | output | 1 | 91,280 | 23 | 182,561 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Pashmak has fallen in love with an attractive girl called Parmida since one year ago...
Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that t... | instruction | 0 | 91,281 | 23 | 182,562 |
Tags: implementation
Correct Solution:
```
ip = input()
ip = ip.split(" ")
x1 = int(ip[0])
y1 = int(ip[1])
x2 = int(ip[2])
y2 = int(ip[3])
possible = True
if x1 == x2 and y1 != y2:
s = y2 - y1
x3 = x1 + s
y3 = y1
x4 = x2 + s
y4 = y2
elif x1 != x2 and y1 == y2:
s = x2 - x1
y3 = y1 + s
x3 ... | output | 1 | 91,281 | 23 | 182,563 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Pashmak has fallen in love with an attractive girl called Parmida since one year ago...
Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that t... | instruction | 0 | 91,282 | 23 | 182,564 |
Tags: implementation
Correct Solution:
```
a,b,c,d=map(int,input().split())
r=abs(a-c if a!=c else b-d)
if a-c!=0 and abs(a-c)!=r or b-d!=0 and abs(b-d)!=r:print(-1)
elif a==c:print(a-r,b,c-r,d)
elif b==d:print(a,b-r,c,d-r)
else:print(a,d,c,b)
``` | output | 1 | 91,282 | 23 | 182,565 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Pashmak has fallen in love with an attractive girl called Parmida since one year ago...
Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgott... | instruction | 0 | 91,283 | 23 | 182,566 |
Yes | output | 1 | 91,283 | 23 | 182,567 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Pashmak has fallen in love with an attractive girl called Parmida since one year ago...
Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgott... | instruction | 0 | 91,284 | 23 | 182,568 |
Yes | output | 1 | 91,284 | 23 | 182,569 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Pashmak has fallen in love with an attractive girl called Parmida since one year ago...
Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgott... | instruction | 0 | 91,285 | 23 | 182,570 |
Yes | output | 1 | 91,285 | 23 | 182,571 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Pashmak has fallen in love with an attractive girl called Parmida since one year ago...
Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgott... | instruction | 0 | 91,286 | 23 | 182,572 |
Yes | output | 1 | 91,286 | 23 | 182,573 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Pashmak has fallen in love with an attractive girl called Parmida since one year ago...
Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgott... | instruction | 0 | 91,287 | 23 | 182,574 |
No | output | 1 | 91,287 | 23 | 182,575 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Pashmak has fallen in love with an attractive girl called Parmida since one year ago...
Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgott... | instruction | 0 | 91,288 | 23 | 182,576 |
No | output | 1 | 91,288 | 23 | 182,577 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Pashmak has fallen in love with an attractive girl called Parmida since one year ago...
Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgott... | instruction | 0 | 91,289 | 23 | 182,578 |
No | output | 1 | 91,289 | 23 | 182,579 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Pashmak has fallen in love with an attractive girl called Parmida since one year ago...
Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgott... | instruction | 0 | 91,290 | 23 | 182,580 |
No | output | 1 | 91,290 | 23 | 182,581 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One of Timofey's birthday presents is a colourbook in a shape of an infinite plane. On the plane n rectangles with sides parallel to coordinate axes are situated. All sides of the rectangles have odd length. Rectangles cannot intersect, but ... | instruction | 0 | 91,333 | 23 | 182,666 |
Tags: constructive algorithms, geometry
Correct Solution:
```
n=int(input())
print("YES")
while n:
(x,y,a,b)=list(map(int, input().split()))
print(1+x%2+2*(y%2))
n=n-1
``` | output | 1 | 91,333 | 23 | 182,667 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One of Timofey's birthday presents is a colourbook in a shape of an infinite plane. On the plane n rectangles with sides parallel to coordinate axes are situated. All sides of the rectangles have odd length. Rectangles cannot intersect, but ... | instruction | 0 | 91,334 | 23 | 182,668 |
Tags: constructive algorithms, geometry
Correct Solution:
```
'''plan
noticed that if both upperle
'''
from sys import stdin, stdout
n = int(stdin.readline().rstrip())
# n = int(input())
coordinates = []
# for i in range(n):
# coordinates.append([int(x) % 2 for x in input().split()])
for i in range(n):
coor... | output | 1 | 91,334 | 23 | 182,669 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One of Timofey's birthday presents is a colourbook in a shape of an infinite plane. On the plane n rectangles with sides parallel to coordinate axes are situated. All sides of the rectangles have odd length. Rectangles cannot intersect, but ... | instruction | 0 | 91,335 | 23 | 182,670 |
Tags: constructive algorithms, geometry
Correct Solution:
```
n=int(input())
print("YES")
for i in range(0,n):
a=list(map(int,input().split()))
ans=2*(a[0]&1)+(a[1]&1)+1
print(ans)
``` | output | 1 | 91,335 | 23 | 182,671 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One of Timofey's birthday presents is a colourbook in a shape of an infinite plane. On the plane n rectangles with sides parallel to coordinate axes are situated. All sides of the rectangles have odd length. Rectangles cannot intersect, but ... | instruction | 0 | 91,336 | 23 | 182,672 |
Tags: constructive algorithms, geometry
Correct Solution:
```
print('YES')
for _ in range(int(input())):
a,b,c,d = map(int,input().split())
print((2*(a%2))+(b%2)+1)
``` | output | 1 | 91,336 | 23 | 182,673 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One of Timofey's birthday presents is a colourbook in a shape of an infinite plane. On the plane n rectangles with sides parallel to coordinate axes are situated. All sides of the rectangles have odd length. Rectangles cannot intersect, but ... | instruction | 0 | 91,337 | 23 | 182,674 |
Tags: constructive algorithms, geometry
Correct Solution:
```
'''plan
noticed that if both upperle
'''
from sys import stdin, stdout
from itertools import islice
# n = int(stdin.readline().rstrip())
# n = int(input())
all_lines = stdin.read().split('\n')
stdout.write('YES\n')
for line in islice(all_lines, 1, len(a... | output | 1 | 91,337 | 23 | 182,675 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One of Timofey's birthday presents is a colourbook in a shape of an infinite plane. On the plane n rectangles with sides parallel to coordinate axes are situated. All sides of the rectangles have odd length. Rectangles cannot intersect, but ... | instruction | 0 | 91,338 | 23 | 182,676 |
Tags: constructive algorithms, geometry
Correct Solution:
```
'''plan
noticed that if both upperle
'''
from sys import stdin, stdout
# n = int(stdin.readline().rstrip())
# n = int(input())
all_lines = stdin.read().split('\n')
stdout.write('YES\n')
for line in all_lines[1:-1]:
x1, y1, x2, y2 = (int(x) % 2 for x... | output | 1 | 91,338 | 23 | 182,677 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.