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 |
|---|---|---|---|---|---|
Provide tags and a correct Python 3 solution for this coding contest problem.
Dima and Inna are doing so great! At the moment, Inna is sitting on the magic lawn playing with a pink pony. Dima wanted to play too. He brought an n × m chessboard, a very tasty candy and two numbers a and b.
Dima put the chessboard in fro... | instruction | 0 | 53,406 | 15 | 106,812 |
Tags: greedy, implementation
Correct Solution:
```
n,m,i,j,a,b = map(int,input().split())
cor = [[1,1],[1,m],[n,1],[n,m]]
flag = 0
dis = 100000001
for k in cor:
x1 = abs(k[0] - i)
y1 = abs(k[1] - j)
if((x1 % a != 0) or (y1 % b != 0)):
continue
x1 = int(x1 / a)
y1 = int(y1 / b)
if((x1 % 2... | output | 1 | 53,406 | 15 | 106,813 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Dima and Inna are doing so great! At the moment, Inna is sitting on the magic lawn playing with a pink pony. Dima wanted to play too. He brought an n × m chessboard, a very tasty candy and two numbers a and b.
Dima put the chessboard in fro... | instruction | 0 | 53,407 | 15 | 106,814 |
Tags: greedy, implementation
Correct Solution:
```
# ---------------------------iye ha aam zindegi---------------------------------------------
import math
import random
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
import threading
from collections... | output | 1 | 53,407 | 15 | 106,815 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Dima and Inna are doing so great! At the moment, Inna is sitting on the magic lawn playing with a pink pony. Dima wanted to play too. He brought an n × m chessboard, a very tasty candy and two numbers a and b.
Dima put the chessboard in fro... | instruction | 0 | 53,408 | 15 | 106,816 |
Tags: greedy, implementation
Correct Solution:
```
def find(x, y):
distx = abs(x - i)
disty = abs(y - j)
if distx == 0 and disty == 0:
return 0
if distx % a != 0 or disty % b != 0:
return float('inf')
elif abs((distx // a) - (disty // b)) % 2 != 0:
return float... | output | 1 | 53,408 | 15 | 106,817 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Dima and Inna are doing so great! At the moment, Inna is sitting on the magic lawn playing with a pink pony. Dima wanted to play too. He brought an n × m chessboard, a very tasty candy and two numbers a and b.
Dima put the chessboard in fro... | instruction | 0 | 53,409 | 15 | 106,818 |
Tags: greedy, implementation
Correct Solution:
```
n, m, i, j, a, b = map(int, input().split())
x, y, t = [i - 1, n - i], [j - 1, m - j], []
if all(i < a for i in x) or all(j < b for j in y):
if 0 in x and 0 in y: t = [0]
else:
u = [d // a for d in x if d % a == 0]
v = [d // b for d in y if d % b == 0]
... | output | 1 | 53,409 | 15 | 106,819 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Dima and Inna are doing so great! At the moment, Inna is sitting on the magic lawn playing with a pink pony. Dima wanted to play too. He brought an n × m chessboard, a very tasty candy and two numbers a and b.
Dima put the chessboard in fro... | instruction | 0 | 53,410 | 15 | 106,820 |
Tags: greedy, implementation
Correct Solution:
```
n,m,i,j,a,b = [int(x) for x in input().split()]
i -= 1
j -= 1
best = float('inf')
def find(x,y,a,b,n,m):
n = n//a
m = m//b
x = x//a
y = y//b
total = min(x,y)
x -= total
y -= total
if (y+x)%2 == 0:
if y == 0 and m > 1:
... | output | 1 | 53,410 | 15 | 106,821 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Dima and Inna are doing so great! At the moment, Inna is sitting on the magic lawn playing with a pink pony. Dima wanted to play too. He brought an n × m chessboard, a very tasty candy and two numbers a and b.
Dima put the chessboard in fro... | instruction | 0 | 53,411 | 15 | 106,822 |
Tags: greedy, implementation
Correct Solution:
```
bot = True
n, m, i, j, a, b = map(int, input().split())
x, y, t = [i - 1, n - i], [j - 1, m - j], []
if all(i < a for i in x) or all(j < b for j in y):
if 0 in x and 0 in y: t = [0]
else:
u = [d // a for d in x if d % a == 0]
v = [d // b for d in y i... | output | 1 | 53,411 | 15 | 106,823 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Dima and Inna are doing so great! At the moment, Inna is sitting on the magic lawn playing with a pink pony. Dima wanted to play too. He brought an n × m chessboard, a very tasty candy and two numbers a and b.
Dima put the chessboard in fro... | instruction | 0 | 53,412 | 15 | 106,824 |
Tags: greedy, implementation
Correct Solution:
```
n,m,i,j,a,b = map(int,input().split())
path1=path2=path3=path4=10000000000
temp1 =temp2=temp3=temp4=0
if int((i-1)/a) == (i-1)/a and int((j-1)/b) == (j-1)/b:
path1 = (i-1)/a
path_1 = (j-1)/b
# print(path1,path_1)
if path1%2 == 0 and path_1%2 == 0 :
... | output | 1 | 53,412 | 15 | 106,825 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Dima and Inna are doing so great! At the moment, Inna is sitting on the magic lawn playing with a pink pony. Dima wanted to play too. He brought an n × m chessboard, a very tasty candy and two numbers a and b.
Dima put the chessboard in fro... | instruction | 0 | 53,413 | 15 | 106,826 |
Tags: greedy, implementation
Correct Solution:
```
n,m,i,j,a,b=map(int,input().split())
l=[]
if (i-1)%a==0 and (j-1)%b==0:
s1=(i-1)//a
s2=(j-1)//b
if (s1+s2)%2==0:l.append(max(s1,s2))
if (i-1)%a==0 and (m-j)%b==0:
s1=(i-1)//a
s2=(m-j)//b
if (s1+s2)%2==0:l.append(max(s1,s2))
if (n-i)%a==0 and (j-... | output | 1 | 53,413 | 15 | 106,827 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dima and Inna are doing so great! At the moment, Inna is sitting on the magic lawn playing with a pink pony. Dima wanted to play too. He brought an n × m chessboard, a very tasty candy and two n... | instruction | 0 | 53,414 | 15 | 106,828 |
Yes | output | 1 | 53,414 | 15 | 106,829 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dima and Inna are doing so great! At the moment, Inna is sitting on the magic lawn playing with a pink pony. Dima wanted to play too. He brought an n × m chessboard, a very tasty candy and two n... | instruction | 0 | 53,415 | 15 | 106,830 |
Yes | output | 1 | 53,415 | 15 | 106,831 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dima and Inna are doing so great! At the moment, Inna is sitting on the magic lawn playing with a pink pony. Dima wanted to play too. He brought an n × m chessboard, a very tasty candy and two n... | instruction | 0 | 53,416 | 15 | 106,832 |
Yes | output | 1 | 53,416 | 15 | 106,833 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dima and Inna are doing so great! At the moment, Inna is sitting on the magic lawn playing with a pink pony. Dima wanted to play too. He brought an n × m chessboard, a very tasty candy and two n... | instruction | 0 | 53,417 | 15 | 106,834 |
Yes | output | 1 | 53,417 | 15 | 106,835 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dima and Inna are doing so great! At the moment, Inna is sitting on the magic lawn playing with a pink pony. Dima wanted to play too. He brought an n × m chessboard, a very tasty candy and two n... | instruction | 0 | 53,418 | 15 | 106,836 |
No | output | 1 | 53,418 | 15 | 106,837 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dima and Inna are doing so great! At the moment, Inna is sitting on the magic lawn playing with a pink pony. Dima wanted to play too. He brought an n × m chessboard, a very tasty candy and two n... | instruction | 0 | 53,419 | 15 | 106,838 |
No | output | 1 | 53,419 | 15 | 106,839 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dima and Inna are doing so great! At the moment, Inna is sitting on the magic lawn playing with a pink pony. Dima wanted to play too. He brought an n × m chessboard, a very tasty candy and two n... | instruction | 0 | 53,420 | 15 | 106,840 |
No | output | 1 | 53,420 | 15 | 106,841 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dima and Inna are doing so great! At the moment, Inna is sitting on the magic lawn playing with a pink pony. Dima wanted to play too. He brought an n × m chessboard, a very tasty candy and two n... | instruction | 0 | 53,421 | 15 | 106,842 |
No | output | 1 | 53,421 | 15 | 106,843 |
Provide a correct Python 3 solution for this coding contest problem.
There is a grid of size W × H surrounded by walls. Some cells in the grid are occupied by slimes. The slimes want to unite with each other and become a "King Slime".
In each move, a slime can move to east, west, south and north direction until it en... | instruction | 0 | 53,877 | 15 | 107,754 |
"Correct Solution:
```
import sys
class UnionFind:
def __init__(self,sz):
self.__ranks = [1] * sz
self.__parents = [ i for i in range(sz) ]
def find_parent(self, x):
if x == self.__parents[x]:
return x
else:
self.__parents[x] = self.find_parent(self.__par... | output | 1 | 53,877 | 15 | 107,755 |
Provide a correct Python 3 solution for this coding contest problem.
There is a grid of size W × H surrounded by walls. Some cells in the grid are occupied by slimes. The slimes want to unite with each other and become a "King Slime".
In each move, a slime can move to east, west, south and north direction until it en... | instruction | 0 | 53,878 | 15 | 107,756 |
"Correct Solution:
```
class UnionFind:
def __init__(self, n):
self.data=[-1 for i in range(n)]
def root(self,x):
if self.data[x]<0:
return x
else:
self.data[x]=self.root(self.data[x])
return self.data[x]
def uni(self,x,y):
x=self.root(x)... | output | 1 | 53,878 | 15 | 107,757 |
Provide a correct Python 3 solution for this coding contest problem.
There is a grid of size W × H surrounded by walls. Some cells in the grid are occupied by slimes. The slimes want to unite with each other and become a "King Slime".
In each move, a slime can move to east, west, south and north direction until it en... | instruction | 0 | 53,879 | 15 | 107,758 |
"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 | 53,879 | 15 | 107,759 |
Provide a correct Python 3 solution for this coding contest problem.
There is a grid of size W × H surrounded by walls. Some cells in the grid are occupied by slimes. The slimes want to unite with each other and become a "King Slime".
In each move, a slime can move to east, west, south and north direction until it en... | instruction | 0 | 53,880 | 15 | 107,760 |
"Correct Solution:
```
from collections import defaultdict
N, W, H = map(int, input().split())
*p, = range(N)
def root(x):
if x == p[x]:
return x
p[x] = y = root(p[x])
return y
def unite(x, y):
px = root(x); py = root(y)
if px < py:
p[py] = px
else:
p[px] = py
X = defau... | output | 1 | 53,880 | 15 | 107,761 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a strip with an infinite number of cells. Cells are numbered starting with 0. Initially the cell i contains a ball with the number i.
There are n pockets located at cells a_1, …, a_n. ... | instruction | 0 | 53,944 | 15 | 107,888 |
No | output | 1 | 53,944 | 15 | 107,889 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a strip with an infinite number of cells. Cells are numbered starting with 0. Initially the cell i contains a ball with the number i.
There are n pockets located at cells a_1, …, a_n. ... | instruction | 0 | 53,945 | 15 | 107,890 |
No | output | 1 | 53,945 | 15 | 107,891 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a strip with an infinite number of cells. Cells are numbered starting with 0. Initially the cell i contains a ball with the number i.
There are n pockets located at cells a_1, …, a_n. ... | instruction | 0 | 53,946 | 15 | 107,892 |
No | output | 1 | 53,946 | 15 | 107,893 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a strip with an infinite number of cells. Cells are numbered starting with 0. Initially the cell i contains a ball with the number i.
There are n pockets located at cells a_1, …, a_n. ... | instruction | 0 | 53,947 | 15 | 107,894 |
No | output | 1 | 53,947 | 15 | 107,895 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A game field is a strip of 1 × n square cells. In some cells there are Packmen, in some cells — asterisks, other cells are empty.
Packman can move to neighboring cell in 1 time unit. If there is an asterisk in the target cell then Packman e... | instruction | 0 | 54,487 | 15 | 108,974 |
Tags: binary search, dp
Correct Solution:
```
# ---------------------------iye ha aam zindegi---------------------------------------------
import math
import random
import heapq,bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
import threading
from collections impor... | output | 1 | 54,487 | 15 | 108,975 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A game field is a strip of 1 × n square cells. In some cells there are Packmen, in some cells — asterisks, other cells are empty.
Packman can move to neighboring cell in 1 time unit. If there is an asterisk in the target cell then Packman e... | instruction | 0 | 54,488 | 15 | 108,976 |
Tags: binary search, dp
Correct Solution:
```
'''
pacman->food
pacman->food->food :hmmge:
larges smaller val
smallest larger val
'''
def check(mid,p,f):
ptr=0
for x in p:
From=x
To=x
while ptr<len(f):
From=min(From,f[ptr])
To=max(To,f[ptr])
need=To-From+min(To-x,x-From)
if need>mid:
break
ptr... | output | 1 | 54,488 | 15 | 108,977 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A game field is a strip of 1 × n square cells. In some cells there are Packmen, in some cells — asterisks, other cells are empty.
Packman can move to neighboring cell in 1 time unit. If there is an asterisk in the target cell then Packman e... | instruction | 0 | 54,489 | 15 | 108,978 |
Tags: binary search, dp
Correct Solution:
```
from sys import stdin, stdout
n = int(stdin.readline())
s = stdin.readline().strip()
mins = []
packs = []
for i in range(len(s)):
if s[i] == '*':
mins.append(i)
elif s[i] == 'P':
packs.append(i)
l, r = -1, 2 * len(s) + 1
while r - l > 1:
m = ... | output | 1 | 54,489 | 15 | 108,979 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A game field is a strip of 1 × n square cells. In some cells there are Packmen, in some cells — asterisks, other cells are empty.
Packman can move to neighboring cell in 1 time unit. If there is an asterisk in the target cell then Packman e... | instruction | 0 | 54,490 | 15 | 108,980 |
Tags: binary search, dp
Correct Solution:
```
"""
https://codeforces.com/contest/847/problem/E
7
*..P*P* should output 3
10
.**PP.*P.* should output 2
"""
from typing import List
# assumes the positions are sorted, as well that the positions are distinct
def eatable_in_time(food: List[int], packmen: List[int], time: ... | output | 1 | 54,490 | 15 | 108,981 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A game field is a strip of 1 × n square cells. In some cells there are Packmen, in some cells — asterisks, other cells are empty.
Packman can move to neighboring cell in 1 time unit. If there is an asterisk in the target cell then Packman e... | instruction | 0 | 54,491 | 15 | 108,982 |
Tags: binary search, dp
Correct Solution:
```
'''
pacman->food
pacman->food->food :hmmge:
larges smaller val
smallest larger val
'''
def check(mid,p,f):
u=0
for i in range(len(p)):
left=p[i]-f[u]
left=max(0,left)
if mid<left:
return 0
right=max(mid-2*left,0)
right=max(right,(mid-left)//2)
while u<len(f... | output | 1 | 54,491 | 15 | 108,983 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A game field is a strip of 1 × n square cells. In some cells there are Packmen, in some cells — asterisks, other cells are empty.
Packman can move to neighboring cell in 1 time unit. If there is an asterisk in the target cell then Packman e... | instruction | 0 | 54,492 | 15 | 108,984 |
Tags: binary search, dp
Correct Solution:
```
from bisect import bisect_right,bisect_left
def check(t):
pt=0
contain_t=0
pt1,pt2=0,0
contain_t1,contain_t2=0,0
for i in range(l_p):
contain_t1,contain_t2=t,t
if pt>=l_s:
return 1
if ash[pt]<pokemon[i] and t<pokemon[... | output | 1 | 54,492 | 15 | 108,985 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A game field is a strip of 1 × n square cells. In some cells there are Packmen, in some cells — asterisks, other cells are empty.
Packman can move to neighboring cell in 1 time unit. If there is an asterisk in the target cell then Packman e... | instruction | 0 | 54,493 | 15 | 108,986 |
Tags: binary search, dp
Correct Solution:
```
import bisect
n = int(input())
s = input()
packmans = []
stars = []
for i in range(n):
if s[i] == '*':
stars.append(i)
elif s[i] == 'P':
packmans.append(i)
if len(stars) == 0:
print(0)
exit()
def check(t):
first_to_eat = 0
for i i... | output | 1 | 54,493 | 15 | 108,987 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A game field is a strip of 1 × n square cells. In some cells there are Packmen, in some cells — asterisks, other cells are empty.
Packman can move to neighboring cell in 1 time unit. If there i... | instruction | 0 | 54,494 | 15 | 108,988 |
No | output | 1 | 54,494 | 15 | 108,989 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A game field is a strip of 1 × n square cells. In some cells there are Packmen, in some cells — asterisks, other cells are empty.
Packman can move to neighboring cell in 1 time unit. If there i... | instruction | 0 | 54,495 | 15 | 108,990 |
No | output | 1 | 54,495 | 15 | 108,991 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A game field is a strip of 1 × n square cells. In some cells there are Packmen, in some cells — asterisks, other cells are empty.
Packman can move to neighboring cell in 1 time unit. If there i... | instruction | 0 | 54,496 | 15 | 108,992 |
No | output | 1 | 54,496 | 15 | 108,993 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A game field is a strip of 1 × n square cells. In some cells there are Packmen, in some cells — asterisks, other cells are empty.
Packman can move to neighboring cell in 1 time unit. If there i... | instruction | 0 | 54,497 | 15 | 108,994 |
No | output | 1 | 54,497 | 15 | 108,995 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bishwock is a chess figure that consists of three squares resembling an "L-bar". This figure can be rotated by 90, 180 and 270 degrees so it can have four possible states:
XX XX .X X.
X. .X XX XX
... | instruction | 0 | 54,529 | 15 | 109,058 |
Tags: dp, greedy
Correct Solution:
```
a = []
a.append(['X'] + list(input()) + ['X'])
n = len(a[0])
a.append(['X'] + list(input()) + ['X'])
cnt = 0
for i in range(1, n):
#print(a[0][i])
#print(a[1][i])
if a[0][i] == '0' and a[1][i] == '0':
if a[0][i-1] == '0':
cnt += 1
a[0][i... | output | 1 | 54,529 | 15 | 109,059 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bishwock is a chess figure that consists of three squares resembling an "L-bar". This figure can be rotated by 90, 180 and 270 degrees so it can have four possible states:
XX XX .X X.
X. .X XX XX
... | instruction | 0 | 54,530 | 15 | 109,060 |
Tags: dp, greedy
Correct Solution:
```
# Codeforces Round #491 (Div. 2)
import collections
from functools import cmp_to_key
#key=cmp_to_key(lambda x,y: 1 if x not in y else -1 )
import math
import sys
def getIntList():
return list(map(int, input().split()))
import bisect
try :
import numpy
dprint... | output | 1 | 54,530 | 15 | 109,061 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bishwock is a chess figure that consists of three squares resembling an "L-bar". This figure can be rotated by 90, 180 and 270 degrees so it can have four possible states:
XX XX .X X.
X. .X XX XX
... | instruction | 0 | 54,531 | 15 | 109,062 |
Tags: dp, greedy
Correct Solution:
```
s = [list(input()), list(input())]
ans = 0
for i in range(len(s[0]) - 1):
if s[1][i] == s[0][i] == '0':
if s[0][i + 1] == '0':
ans += 1
s[0][i] = s[0][i + 1] = s[1][i] = 'X'
elif s[1][i + 1] == '0':
ans += 1
s[0][... | output | 1 | 54,531 | 15 | 109,063 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bishwock is a chess figure that consists of three squares resembling an "L-bar". This figure can be rotated by 90, 180 and 270 degrees so it can have four possible states:
XX XX .X X.
X. .X XX XX
... | instruction | 0 | 54,532 | 15 | 109,064 |
Tags: dp, greedy
Correct Solution:
```
s1 = input()
s2 = input()
L1 = [c == "0" for c in s1]
L2 = [c == "0" for c in s2]
ans = 0
for i in range(len(s1)-1):
if L1[i] and L2[i]:
if L1[i+1]:
L1[i] = L2[i] = L1[i+1] = False
ans+= 1
elif L2[i+1]:
L1[i] = L2[i] = L2[i+... | output | 1 | 54,532 | 15 | 109,065 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bishwock is a chess figure that consists of three squares resembling an "L-bar". This figure can be rotated by 90, 180 and 270 degrees so it can have four possible states:
XX XX .X X.
X. .X XX XX
... | instruction | 0 | 54,533 | 15 | 109,066 |
Tags: dp, greedy
Correct Solution:
```
board = []
for i in range(2):
board.append([i == "0" for i in input()])
before_up = False
before_down = False
s = 0
for i in range(len(board[0])):
if before_up and before_down:
if board[0][i]:
s += 1
before_up = False
before_dow... | output | 1 | 54,533 | 15 | 109,067 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bishwock is a chess figure that consists of three squares resembling an "L-bar". This figure can be rotated by 90, 180 and 270 degrees so it can have four possible states:
XX XX .X X.
X. .X XX XX
... | instruction | 0 | 54,534 | 15 | 109,068 |
Tags: dp, greedy
Correct Solution:
```
a = []
a.append(input())
a.append(input())
dp = [-200] * 4
dp[1 * (a[0][0] == 'X') + 2 * (a[1][0] == 'X')] = 0
for i in range(1, len(a[0])):
odp = dp
dp = [-200] * 4
state = 1 * (a[0][i] == 'X') + 2 * (a[1][i] == 'X')
for last_state in range(4):
dp[state] = max(dp[state], od... | output | 1 | 54,534 | 15 | 109,069 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bishwock is a chess figure that consists of three squares resembling an "L-bar". This figure can be rotated by 90, 180 and 270 degrees so it can have four possible states:
XX XX .X X.
X. .X XX XX
... | instruction | 0 | 54,535 | 15 | 109,070 |
Tags: dp, greedy
Correct Solution:
```
num = []
num.append(list(i for i in input()))
num.append(list(i for i in input()))
ans = 0
for i in range(len(num[0])-1):
if num[0][i] == '0' and num[1][i] == '0':
if num[0][i+1] == '0':
ans += 1
num[0][i+1] = 'X'
elif num[1][i+1] == '0'... | output | 1 | 54,535 | 15 | 109,071 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bishwock is a chess figure that consists of three squares resembling an "L-bar". This figure can be rotated by 90, 180 and 270 degrees so it can have four possible states:
XX XX .X X.
X. .X XX XX
... | instruction | 0 | 54,536 | 15 | 109,072 |
Tags: dp, greedy
Correct Solution:
```
a = list(input())
b = list(input())
r = 0
for i in range(len(a)-1):
if a[i] == '0' and b[i] == '0':
if a[i+1] == '0':
a[i+1] = 'X'
r += 1
elif b[i+1] == '0':
b[i+1] = 'X'
r += 1
elif a[i] == '0' or b[i] == '0'... | output | 1 | 54,536 | 15 | 109,073 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bishwock is a chess figure that consists of three squares resembling an "L-bar". This figure can be rotated by 90, 180 and 270 degrees so it can have four possible states:
X... | instruction | 0 | 54,537 | 15 | 109,074 |
Yes | output | 1 | 54,537 | 15 | 109,075 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bishwock is a chess figure that consists of three squares resembling an "L-bar". This figure can be rotated by 90, 180 and 270 degrees so it can have four possible states:
X... | instruction | 0 | 54,538 | 15 | 109,076 |
Yes | output | 1 | 54,538 | 15 | 109,077 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bishwock is a chess figure that consists of three squares resembling an "L-bar". This figure can be rotated by 90, 180 and 270 degrees so it can have four possible states:
X... | instruction | 0 | 54,539 | 15 | 109,078 |
Yes | output | 1 | 54,539 | 15 | 109,079 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bishwock is a chess figure that consists of three squares resembling an "L-bar". This figure can be rotated by 90, 180 and 270 degrees so it can have four possible states:
X... | instruction | 0 | 54,540 | 15 | 109,080 |
Yes | output | 1 | 54,540 | 15 | 109,081 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bishwock is a chess figure that consists of three squares resembling an "L-bar". This figure can be rotated by 90, 180 and 270 degrees so it can have four possible states:
X... | instruction | 0 | 54,541 | 15 | 109,082 |
No | output | 1 | 54,541 | 15 | 109,083 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bishwock is a chess figure that consists of three squares resembling an "L-bar". This figure can be rotated by 90, 180 and 270 degrees so it can have four possible states:
X... | instruction | 0 | 54,542 | 15 | 109,084 |
No | output | 1 | 54,542 | 15 | 109,085 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bishwock is a chess figure that consists of three squares resembling an "L-bar". This figure can be rotated by 90, 180 and 270 degrees so it can have four possible states:
X... | instruction | 0 | 54,543 | 15 | 109,086 |
No | output | 1 | 54,543 | 15 | 109,087 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.