message stringlengths 2 28.7k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 21 109k | cluster float64 7 7 | __index_level_0__ int64 42 217k |
|---|---|---|---|---|---|
Provide tags and a correct Python 3 solution for this coding contest problem.
You finally woke up after this crazy dream and decided to walk around to clear your head. Outside you saw your house's fence β so plain and boring, that you'd like to repaint it.
<image>
You have a fence consisting of n planks, where the i... | instruction | 0 | 82,804 | 7 | 165,608 |
Tags: brute force, constructive algorithms, greedy
Correct Solution:
```
import sys
import math
from collections import defaultdict,Counter,deque
# input=sys.stdin.readline
# def print(x):
# sys.stdout.write(str(x)+"\n")
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192
class FastIO(IOBase):
... | output | 1 | 82,804 | 7 | 165,609 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You finally woke up after this crazy dream and decided to walk around to clear your head. Outside you saw your house's fence β so plain and boring, that you'd like to repaint it.
<image>
You have a fence consisting of n planks, where the i... | instruction | 0 | 82,805 | 7 | 165,610 |
Tags: brute force, constructive algorithms, greedy
Correct Solution:
```
from collections import defaultdict as dd
for _ in range(int(input())):
n, m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
dic = dd(lambd... | output | 1 | 82,805 | 7 | 165,611 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You finally woke up after this crazy dream and decided to walk around to clear your head. Outside you saw your house's fence β so plain and boring, that you'd like to repaint it.
<image>
You have a fence consisting of n planks, where the i... | instruction | 0 | 82,806 | 7 | 165,612 |
Tags: brute force, constructive algorithms, greedy
Correct Solution:
```
from sys import stdin
from math import ceil
input = stdin.readline
def main():
t = int(input())
for i in range(t):
n,m = map(int,input().split())
ai = list(map(int,input().split()))
bi = list(map(int,input().split(... | output | 1 | 82,806 | 7 | 165,613 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You finally woke up after this crazy dream and decided to walk around to clear your head. Outside you saw your house's fence β so plain and boring, that you'd like to repaint it.
<image>
You have a fence consisting of n planks, where the i... | instruction | 0 | 82,807 | 7 | 165,614 |
Tags: brute force, constructive algorithms, greedy
Correct Solution:
```
''' ===============================
-- @uthor : Kaleab Asfaw
-- Handle : kaleabasfaw2010
-- Bio : High-School Student
==============================='''
# Fast IO
import sys
import os
from io import BytesIO, IOBase
BUFSIZE = 81... | output | 1 | 82,807 | 7 | 165,615 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You finally woke up after this crazy dream and decided to walk around to clear your head. Outside you saw your house's fence β so plain and boring, that you'd like to repaint it.
<image>
You h... | instruction | 0 | 82,808 | 7 | 165,616 |
Yes | output | 1 | 82,808 | 7 | 165,617 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You finally woke up after this crazy dream and decided to walk around to clear your head. Outside you saw your house's fence β so plain and boring, that you'd like to repaint it.
<image>
You h... | instruction | 0 | 82,809 | 7 | 165,618 |
Yes | output | 1 | 82,809 | 7 | 165,619 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You finally woke up after this crazy dream and decided to walk around to clear your head. Outside you saw your house's fence β so plain and boring, that you'd like to repaint it.
<image>
You h... | instruction | 0 | 82,810 | 7 | 165,620 |
Yes | output | 1 | 82,810 | 7 | 165,621 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You finally woke up after this crazy dream and decided to walk around to clear your head. Outside you saw your house's fence β so plain and boring, that you'd like to repaint it.
<image>
You h... | instruction | 0 | 82,811 | 7 | 165,622 |
Yes | output | 1 | 82,811 | 7 | 165,623 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You finally woke up after this crazy dream and decided to walk around to clear your head. Outside you saw your house's fence β so plain and boring, that you'd like to repaint it.
<image>
You h... | instruction | 0 | 82,812 | 7 | 165,624 |
No | output | 1 | 82,812 | 7 | 165,625 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You finally woke up after this crazy dream and decided to walk around to clear your head. Outside you saw your house's fence β so plain and boring, that you'd like to repaint it.
<image>
You h... | instruction | 0 | 82,813 | 7 | 165,626 |
No | output | 1 | 82,813 | 7 | 165,627 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You finally woke up after this crazy dream and decided to walk around to clear your head. Outside you saw your house's fence β so plain and boring, that you'd like to repaint it.
<image>
You h... | instruction | 0 | 82,814 | 7 | 165,628 |
No | output | 1 | 82,814 | 7 | 165,629 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You finally woke up after this crazy dream and decided to walk around to clear your head. Outside you saw your house's fence β so plain and boring, that you'd like to repaint it.
<image>
You h... | instruction | 0 | 82,815 | 7 | 165,630 |
No | output | 1 | 82,815 | 7 | 165,631 |
Provide tags and a correct Python 3 solution for this coding contest problem.
During the breaks between competitions, top-model Izabella tries to develop herself and not to be bored. For example, now she tries to solve Rubik's cube 2x2x2.
It's too hard to learn to solve Rubik's cube instantly, so she learns to unders... | instruction | 0 | 83,091 | 7 | 166,182 |
Tags: brute force, implementation
Correct Solution:
```
import sys
rotations = [[1, 3, 5, 7, 9, 11, 22, 24], [2, 4, 6, 8, 10, 12, 21, 23], [13, 14, 5, 6, 17, 18, 21, 22],
[15, 16, 7, 8, 19, 20, 23, 24], [3, 4, 17, 19, 10, 9, 16, 14], [1, 2, 18, 20, 12, 11, 15, 13]]
# r1 shift left
def rotation_backwards... | output | 1 | 83,091 | 7 | 166,183 |
Provide tags and a correct Python 3 solution for this coding contest problem.
During the breaks between competitions, top-model Izabella tries to develop herself and not to be bored. For example, now she tries to solve Rubik's cube 2x2x2.
It's too hard to learn to solve Rubik's cube instantly, so she learns to unders... | instruction | 0 | 83,092 | 7 | 166,184 |
Tags: brute force, implementation
Correct Solution:
```
a = [
[1,3,5,7,9,11,24,22],
[2,4,6,8,10,12,23,21],
[13,14,5,6,17,18,21,22],
[15,16,7,8,19,20,23,24],
[2,1,13,15,11,12,20,18],
[4,3,14,16,9,10,19,17]
]
cube = [0]+list(map(int, input().split()))
def rubik(cube):
if cube[1]==cube[2]==... | output | 1 | 83,092 | 7 | 166,185 |
Provide tags and a correct Python 3 solution for this coding contest problem.
During the breaks between competitions, top-model Izabella tries to develop herself and not to be bored. For example, now she tries to solve Rubik's cube 2x2x2.
It's too hard to learn to solve Rubik's cube instantly, so she learns to unders... | instruction | 0 | 83,093 | 7 | 166,186 |
Tags: brute force, implementation
Correct Solution:
```
from sys import stdin
s=list(map(int,stdin.readline().strip().split()))
l1=[s[0],s[2],s[4],s[6],s[8],s[10],s[-3],s[-1]]
l2=[s[1],s[3],s[5],s[7],s[9],s[11],s[-4],s[-2]]
l3=[ s[12],s[13],s[4],s[5],s[16],s[17],s[20],s[21]]
l4=[s[14],s[15],s[6],s[7],s[18],s[19],s[22],... | output | 1 | 83,093 | 7 | 166,187 |
Provide tags and a correct Python 3 solution for this coding contest problem.
During the breaks between competitions, top-model Izabella tries to develop herself and not to be bored. For example, now she tries to solve Rubik's cube 2x2x2.
It's too hard to learn to solve Rubik's cube instantly, so she learns to unders... | instruction | 0 | 83,094 | 7 | 166,188 |
Tags: brute force, implementation
Correct Solution:
```
def xd(a,b,c,d):
global s
if(s[a-1]==s[b-1] and s[b-1]==s[c-1] and s[c-1]==s[d-1]): return 1
else: return 0
s=list(map(int,input().split()))
pd=0
if(xd(13,14,15,16) and xd(17,18,19,20) and xd(1,3,6,8) and xd(5,7,10,12) and xd(9,11,21,23) and xd(2,4,22,... | output | 1 | 83,094 | 7 | 166,189 |
Provide tags and a correct Python 3 solution for this coding contest problem.
During the breaks between competitions, top-model Izabella tries to develop herself and not to be bored. For example, now she tries to solve Rubik's cube 2x2x2.
It's too hard to learn to solve Rubik's cube instantly, so she learns to unders... | instruction | 0 | 83,095 | 7 | 166,190 |
Tags: brute force, implementation
Correct Solution:
```
q = list(map(int,input().split()))
a=[0]
for i in q:
a.append(i)
if a[1]==a[3]==a[6]==a[8] and a[2]==a[4]==a[22]==a[24] and a[5]==a[7]==a[10]==a[12] and a[9]==a[11]==a[21]==a[23] and a[13]==a[14]==a[15]==a[16]:
print('YES')
exit(0)
if a[1]==a[3]==a[21]... | output | 1 | 83,095 | 7 | 166,191 |
Provide tags and a correct Python 3 solution for this coding contest problem.
During the breaks between competitions, top-model Izabella tries to develop herself and not to be bored. For example, now she tries to solve Rubik's cube 2x2x2.
It's too hard to learn to solve Rubik's cube instantly, so she learns to unders... | instruction | 0 | 83,096 | 7 | 166,192 |
Tags: brute force, implementation
Correct Solution:
```
l = [0] + [int(i) for i in input().split(" ")]
if l[13] == l[14] == l[15] == l[16] and \
l[17] == l[18] == l[19] == l[20]:
if l[5] == l[7] == l[10] == l[12] and \
l[9] == l[11] == l[21] == l[23] and \
l[1] == l[3] == l[6] == l[8] and \
... | output | 1 | 83,096 | 7 | 166,193 |
Provide tags and a correct Python 3 solution for this coding contest problem.
During the breaks between competitions, top-model Izabella tries to develop herself and not to be bored. For example, now she tries to solve Rubik's cube 2x2x2.
It's too hard to learn to solve Rubik's cube instantly, so she learns to unders... | instruction | 0 | 83,097 | 7 | 166,194 |
Tags: brute force, implementation
Correct Solution:
```
a = input().split(' ')
b = 0
if a[0] == a[1] == a[2] == a[3] and a[8] == a[9] == a[10] == a[11]:
if a[12] == a[13] == a[6] == a[7] and a[4] == a[5] == a[18] == a[19] and a[16] == a[17] == a[22] == a[23] and a[20] == a[21] == a[14] == a[15]:
print('YES... | output | 1 | 83,097 | 7 | 166,195 |
Provide tags and a correct Python 3 solution for this coding contest problem.
During the breaks between competitions, top-model Izabella tries to develop herself and not to be bored. For example, now she tries to solve Rubik's cube 2x2x2.
It's too hard to learn to solve Rubik's cube instantly, so she learns to unders... | instruction | 0 | 83,098 | 7 | 166,196 |
Tags: brute force, implementation
Correct Solution:
```
import itertools, sys
id = '''
12
34
ef56ijmn
gh78klop
9a
bc
'''
transforms = [
[
[1,2,3,4],
[22,21,18,17,6,5,14,13]
],
[
[9,10,11,12],
[15,16,7,8,19,20,23,24],
],
[
[5,6,7,8],
[3,4,17,19... | output | 1 | 83,098 | 7 | 166,197 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
During the breaks between competitions, top-model Izabella tries to develop herself and not to be bored. For example, now she tries to solve Rubik's cube 2x2x2.
It's too hard to learn to solve ... | instruction | 0 | 83,106 | 7 | 166,212 |
No | output | 1 | 83,106 | 7 | 166,213 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Dreamoon likes coloring cells very much.
There is a row of n cells. Initially, all cells are empty (don't contain any color). Cells are numbered from 1 to n.
You are given an integer m and m integers l_1, l_2, β¦, l_m (1 β€ l_i β€ n)
Dreamoo... | instruction | 0 | 83,525 | 7 | 167,050 |
Tags: constructive algorithms, greedy, implementation, math
Correct Solution:
```
def indexer(x,y,n):
#y is total cells colored
if(x>y):
return n-x+1
else:
return n-y
def repair(ans,n,z):
if(n==0):
return;
push=[0 for i in range(len(ans))]
for i ... | output | 1 | 83,525 | 7 | 167,051 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Dreamoon likes coloring cells very much.
There is a row of n cells. Initially, all cells are empty (don't contain any color). Cells are numbered from 1 to n.
You are given an integer m and m integers l_1, l_2, β¦, l_m (1 β€ l_i β€ n)
Dreamoo... | instruction | 0 | 83,526 | 7 | 167,052 |
Tags: constructive algorithms, greedy, implementation, math
Correct Solution:
```
#!/usr/bin/env python3
N, M = input().split(' ')
N, M = int(N), int(M)
L = input().split(' ')
L = list(int(x) for x in L)
def answer(N, M, L):
offsets = [0]
for i in range(M-1):
offsets += [1]
overhang = 0
for i... | output | 1 | 83,526 | 7 | 167,053 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Dreamoon likes coloring cells very much.
There is a row of n cells. Initially, all cells are empty (don't contain any color). Cells are numbered from 1 to n.
You are given an integer m and m integers l_1, l_2, β¦, l_m (1 β€ l_i β€ n)
Dreamoo... | instruction | 0 | 83,527 | 7 | 167,054 |
Tags: constructive algorithms, greedy, implementation, math
Correct Solution:
```
n, m = map(int, input().split())
l = list(map(int, input().split()))
out = []
curr = 0
lastPoss = [n - l[i] for i in range(m)]
for i in range(m - 2, -1, -1):
lastPoss[i] = min(lastPoss[i], lastPoss[i+1]-1)
if lastPoss[0] < 0:
pri... | output | 1 | 83,527 | 7 | 167,055 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Dreamoon likes coloring cells very much.
There is a row of n cells. Initially, all cells are empty (don't contain any color). Cells are numbered from 1 to n.
You are given an integer m and m integers l_1, l_2, β¦, l_m (1 β€ l_i β€ n)
Dreamoo... | instruction | 0 | 83,528 | 7 | 167,056 |
Tags: constructive algorithms, greedy, implementation, math
Correct Solution:
```
# from future import print_function,division
# range = xrange
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10**9)
from sys import stdin, stdout
def main():
n,m = [int(s) for s in input().split()]
l = [int(s) for ... | output | 1 | 83,528 | 7 | 167,057 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Dreamoon likes coloring cells very much.
There is a row of n cells. Initially, all cells are empty (don't contain any color). Cells are numbered from 1 to n.
You are given an integer m and m integers l_1, l_2, β¦, l_m (1 β€ l_i β€ n)
Dreamoo... | instruction | 0 | 83,529 | 7 | 167,058 |
Tags: constructive algorithms, greedy, implementation, math
Correct Solution:
```
#Code by Sounak, IIESTS
#------------------------------warmup----------------------------
import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
from collections import defaultdict
from itertools i... | output | 1 | 83,529 | 7 | 167,059 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Dreamoon likes coloring cells very much.
There is a row of n cells. Initially, all cells are empty (don't contain any color). Cells are numbered from 1 to n.
You are given an integer m and m integers l_1, l_2, β¦, l_m (1 β€ l_i β€ n)
Dreamoo... | instruction | 0 | 83,530 | 7 | 167,060 |
Tags: constructive algorithms, greedy, implementation, math
Correct Solution:
```
import sys
input = sys.stdin.readline
if __name__ == "__main__":
n, m = [int(a) for a in input().split()]
ls = [int(a) for a in input().split()]
fail = False
for i in range(m):
if ls[i] > n-i:
fail = ... | output | 1 | 83,530 | 7 | 167,061 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Dreamoon likes coloring cells very much.
There is a row of n cells. Initially, all cells are empty (don't contain any color). Cells are numbered from 1 to n.
You are given an integer m and m integers l_1, l_2, β¦, l_m (1 β€ l_i β€ n)
Dreamoo... | instruction | 0 | 83,531 | 7 | 167,062 |
Tags: constructive algorithms, greedy, implementation, math
Correct Solution:
```
from sys import stdin
input = stdin.readline
if __name__ == '__main__':
n, m = map(int, input().split())
larr = list(map(int, input().split()))
for i, l in enumerate(larr):
if l > n - i:
print(-1)
... | output | 1 | 83,531 | 7 | 167,063 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Dreamoon likes coloring cells very much.
There is a row of n cells. Initially, all cells are empty (don't contain any color). Cells are numbered from 1 to n.
You are given an integer m and m integers l_1, l_2, β¦, l_m (1 β€ l_i β€ n)
Dreamoo... | instruction | 0 | 83,532 | 7 | 167,064 |
Tags: constructive algorithms, greedy, implementation, math
Correct Solution:
```
n, m = map(int, input().split())
l = list(map(int, input().split()))
s = sum(l)
def solve():
if s < n:
return [-1]
for i in range(m):
if l[i] > n - i:
return [-1]
ov = s - n
idx = 1
sln = ... | output | 1 | 83,532 | 7 | 167,065 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dreamoon likes coloring cells very much.
There is a row of n cells. Initially, all cells are empty (don't contain any color). Cells are numbered from 1 to n.
You are given an integer m and m i... | instruction | 0 | 83,533 | 7 | 167,066 |
Yes | output | 1 | 83,533 | 7 | 167,067 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dreamoon likes coloring cells very much.
There is a row of n cells. Initially, all cells are empty (don't contain any color). Cells are numbered from 1 to n.
You are given an integer m and m i... | instruction | 0 | 83,534 | 7 | 167,068 |
Yes | output | 1 | 83,534 | 7 | 167,069 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dreamoon likes coloring cells very much.
There is a row of n cells. Initially, all cells are empty (don't contain any color). Cells are numbered from 1 to n.
You are given an integer m and m i... | instruction | 0 | 83,535 | 7 | 167,070 |
Yes | output | 1 | 83,535 | 7 | 167,071 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dreamoon likes coloring cells very much.
There is a row of n cells. Initially, all cells are empty (don't contain any color). Cells are numbered from 1 to n.
You are given an integer m and m i... | instruction | 0 | 83,536 | 7 | 167,072 |
Yes | output | 1 | 83,536 | 7 | 167,073 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dreamoon likes coloring cells very much.
There is a row of n cells. Initially, all cells are empty (don't contain any color). Cells are numbered from 1 to n.
You are given an integer m and m i... | instruction | 0 | 83,537 | 7 | 167,074 |
No | output | 1 | 83,537 | 7 | 167,075 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dreamoon likes coloring cells very much.
There is a row of n cells. Initially, all cells are empty (don't contain any color). Cells are numbered from 1 to n.
You are given an integer m and m i... | instruction | 0 | 83,538 | 7 | 167,076 |
No | output | 1 | 83,538 | 7 | 167,077 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dreamoon likes coloring cells very much.
There is a row of n cells. Initially, all cells are empty (don't contain any color). Cells are numbered from 1 to n.
You are given an integer m and m i... | instruction | 0 | 83,539 | 7 | 167,078 |
No | output | 1 | 83,539 | 7 | 167,079 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Dreamoon likes coloring cells very much.
There is a row of n cells. Initially, all cells are empty (don't contain any color). Cells are numbered from 1 to n.
You are given an integer m and m i... | instruction | 0 | 83,540 | 7 | 167,080 |
No | output | 1 | 83,540 | 7 | 167,081 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today we will be playing a red and white colouring game (no, this is not the Russian Civil War; these are just the colours of the Canadian flag).
You are given an n Γ m grid of "R", "W", and "." characters. "R" is red, "W" is white and "." ... | instruction | 0 | 83,641 | 7 | 167,282 |
Tags: brute force, implementation
Correct Solution:
```
import sys
#sys.stdin=open("data.txt")
input=sys.stdin.readline
mii=lambda:map(int,input().split())
for _ in range(int(input())):
n,m=mii()
r=[0,0]
w=[0,0]
for i in range(n):
s=input().strip()
for j in range(m):
if s[j... | output | 1 | 83,641 | 7 | 167,283 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today we will be playing a red and white colouring game (no, this is not the Russian Civil War; these are just the colours of the Canadian flag).
You are given an n Γ m grid of "R", "W", and "." characters. "R" is red, "W" is white and "." ... | instruction | 0 | 83,642 | 7 | 167,284 |
Tags: brute force, implementation
Correct Solution:
```
c = int(input())
while c != 0:
def display(matrix,R,C):
for i in range(R):
for j in range(C):
print(matrix[i][j],end='')
print()
def fun():
for i in range(R):
for j in ran... | output | 1 | 83,642 | 7 | 167,285 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today we will be playing a red and white colouring game (no, this is not the Russian Civil War; these are just the colours of the Canadian flag).
You are given an n Γ m grid of "R", "W", and "." characters. "R" is red, "W" is white and "." ... | instruction | 0 | 83,643 | 7 | 167,286 |
Tags: brute force, implementation
Correct Solution:
```
import sys
input=sys.stdin.readline
t=int(input())
#t=1
for i in range(t):
n,m=map(int,input().split())
#n=int(input())
#a=[int(x) for x in input().split()]
grid=[]
for i in range(n):
temp=input().strip()
grid.append(temp)
... | output | 1 | 83,643 | 7 | 167,287 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today we will be playing a red and white colouring game (no, this is not the Russian Civil War; these are just the colours of the Canadian flag).
You are given an n Γ m grid of "R", "W", and "." characters. "R" is red, "W" is white and "." ... | instruction | 0 | 83,644 | 7 | 167,288 |
Tags: brute force, implementation
Correct Solution:
```
#every red cell only has white neighbours
#and every white cell only has red neighbours
for _ in range(int(input())):
r,c = map(int,input().split())
found = [] #r,c,val
for rows in range(r):
row = input()
for i in range(len(row)):
... | output | 1 | 83,644 | 7 | 167,289 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today we will be playing a red and white colouring game (no, this is not the Russian Civil War; these are just the colours of the Canadian flag).
You are given an n Γ m grid of "R", "W", and "." characters. "R" is red, "W" is white and "." ... | instruction | 0 | 83,645 | 7 | 167,290 |
Tags: brute force, implementation
Correct Solution:
```
import sys,os.path
if(os.path.exists('input.txt')):
sys.stdin = open("input.txt","r+")
sys.stdout = open("output.txt","w")
sys.setrecursionlimit(200000)
mod=10**9+7
from collections import defaultdict
# from math import gcd,ceil,floor
# print(26... | output | 1 | 83,645 | 7 | 167,291 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today we will be playing a red and white colouring game (no, this is not the Russian Civil War; these are just the colours of the Canadian flag).
You are given an n Γ m grid of "R", "W", and "." characters. "R" is red, "W" is white and "." ... | instruction | 0 | 83,646 | 7 | 167,292 |
Tags: brute force, implementation
Correct Solution:
```
def solve():
nm = list(map(int, input().split()))
r = nm[0]
c = nm[1]
matrix = []
for i in range(r):
row = list(input())
matrix.append(row)
first = None
for i in range(r):
if(first):
break
for... | output | 1 | 83,646 | 7 | 167,293 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today we will be playing a red and white colouring game (no, this is not the Russian Civil War; these are just the colours of the Canadian flag).
You are given an n Γ m grid of "R", "W", and "." characters. "R" is red, "W" is white and "." ... | instruction | 0 | 83,647 | 7 | 167,294 |
Tags: brute force, implementation
Correct Solution:
```
for _ in range(int(input())):
n,m = map(int,input().split())
matrix = [[x for x in input()] for _ in range(n)]
r = c = -1
for i in range(n):
for j in range(m):
if matrix[i][j] == 'R':
r,c = i,j
br... | output | 1 | 83,647 | 7 | 167,295 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today we will be playing a red and white colouring game (no, this is not the Russian Civil War; these are just the colours of the Canadian flag).
You are given an n Γ m grid of "R", "W", and "." characters. "R" is red, "W" is white and "." ... | instruction | 0 | 83,648 | 7 | 167,296 |
Tags: brute force, implementation
Correct Solution:
```
def solve():
n, m = map(int, input().split())
case = -1
grid = []
for i in range(n):
grid.append(input())
for i in range(n):
s = grid[i]
for j in range(m):
if s[j] == 'R':
if case >= 0 and cas... | output | 1 | 83,648 | 7 | 167,297 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today we will be playing a red and white colouring game (no, this is not the Russian Civil War; these are just the colours of the Canadian flag).
You are given an n Γ m grid of "R", "W", and ".... | instruction | 0 | 83,649 | 7 | 167,298 |
Yes | output | 1 | 83,649 | 7 | 167,299 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today we will be playing a red and white colouring game (no, this is not the Russian Civil War; these are just the colours of the Canadian flag).
You are given an n Γ m grid of "R", "W", and ".... | instruction | 0 | 83,650 | 7 | 167,300 |
Yes | output | 1 | 83,650 | 7 | 167,301 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today we will be playing a red and white colouring game (no, this is not the Russian Civil War; these are just the colours of the Canadian flag).
You are given an n Γ m grid of "R", "W", and ".... | instruction | 0 | 83,651 | 7 | 167,302 |
Yes | output | 1 | 83,651 | 7 | 167,303 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today we will be playing a red and white colouring game (no, this is not the Russian Civil War; these are just the colours of the Canadian flag).
You are given an n Γ m grid of "R", "W", and ".... | instruction | 0 | 83,652 | 7 | 167,304 |
Yes | output | 1 | 83,652 | 7 | 167,305 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today we will be playing a red and white colouring game (no, this is not the Russian Civil War; these are just the colours of the Canadian flag).
You are given an n Γ m grid of "R", "W", and ".... | instruction | 0 | 83,653 | 7 | 167,306 |
No | output | 1 | 83,653 | 7 | 167,307 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.