message stringlengths 2 19.9k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 322 108k | cluster float64 15 15 | __index_level_0__ int64 644 217k |
|---|---|---|---|---|---|
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Petya loves playing with rectangles. Mom bought Petya a rectangle divided into cells n Γ m in size (containing n rows, m columns). Petya marked two different cells of the rectangle and no... | instruction | 0 | 31,810 | 15 | 63,620 |
No | output | 1 | 31,810 | 15 | 63,621 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Petya loves playing with rectangles. Mom bought Petya a rectangle divided into cells n Γ m in size (containing n rows, m columns). Petya marked two different cells of the rectangle and no... | instruction | 0 | 31,811 | 15 | 63,622 |
No | output | 1 | 31,811 | 15 | 63,623 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Petya loves playing with rectangles. Mom bought Petya a rectangle divided into cells n Γ m in size (containing n rows, m columns). Petya marked two different cells of the rectangle and no... | instruction | 0 | 31,812 | 15 | 63,624 |
No | output | 1 | 31,812 | 15 | 63,625 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Petya loves playing with rectangles. Mom bought Petya a rectangle divided into cells n Γ m in size (containing n rows, m columns). Petya marked two different cells of the rectangle and no... | instruction | 0 | 31,813 | 15 | 63,626 |
No | output | 1 | 31,813 | 15 | 63,627 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya has got a magic matrix a of size n Γ m. The rows of the matrix are numbered from 1 to n from top to bottom, the columns are numbered from 1 to m from left to right. Let a_{ij} be the element in the intersection of the i-th row and the ... | instruction | 0 | 32,508 | 15 | 65,016 |
Tags: dp, math, probabilities
Correct Solution:
```
import io, os,sys
# Trying to speed up meooows submission
a = os.read(0, os.fstat(0).st_size)
# Speed
inp = []
i = 0
numb = 0
try:
while True:
if a[i] >= b'0'[0]:
numb = 10 * numb + a[i] - 48
elif a[i] != b'\r'[0]:
inp.ap... | output | 1 | 32,508 | 15 | 65,017 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya has got a magic matrix a of size n Γ m. The rows of the matrix are numbered from 1 to n from top to bottom, the columns are numbered from 1 to m from left to right. Let a_{ij} be the element in the intersection of the i-th row and the ... | instruction | 0 | 32,509 | 15 | 65,018 |
Tags: dp, math, probabilities
Correct Solution:
```
import io, os,sys
# Trying to speed up meooows submission
a = os.read(0, os.fstat(0).st_size)
# Speed
inp = []
i = 0
numb = 0
try:
while True:
if a[i] >= b'0'[0]:
numb = 10 * numb + a[i] - 48
elif a[i] != b'\r'[0]:
inp.ap... | output | 1 | 32,509 | 15 | 65,019 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya has got a magic matrix a of size n Γ m. The rows of the matrix are numbered from 1 to n from top to bottom, the columns are numbered from 1 to m from left to right. Let a_{ij} be the element in the intersection of the i-th row and the ... | instruction | 0 | 32,510 | 15 | 65,020 |
Tags: dp, math, probabilities
Correct Solution:
```
import io
import os
import sys
# Trying to speed up c1729, which in turn is trying to speed up pajenegod's submissions
# which in turn is trying to speed up meooows code
a = os.read(0, os.fstat(0).st_size)
# Speed
inp = []
i = 0
numb = 0
try:
while True:
... | output | 1 | 32,510 | 15 | 65,021 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya has got a magic matrix a of size n Γ m. The rows of the matrix are numbered from 1 to n from top to bottom, the columns are numbered from 1 to m from left to right. Let a_{ij} be the element in the intersection of the i-th row and the ... | instruction | 0 | 32,511 | 15 | 65,022 |
Tags: dp, math, probabilities
Correct Solution:
```
import io, os,sys
# Trying to speed up meooows submission
a = os.read(0, os.fstat(0).st_size)
# Speed
inp = []
i = 0
numb = 0
try:
while True:
if a[i] >= b'0'[0]:
numb = 10 * numb + a[i] - 48
elif a[i] != b'\r'[0]:
inp.ap... | output | 1 | 32,511 | 15 | 65,023 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya has got a magic matrix a of size n Γ m. The rows of the matrix are numbered from 1 to n from top to bottom, the columns are numbered from 1 to m from left to right. Let a_{ij} be the element in the intersection of the i-th row and the ... | instruction | 0 | 32,512 | 15 | 65,024 |
Tags: dp, math, probabilities
Correct Solution:
```
import io
import os
import sys
# Trying to speed up c1729, which in turn is trying to speed up pajenegod's submissions
# which in turn is trying to speed up meooows code
a = os.read(0, os.fstat(0).st_size)
# Speed
inp = []
i = 0
numb = 0
try:
while True:
... | output | 1 | 32,512 | 15 | 65,025 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya has got a magic matrix a of size n Γ m. The rows of the matrix are numbered from 1 to n from top to bottom, the columns are numbered from 1 to m from left to right. Let a_{ij} be the element in the intersection of the i-th row and the ... | instruction | 0 | 32,513 | 15 | 65,026 |
Tags: dp, math, probabilities
Correct Solution:
```
import io
import os
import sys
# Trying to speed up c1729, which in turn is trying to speed up pajenegod's submissions
# which in turn is trying to speed up meooows code
a = os.read(0, os.fstat(0).st_size)
# Speed
inp = []
i = 0
numb = 0
try:
while True:
... | output | 1 | 32,513 | 15 | 65,027 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya has got a magic matrix a of size n Γ m. The rows of the matrix are numbered from 1 to n from top to bottom, the columns are numbered from 1 to m from left to right. Let a_{ij} be the element in the intersection of the i-th row and the ... | instruction | 0 | 32,514 | 15 | 65,028 |
Tags: dp, math, probabilities
Correct Solution:
```
import io, os,sys
# Trying to speed up meooows submission
a = os.read(0, os.fstat(0).st_size)
# Speed
inp = []
i = 0
numb = 0
try:
while True:
if a[i] >= b'0'[0]:
numb = 10 * numb + a[i] - 48
elif a[i] != b'\r'[0]:
inp.ap... | output | 1 | 32,514 | 15 | 65,029 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya has got a magic matrix a of size n Γ m. The rows of the matrix are numbered from 1 to n from top to bottom, the columns are numbered from 1 to m from left to right. Let a_{ij} be the element in the intersection of the i-th row and the ... | instruction | 0 | 32,515 | 15 | 65,030 |
Tags: dp, math, probabilities
Correct Solution:
```
import io, os,sys
# Trying to speed up meooows submission
a = os.read(0, os.fstat(0).st_size)
# Speed
inp = []
i = 0
numb = 0
try:
while True:
if a[i] >= b'0'[0]:
numb = 10 * numb + a[i] - 48
elif a[i] != b'\r'[0]:
inp.ap... | output | 1 | 32,515 | 15 | 65,031 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You stumbled upon a new kind of chess puzzles. The chessboard you are given is not necesserily 8 Γ 8, but it still is N Γ N. Each square has some number written on it, all the numbers are from 1 to N^2 and all the numbers are pairwise distin... | instruction | 0 | 32,524 | 15 | 65,048 |
Tags: dfs and similar, dp, shortest paths
Correct Solution:
```
n=int(input())
graph=[{},{},{}]
for i in range(n):
for j in range(n):
graph[0][(i,j)]=[(k,j) for k in range(n)]+[(i,k) for k in range(n)]
graph[0][(i,j)].remove((i,j))
graph[0][(i,j)].remove((i,j))
graph[1][(i,j)]=[]
... | output | 1 | 32,524 | 15 | 65,049 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You stumbled upon a new kind of chess puzzles. The chessboard you are given is not necesserily 8 Γ 8, but it still is N Γ N. Each square has some number written on it, all the numbers are from 1 to N^2 and all the numbers are pairwise distin... | instruction | 0 | 32,525 | 15 | 65,050 |
Tags: dfs and similar, dp, shortest paths
Correct Solution:
```
import sys
from math import *
def minp():
return sys.stdin.readline().strip()
n = int(minp())
m = [None]*n
k = [None]*3
dp = [None]*3
dp[0] = [None]*(n*n)
dp[1] = [None]*(n*n)
dp[2] = [None]*(n*n)
path = [None]*(n*n)
for i in range(n):
m[i] = list(map(... | output | 1 | 32,525 | 15 | 65,051 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You stumbled upon a new kind of chess puzzles. The chessboard you are given is not necesserily 8 Γ 8, but it still is N Γ N. Each square has some number written on it, all the numbers are from 1... | instruction | 0 | 32,526 | 15 | 65,052 |
No | output | 1 | 32,526 | 15 | 65,053 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You stumbled upon a new kind of chess puzzles. The chessboard you are given is not necesserily 8 Γ 8, but it still is N Γ N. Each square has some number written on it, all the numbers are from 1... | instruction | 0 | 32,527 | 15 | 65,054 |
No | output | 1 | 32,527 | 15 | 65,055 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You stumbled upon a new kind of chess puzzles. The chessboard you are given is not necesserily 8 Γ 8, but it still is N Γ N. Each square has some number written on it, all the numbers are from 1... | instruction | 0 | 32,528 | 15 | 65,056 |
No | output | 1 | 32,528 | 15 | 65,057 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You stumbled upon a new kind of chess puzzles. The chessboard you are given is not necesserily 8 Γ 8, but it still is N Γ N. Each square has some number written on it, all the numbers are from 1... | instruction | 0 | 32,529 | 15 | 65,058 |
No | output | 1 | 32,529 | 15 | 65,059 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are three cells on an infinite 2-dimensional grid, labeled A, B, and F. Find the length of the shortest path from A to B if:
* in one move you can go to any of the four adjacent cells sharing a side;
* visiting the cell F is for... | instruction | 0 | 32,771 | 15 | 65,542 |
Tags: implementation, math
Correct Solution:
```
t = int(input())
while t:
input()
xa, ya = map(int, input().split())
xb, yb = map(int, input().split())
xf, yf = map(int, input().split())
if xa == xb == xf and min(ya, yb) < yf and max(ya, yb) > yf:
print(abs(ya-yb)+2)
elif ya == yb == yf... | output | 1 | 32,771 | 15 | 65,543 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are three cells on an infinite 2-dimensional grid, labeled A, B, and F. Find the length of the shortest path from A to B if:
* in one move you can go to any of the four adjacent cells sharing a side;
* visiting the cell F is for... | instruction | 0 | 32,772 | 15 | 65,544 |
Tags: implementation, math
Correct Solution:
```
from sys import stdin, stdout
def solve(ax,ay,bx,by,fx,fy):
rx= abs(ax-bx)
ry=abs(ay-by)
if ax==bx or ay==by:
e=0
if fx in range(min(ax,bx),max(ax,bx)+1):
if fy==ay:
e+=2
if fy in range(min(ay,by), m... | output | 1 | 32,772 | 15 | 65,545 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are three cells on an infinite 2-dimensional grid, labeled A, B, and F. Find the length of the shortest path from A to B if:
* in one move you can go to any of the four adjacent cells sharing a side;
* visiting the cell F is for... | instruction | 0 | 32,773 | 15 | 65,546 |
Tags: implementation, math
Correct Solution:
```
a = int(input())
sol = []
for i in range(a):
input()
ax, ay = input().split()
bx, by = input().split()
fx, fy = input().split()
y_dist = abs(int(ay) - int(by))
x_dist = abs(int(ax) - int(bx))
sum_dist = x_dist + y_dist
if(y_dist ... | output | 1 | 32,773 | 15 | 65,547 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are three cells on an infinite 2-dimensional grid, labeled A, B, and F. Find the length of the shortest path from A to B if:
* in one move you can go to any of the four adjacent cells sharing a side;
* visiting the cell F is for... | instruction | 0 | 32,774 | 15 | 65,548 |
Tags: implementation, math
Correct Solution:
```
res = []
tests = int(input())
for j in range(tests):
a = input().split()
b = input().split()
c = input().split()
d = input().split()
a1, a2, b1, b2, f1, f2 = int(b[0]), int(b[1]), int(c[0]), int(c[1]), int(d[0]), int(d[1]),
if a1 == b1 == f1 and f... | output | 1 | 32,774 | 15 | 65,549 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are three cells on an infinite 2-dimensional grid, labeled A, B, and F. Find the length of the shortest path from A to B if:
* in one move you can go to any of the four adjacent cells sharing a side;
* visiting the cell F is for... | instruction | 0 | 32,775 | 15 | 65,550 |
Tags: implementation, math
Correct Solution:
```
t=int(input())
for _ in range(t):
input()
arr = list(map(int, input().split()))
xa=arr[0]
ya=arr[1]
arr = list(map(int, input().split()))
xb=arr[0]
yb=arr[1]
arr = list(map(int, input().split()))
xf=arr[0]
yf=arr[1]
if(xa==xb):... | output | 1 | 32,775 | 15 | 65,551 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are three cells on an infinite 2-dimensional grid, labeled A, B, and F. Find the length of the shortest path from A to B if:
* in one move you can go to any of the four adjacent cells sharing a side;
* visiting the cell F is for... | instruction | 0 | 32,776 | 15 | 65,552 |
Tags: implementation, math
Correct Solution:
```
t=int(input())
for i in range(t):
n=input()
a,b=[int(j) for j in input().split()]
c,d=[int(j) for j in input().split()]
e,f=[int(j) for j in input().split()]
path=abs(a-c)+abs(b-d)+2*((a==c==e)*(b-f)*(d-f)|(b==d==f)*(a-e)*(c-e)<0)
print(path)
``` | output | 1 | 32,776 | 15 | 65,553 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are three cells on an infinite 2-dimensional grid, labeled A, B, and F. Find the length of the shortest path from A to B if:
* in one move you can go to any of the four adjacent cells sharing a side;
* visiting the cell F is for... | instruction | 0 | 32,777 | 15 | 65,554 |
Tags: implementation, math
Correct Solution:
```
# cook your code here
import os
import sys
from math import ceil, floor, sqrt, gcd, factorial
from io import BytesIO, IOBase
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
self.buffer = By... | output | 1 | 32,777 | 15 | 65,555 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are three cells on an infinite 2-dimensional grid, labeled A, B, and F. Find the length of the shortest path from A to B if:
* in one move you can go to any of the four adjacent cells sharing a side;
* visiting the cell F is for... | instruction | 0 | 32,778 | 15 | 65,556 |
Tags: implementation, math
Correct Solution:
```
#from functools import reduce
#mod=int(1e9+7)
#import resource
#resource.setrlimit(resource.RLIMIT_STACK, [0x100000000, resource.RLIM_INFINITY])
#import threading
#threading.stack_size(2**26)
"""fact=[1]
#for i in range(1,100001):
# fact.append((fact[-1]*i)%mod)
#if... | output | 1 | 32,778 | 15 | 65,557 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are three cells on an infinite 2-dimensional grid, labeled A, B, and F. Find the length of the shortest path from A to B if:
* in one move you can go to any of the four adjacent cells ... | instruction | 0 | 32,779 | 15 | 65,558 |
Yes | output | 1 | 32,779 | 15 | 65,559 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are three cells on an infinite 2-dimensional grid, labeled A, B, and F. Find the length of the shortest path from A to B if:
* in one move you can go to any of the four adjacent cells ... | instruction | 0 | 32,780 | 15 | 65,560 |
Yes | output | 1 | 32,780 | 15 | 65,561 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are three cells on an infinite 2-dimensional grid, labeled A, B, and F. Find the length of the shortest path from A to B if:
* in one move you can go to any of the four adjacent cells ... | instruction | 0 | 32,781 | 15 | 65,562 |
Yes | output | 1 | 32,781 | 15 | 65,563 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are three cells on an infinite 2-dimensional grid, labeled A, B, and F. Find the length of the shortest path from A to B if:
* in one move you can go to any of the four adjacent cells ... | instruction | 0 | 32,782 | 15 | 65,564 |
Yes | output | 1 | 32,782 | 15 | 65,565 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are three cells on an infinite 2-dimensional grid, labeled A, B, and F. Find the length of the shortest path from A to B if:
* in one move you can go to any of the four adjacent cells ... | instruction | 0 | 32,783 | 15 | 65,566 |
No | output | 1 | 32,783 | 15 | 65,567 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are three cells on an infinite 2-dimensional grid, labeled A, B, and F. Find the length of the shortest path from A to B if:
* in one move you can go to any of the four adjacent cells ... | instruction | 0 | 32,784 | 15 | 65,568 |
No | output | 1 | 32,784 | 15 | 65,569 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are three cells on an infinite 2-dimensional grid, labeled A, B, and F. Find the length of the shortest path from A to B if:
* in one move you can go to any of the four adjacent cells ... | instruction | 0 | 32,785 | 15 | 65,570 |
No | output | 1 | 32,785 | 15 | 65,571 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are three cells on an infinite 2-dimensional grid, labeled A, B, and F. Find the length of the shortest path from A to B if:
* in one move you can go to any of the four adjacent cells ... | instruction | 0 | 32,786 | 15 | 65,572 |
No | output | 1 | 32,786 | 15 | 65,573 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today, Wet Shark is given n bishops on a 1000 by 1000 grid. Both rows and columns of the grid are numbered from 1 to 1000. Rows are numbered from top to bottom, while columns are numbered from left to right.
Wet Shark thinks that two bishop... | instruction | 0 | 32,981 | 15 | 65,962 |
Tags: combinatorics, implementation
Correct Solution:
```
n=int(input())
res=[0]*2000
resT=[0]*2000
while n!=0:
x,y=[int(p) for p in input().split()]
x-=1
y-=1
res[x+y]+=1
resT[x+999-y]+=1
n-=1
s=0
for x in range(2000):
if res[x]>1:
s+=res[x]*(res[x]-1)//2
if resT[x]>1:
s... | output | 1 | 32,981 | 15 | 65,963 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today, Wet Shark is given n bishops on a 1000 by 1000 grid. Both rows and columns of the grid are numbered from 1 to 1000. Rows are numbered from top to bottom, while columns are numbered from left to right.
Wet Shark thinks that two bishop... | instruction | 0 | 32,982 | 15 | 65,964 |
Tags: combinatorics, implementation
Correct Solution:
```
n = int(input())
a = [[*map(int, input().split())] for i in range(n)]
d1 = {}
d2 = {}
for i in a:
wk1 = i[0] + i[1]
wk2 = i[0] - i[1]
if not wk1 in d1:
d1[wk1] = 0
d1[wk1] += 1
if not wk2 in d2:
d2[wk2] = 0
d2[wk2] += 1
an... | output | 1 | 32,982 | 15 | 65,965 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today, Wet Shark is given n bishops on a 1000 by 1000 grid. Both rows and columns of the grid are numbered from 1 to 1000. Rows are numbered from top to bottom, while columns are numbered from left to right.
Wet Shark thinks that two bishop... | instruction | 0 | 32,983 | 15 | 65,966 |
Tags: combinatorics, implementation
Correct Solution:
```
dic1={}
dic2={}
x=int(input())
for n in range(x):
a,b=map(int,input().split())
if a+b not in dic1:
dic1[a+b]=1
else: dic1[a+b]+=1
if a-b not in dic2: dic2[a-b]=1
else: dic2[a-b]+=1
res=0
for n in dic1:
res+=dic1[n]*(dic1[n]-1)//2
... | output | 1 | 32,983 | 15 | 65,967 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today, Wet Shark is given n bishops on a 1000 by 1000 grid. Both rows and columns of the grid are numbered from 1 to 1000. Rows are numbered from top to bottom, while columns are numbered from left to right.
Wet Shark thinks that two bishop... | instruction | 0 | 32,984 | 15 | 65,968 |
Tags: combinatorics, implementation
Correct Solution:
```
d={}
d1={}
sm=0
sh=[]
n=int(input())
for i in range(n):
sh.append(list(map(int,input().split())))
for i in range(n):
x=sh[i][0]
y=sh[i][1]
sm+=d.get(x+y,0)
sm+=d1.get(x-y,0)
d[x+y]=d.get(x+y,0)+1
d1[x-y]=d1.get(x-y,0)+1
print(sm)
``` | output | 1 | 32,984 | 15 | 65,969 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today, Wet Shark is given n bishops on a 1000 by 1000 grid. Both rows and columns of the grid are numbered from 1 to 1000. Rows are numbered from top to bottom, while columns are numbered from left to right.
Wet Shark thinks that two bishop... | instruction | 0 | 32,985 | 15 | 65,970 |
Tags: combinatorics, implementation
Correct Solution:
```
n = int(input())
grid = [[0 for x in range(1000)] for x in range(1000)]
ans, tmpAns = 0, 0
def getNS(n):
if n < 2:
return 0
return (n * (n - 1)) / 2
for i in range(n):
x, y = [int(i) for i in input().split()]
grid[x - 1][y - 1] = 1
f... | output | 1 | 32,985 | 15 | 65,971 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today, Wet Shark is given n bishops on a 1000 by 1000 grid. Both rows and columns of the grid are numbered from 1 to 1000. Rows are numbered from top to bottom, while columns are numbered from left to right.
Wet Shark thinks that two bishop... | instruction | 0 | 32,986 | 15 | 65,972 |
Tags: combinatorics, implementation
Correct Solution:
```
p, m = dict(), dict()
attacks = 0
for _ in range(int(input())):
x, y = map(int, input().split())
if x + y not in p:
p[x + y] = 0
if x - y not in m:
m[x - y] = 0
attacks += p[x + y] + m[x - y]
p[x + y] += 1
m[x - y] += 1
... | output | 1 | 32,986 | 15 | 65,973 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today, Wet Shark is given n bishops on a 1000 by 1000 grid. Both rows and columns of the grid are numbered from 1 to 1000. Rows are numbered from top to bottom, while columns are numbered from left to right.
Wet Shark thinks that two bishop... | instruction | 0 | 32,987 | 15 | 65,974 |
Tags: combinatorics, implementation
Correct Solution:
```
p,m=[0]*2100,[0]*2100
a=0
for _ in range(int(input())):
x,y = map(int,input().split())
a+=p[x+y]+m[x-y]
p[x+y]+=1
m[x-y]+=1
print(a)
``` | output | 1 | 32,987 | 15 | 65,975 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today, Wet Shark is given n bishops on a 1000 by 1000 grid. Both rows and columns of the grid are numbered from 1 to 1000. Rows are numbered from top to bottom, while columns are numbered from left to right.
Wet Shark thinks that two bishop... | instruction | 0 | 32,988 | 15 | 65,976 |
Tags: combinatorics, implementation
Correct Solution:
```
#Wet Shark and Bishops
n = int(input())
cnt = 0
dictt ={}
dictt2={}
for i in range(n):
a,b = map(int,input().split())
try:dictt[a+b]+=1
except :dictt[a+b]=1
try:dictt2[a-b]+=1
except:dictt2[a-b]=1
for i,j in dictt.items():
if (j>1):
... | output | 1 | 32,988 | 15 | 65,977 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today, Wet Shark is given n bishops on a 1000 by 1000 grid. Both rows and columns of the grid are numbered from 1 to 1000. Rows are numbered from top to bottom, while columns are numbered from l... | instruction | 0 | 32,989 | 15 | 65,978 |
Yes | output | 1 | 32,989 | 15 | 65,979 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today, Wet Shark is given n bishops on a 1000 by 1000 grid. Both rows and columns of the grid are numbered from 1 to 1000. Rows are numbered from top to bottom, while columns are numbered from l... | instruction | 0 | 32,990 | 15 | 65,980 |
Yes | output | 1 | 32,990 | 15 | 65,981 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today, Wet Shark is given n bishops on a 1000 by 1000 grid. Both rows and columns of the grid are numbered from 1 to 1000. Rows are numbered from top to bottom, while columns are numbered from l... | instruction | 0 | 32,991 | 15 | 65,982 |
Yes | output | 1 | 32,991 | 15 | 65,983 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today, Wet Shark is given n bishops on a 1000 by 1000 grid. Both rows and columns of the grid are numbered from 1 to 1000. Rows are numbered from top to bottom, while columns are numbered from l... | instruction | 0 | 32,992 | 15 | 65,984 |
Yes | output | 1 | 32,992 | 15 | 65,985 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today, Wet Shark is given n bishops on a 1000 by 1000 grid. Both rows and columns of the grid are numbered from 1 to 1000. Rows are numbered from top to bottom, while columns are numbered from l... | instruction | 0 | 32,993 | 15 | 65,986 |
No | output | 1 | 32,993 | 15 | 65,987 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today, Wet Shark is given n bishops on a 1000 by 1000 grid. Both rows and columns of the grid are numbered from 1 to 1000. Rows are numbered from top to bottom, while columns are numbered from l... | instruction | 0 | 32,994 | 15 | 65,988 |
No | output | 1 | 32,994 | 15 | 65,989 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today, Wet Shark is given n bishops on a 1000 by 1000 grid. Both rows and columns of the grid are numbered from 1 to 1000. Rows are numbered from top to bottom, while columns are numbered from l... | instruction | 0 | 32,995 | 15 | 65,990 |
No | output | 1 | 32,995 | 15 | 65,991 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today, Wet Shark is given n bishops on a 1000 by 1000 grid. Both rows and columns of the grid are numbered from 1 to 1000. Rows are numbered from top to bottom, while columns are numbered from l... | instruction | 0 | 32,996 | 15 | 65,992 |
No | output | 1 | 32,996 | 15 | 65,993 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.