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
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given a picture consisting of n rows and m columns. Rows are numbered from 1 to n from the top to the bottom, columns are numbered from 1 to m from the left to the right. Each cell is pa...
instruction
0
80,917
7
161,834
No
output
1
80,917
7
161,835
Provide tags and a correct Python 3 solution for this coding contest problem. You've gotten an n Γ— m sheet of squared paper. Some of its squares are painted. Let's mark the set of all painted squares as A. Set A is connected. Your task is to find the minimum number of squares that we can delete from set A to make it n...
instruction
0
81,062
7
162,124
Tags: constructive algorithms, graphs, trees Correct Solution: ``` def add(vertex,neighbour): if vertex in graph: graph[vertex].append(neighbour) else: graph[vertex]=[neighbour] if neighbour in graph: #####for undirected part remove to get directed graph[neighbour].append(vertex)...
output
1
81,062
7
162,125
Provide tags and a correct Python 3 solution for this coding contest problem. You've gotten an n Γ— m sheet of squared paper. Some of its squares are painted. Let's mark the set of all painted squares as A. Set A is connected. Your task is to find the minimum number of squares that we can delete from set A to make it n...
instruction
0
81,063
7
162,126
Tags: constructive algorithms, graphs, trees Correct Solution: ``` n, m = map(int, input().split()) a = [list(input()) for i in range(n)] dirs = [(0, 1), (1, 0), (0, -1), (-1, 0)] def valid(x, y): return 0 <= x < n and 0 <= y < m def dfs(): cnt, p = 0, -1 for i in range(n): for j in range(m): ...
output
1
81,063
7
162,127
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You've gotten an n Γ— m sheet of squared paper. Some of its squares are painted. Let's mark the set of all painted squares as A. Set A is connected. Your task is to find the minimum number of squ...
instruction
0
81,064
7
162,128
No
output
1
81,064
7
162,129
Provide tags and a correct Python 3 solution for this coding contest problem. Quite recently, a very smart student named Jury decided that lectures are boring, so he downloaded a game called "Black Square" on his super cool touchscreen phone. In this game, the phone's screen is divided into four vertical strips. Each...
instruction
0
81,145
7
162,290
Tags: implementation Correct Solution: ``` a = [int(x) for x in input().split()] n = input() l = [int(d) for d in str(n)] ans = 0 for i in range(len(l)): ans=ans+a[l[i]-1]; print(ans) ```
output
1
81,145
7
162,291
Provide tags and a correct Python 3 solution for this coding contest problem. Quite recently, a very smart student named Jury decided that lectures are boring, so he downloaded a game called "Black Square" on his super cool touchscreen phone. In this game, the phone's screen is divided into four vertical strips. Each...
instruction
0
81,146
7
162,292
Tags: implementation Correct Solution: ``` x = list(map(int,input().split())) y = input() s = 0 for i in y: if int(i) == 1: s = s + x[0] elif int(i) == 2: s = s + x[1] elif int(i) == 3: s = s + x[2] else: s = s + x[3] print(s) ```
output
1
81,146
7
162,293
Provide tags and a correct Python 3 solution for this coding contest problem. Quite recently, a very smart student named Jury decided that lectures are boring, so he downloaded a game called "Black Square" on his super cool touchscreen phone. In this game, the phone's screen is divided into four vertical strips. Each...
instruction
0
81,147
7
162,294
Tags: implementation Correct Solution: ``` a1,a2,a3,a4 = [ int(x) for x in input().split(' ') ] s = input() c=0 for i in range(len(s)): if s[i]=='1': c+=a1 elif s[i] == '2': c+=a2 elif s[i] == '3': c+=a3 elif s[i] == '4': c+=a4 print(c) ```
output
1
81,147
7
162,295
Provide tags and a correct Python 3 solution for this coding contest problem. Quite recently, a very smart student named Jury decided that lectures are boring, so he downloaded a game called "Black Square" on his super cool touchscreen phone. In this game, the phone's screen is divided into four vertical strips. Each...
instruction
0
81,148
7
162,296
Tags: implementation Correct Solution: ``` a=[int(x) for x in input().split()] s=input() length=len(s) ans=0 for i in range(length): ans=ans+a[int(s[i])-1] print(ans) ```
output
1
81,148
7
162,297
Provide tags and a correct Python 3 solution for this coding contest problem. Quite recently, a very smart student named Jury decided that lectures are boring, so he downloaded a game called "Black Square" on his super cool touchscreen phone. In this game, the phone's screen is divided into four vertical strips. Each...
instruction
0
81,149
7
162,298
Tags: implementation Correct Solution: ``` l=list(map(int,input().split())) s=input() #s=list(s) #print(s) d={'1':l[0],'2':l[1],'3':l[2],'4':l[3]} c=0 for i in range(len(s)): c+=d[s[i]] #print(a) print(c) ```
output
1
81,149
7
162,299
Provide tags and a correct Python 3 solution for this coding contest problem. Quite recently, a very smart student named Jury decided that lectures are boring, so he downloaded a game called "Black Square" on his super cool touchscreen phone. In this game, the phone's screen is divided into four vertical strips. Each...
instruction
0
81,150
7
162,300
Tags: implementation Correct Solution: ``` a,b,c,d = map(int,input().split()) e = list(input()) n = 0 for i in range(len(e)): e[i] = int(e[i]) for i in range(len(e)): if e[i] == 1: n += a elif e[i] == 2: n += b elif e[i] == 3: n += c else: n += d print(n) ```
output
1
81,150
7
162,301
Provide tags and a correct Python 3 solution for this coding contest problem. Quite recently, a very smart student named Jury decided that lectures are boring, so he downloaded a game called "Black Square" on his super cool touchscreen phone. In this game, the phone's screen is divided into four vertical strips. Each...
instruction
0
81,151
7
162,302
Tags: implementation Correct Solution: ``` stripes = [int(i) for i in input().split()] digits = input() calories = 0 for c in digits: calories += stripes[int(c) - 1] print (calories) ```
output
1
81,151
7
162,303
Provide tags and a correct Python 3 solution for this coding contest problem. Quite recently, a very smart student named Jury decided that lectures are boring, so he downloaded a game called "Black Square" on his super cool touchscreen phone. In this game, the phone's screen is divided into four vertical strips. Each...
instruction
0
81,152
7
162,304
Tags: implementation Correct Solution: ``` l = list(map(int,input().split())) s = list(input()) su = 0 se = set(s) for i in se: su += (s.count(i))*l[int(i)-1] print(su) ```
output
1
81,152
7
162,305
Provide tags and a correct Python 3 solution for this coding contest problem. The Hedgehog recently remembered one of his favorite childhood activities, β€” solving puzzles, and got into it with new vigor. He would sit day in, day out with his friend buried into thousands of tiny pieces of the picture, looking for the r...
instruction
0
81,217
7
162,434
Tags: hashing, implementation Correct Solution: ``` def rotate(puzzle): n_puzzle = [] for y in range(len(puzzle) - 1, -1, -1): n_puzzle.append(puzzle[y]) result = [] for x in range(len(puzzle[0])): col = [] for y in range(len(puzzle)): col.append(n_puzzle[y][x]) ...
output
1
81,217
7
162,435
Provide tags and a correct Python 3 solution for this coding contest problem. The Hedgehog recently remembered one of his favorite childhood activities, β€” solving puzzles, and got into it with new vigor. He would sit day in, day out with his friend buried into thousands of tiny pieces of the picture, looking for the r...
instruction
0
81,218
7
162,436
Tags: hashing, implementation Correct Solution: ``` # /******************************************************************************* # * Author : Quantum Of Excellence # * email : quantumofexcellence (at) gmail (dot) com # * copyright : 2014 - 2015 # * date : 28 - 10 - 2015 # * Judge Status : ...
output
1
81,218
7
162,437
Provide tags and a correct Python 3 solution for this coding contest problem. The Hedgehog recently remembered one of his favorite childhood activities, β€” solving puzzles, and got into it with new vigor. He would sit day in, day out with his friend buried into thousands of tiny pieces of the picture, looking for the r...
instruction
0
81,219
7
162,438
Tags: hashing, implementation Correct Solution: ``` # /******************************************************************************* # * Author : Quantum Of Excellence # * email : quantumofexcellence (at) gmail (dot) com # * copyright : 2014 - 2015 # * date : 28 - 10 - 2015 # * Judge Stat...
output
1
81,219
7
162,439
Provide tags and a correct Python 3 solution for this coding contest problem. The Hedgehog recently remembered one of his favorite childhood activities, β€” solving puzzles, and got into it with new vigor. He would sit day in, day out with his friend buried into thousands of tiny pieces of the picture, looking for the r...
instruction
0
81,220
7
162,440
Tags: hashing, implementation Correct Solution: ``` n, m = map(int, input().split()) grid = [ input().strip() for r in range(n) ] def flatten(piece): return '.'.join([ ''.join(row) for row in piece ]) def rotate(piece): n, m = len(piece), len(piece[0]) rotated = [ [ None for c in range(n) ] for r in range...
output
1
81,220
7
162,441
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The Hedgehog recently remembered one of his favorite childhood activities, β€” solving puzzles, and got into it with new vigor. He would sit day in, day out with his friend buried into thousands o...
instruction
0
81,221
7
162,442
No
output
1
81,221
7
162,443
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The Hedgehog recently remembered one of his favorite childhood activities, β€” solving puzzles, and got into it with new vigor. He would sit day in, day out with his friend buried into thousands o...
instruction
0
81,222
7
162,444
No
output
1
81,222
7
162,445
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The Hedgehog recently remembered one of his favorite childhood activities, β€” solving puzzles, and got into it with new vigor. He would sit day in, day out with his friend buried into thousands o...
instruction
0
81,223
7
162,446
No
output
1
81,223
7
162,447
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp has a checkered sheet of paper of size n Γ— m. Polycarp painted some of cells with black, the others remained white. Inspired by Malevich's "Black Square", Polycarp wants to paint minimu...
instruction
0
81,368
7
162,736
Yes
output
1
81,368
7
162,737
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp has a checkered sheet of paper of size n Γ— m. Polycarp painted some of cells with black, the others remained white. Inspired by Malevich's "Black Square", Polycarp wants to paint minimu...
instruction
0
81,369
7
162,738
Yes
output
1
81,369
7
162,739
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp has a checkered sheet of paper of size n Γ— m. Polycarp painted some of cells with black, the others remained white. Inspired by Malevich's "Black Square", Polycarp wants to paint minimu...
instruction
0
81,370
7
162,740
Yes
output
1
81,370
7
162,741
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp has a checkered sheet of paper of size n Γ— m. Polycarp painted some of cells with black, the others remained white. Inspired by Malevich's "Black Square", Polycarp wants to paint minimu...
instruction
0
81,371
7
162,742
Yes
output
1
81,371
7
162,743
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp has a checkered sheet of paper of size n Γ— m. Polycarp painted some of cells with black, the others remained white. Inspired by Malevich's "Black Square", Polycarp wants to paint minimu...
instruction
0
81,372
7
162,744
No
output
1
81,372
7
162,745
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp has a checkered sheet of paper of size n Γ— m. Polycarp painted some of cells with black, the others remained white. Inspired by Malevich's "Black Square", Polycarp wants to paint minimu...
instruction
0
81,373
7
162,746
No
output
1
81,373
7
162,747
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp has a checkered sheet of paper of size n Γ— m. Polycarp painted some of cells with black, the others remained white. Inspired by Malevich's "Black Square", Polycarp wants to paint minimu...
instruction
0
81,374
7
162,748
No
output
1
81,374
7
162,749
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polycarp has a checkered sheet of paper of size n Γ— m. Polycarp painted some of cells with black, the others remained white. Inspired by Malevich's "Black Square", Polycarp wants to paint minimu...
instruction
0
81,375
7
162,750
No
output
1
81,375
7
162,751
Provide a correct Python 3 solution for this coding contest problem. There is a grid with N rows and N columns of squares. Let (i,j) be the square at the i-th row from the top and the j-th column from the left. These squares have to be painted in one of the C colors from Color 1 to Color C. Initially, (i,j) is painte...
instruction
0
81,522
7
163,044
"Correct Solution: ``` import itertools n,c=map(int,input().split()) ld=[list(map(int,input().split())) for i in range(c)] lc=[list(map(int,input().split())) for i in range(n)] ct=[[0 for i in range(c)] for i in range(3)] for i in range(n): for j in range(n): ct[(i+j+2)%3][lc[i][j]-1]+=1 L=list(itertools.permutat...
output
1
81,522
7
163,045
Provide a correct Python 3 solution for this coding contest problem. There is a grid with N rows and N columns of squares. Let (i,j) be the square at the i-th row from the top and the j-th column from the left. These squares have to be painted in one of the C colors from Color 1 to Color C. Initially, (i,j) is painte...
instruction
0
81,523
7
163,046
"Correct Solution: ``` N,C = map(int,input().split()) D = [list(map(int,input().split())) for _ in range(C)] c = [list(map(lambda x:int(x)-1,input().split())) for _ in range(N)] n = [[0]*C for _ in range(3)] for i in range(N): for j in range(N): n[(i+j)%3][c[i][j]] += 1 ans = 500*500*1000 for c0 in range(...
output
1
81,523
7
163,047
Provide a correct Python 3 solution for this coding contest problem. There is a grid with N rows and N columns of squares. Let (i,j) be the square at the i-th row from the top and the j-th column from the left. These squares have to be painted in one of the C colors from Color 1 to Color C. Initially, (i,j) is painte...
instruction
0
81,524
7
163,048
"Correct Solution: ``` import itertools N,C=map(int, input().split()) D=[list(map(int, input().split())) for _ in range(C)] cl_cnt=[[0 for _ in range(C) ] for _ in range(3)] for i in range(N): ci=list(map(int, input().split())) for j, cij in enumerate(ci): cl_cnt[(i+j)%3][cij-1]+=1 cost=[[0 for _ in r...
output
1
81,524
7
163,049
Provide a correct Python 3 solution for this coding contest problem. There is a grid with N rows and N columns of squares. Let (i,j) be the square at the i-th row from the top and the j-th column from the left. These squares have to be painted in one of the C colors from Color 1 to Color C. Initially, (i,j) is painte...
instruction
0
81,525
7
163,050
"Correct Solution: ``` n , c = map(int,input().split()) iwaka = [list(map(int,input().split())) for i in range(c)] masu = [list(map(int,input().split())) for i in range(n)] amari = [{} for i in range(3)] for i in range(n): for j in range(n): amari[(i+j)%3][masu[i][j]] = amari[(i+j)%3].get(masu[i][j],0) + 1...
output
1
81,525
7
163,051
Provide a correct Python 3 solution for this coding contest problem. There is a grid with N rows and N columns of squares. Let (i,j) be the square at the i-th row from the top and the j-th column from the left. These squares have to be painted in one of the C colors from Color 1 to Color C. Initially, (i,j) is painte...
instruction
0
81,526
7
163,052
"Correct Solution: ``` from itertools import permutations N,C=map(int,input().split()) D=[] for c in range(C): D.append(list(map(int,input().split()))) c=[] for i in range(N): c.append(list(map(lambda x:int(x)-1,input().split()))) color=[[0]*(C) for i in range(3)] cost=[[0]*(C) for i in range(3)] for i in range...
output
1
81,526
7
163,053
Provide a correct Python 3 solution for this coding contest problem. There is a grid with N rows and N columns of squares. Let (i,j) be the square at the i-th row from the top and the j-th column from the left. These squares have to be painted in one of the C colors from Color 1 to Color C. Initially, (i,j) is painte...
instruction
0
81,527
7
163,054
"Correct Solution: ``` N,C = map(int,input().split()) D = [] c = [] for i in range(C): D.append(list(map(int,input().split()))) for i in range(N): c.append(list(map(int,input().split()))) d = {} d[0] = {} d[1] = {} d[2] = {} for i in range(C): d[0][i] = 0 d[1][i] = 0 d[2][i] = 0 for k in range(C)...
output
1
81,527
7
163,055
Provide a correct Python 3 solution for this coding contest problem. There is a grid with N rows and N columns of squares. Let (i,j) be the square at the i-th row from the top and the j-th column from the left. These squares have to be painted in one of the C colors from Color 1 to Color C. Initially, (i,j) is painte...
instruction
0
81,528
7
163,056
"Correct Solution: ``` from collections import Counter from itertools import permutations def main(): N, C = map(int, input().split()) D = tuple(tuple(map(int, input().split())) for _ in range(C)) cnt = [Counter() for _ in range(3)] for i in range(N): c = [int(x)-1 for x in input().split()] ...
output
1
81,528
7
163,057
Provide a correct Python 3 solution for this coding contest problem. There is a grid with N rows and N columns of squares. Let (i,j) be the square at the i-th row from the top and the j-th column from the left. These squares have to be painted in one of the C colors from Color 1 to Color C. Initially, (i,j) is painte...
instruction
0
81,529
7
163,058
"Correct Solution: ``` import sys input = sys.stdin.buffer.readline n, c = map(int, input().split()) D = [list(map(int, input().split())) for _ in range(c)] C = [list(map(int, input().split())) for _ in range(n)] A = [[0]*c for _ in range(3)] for i in range(n): for j in range(n): x = C[i][j] - 1 r = (i+j)%3 ...
output
1
81,529
7
163,059
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 N rows and N columns of squares. Let (i,j) be the square at the i-th row from the top and the j-th column from the left. These squares have to be painted in one of the C co...
instruction
0
81,530
7
163,060
Yes
output
1
81,530
7
163,061
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 N rows and N columns of squares. Let (i,j) be the square at the i-th row from the top and the j-th column from the left. These squares have to be painted in one of the C co...
instruction
0
81,531
7
163,062
Yes
output
1
81,531
7
163,063
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 N rows and N columns of squares. Let (i,j) be the square at the i-th row from the top and the j-th column from the left. These squares have to be painted in one of the C co...
instruction
0
81,532
7
163,064
Yes
output
1
81,532
7
163,065
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 N rows and N columns of squares. Let (i,j) be the square at the i-th row from the top and the j-th column from the left. These squares have to be painted in one of the C co...
instruction
0
81,533
7
163,066
Yes
output
1
81,533
7
163,067
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 N rows and N columns of squares. Let (i,j) be the square at the i-th row from the top and the j-th column from the left. These squares have to be painted in one of the C co...
instruction
0
81,534
7
163,068
No
output
1
81,534
7
163,069
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 N rows and N columns of squares. Let (i,j) be the square at the i-th row from the top and the j-th column from the left. These squares have to be painted in one of the C co...
instruction
0
81,535
7
163,070
No
output
1
81,535
7
163,071
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 N rows and N columns of squares. Let (i,j) be the square at the i-th row from the top and the j-th column from the left. These squares have to be painted in one of the C co...
instruction
0
81,536
7
163,072
No
output
1
81,536
7
163,073
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 N rows and N columns of squares. Let (i,j) be the square at the i-th row from the top and the j-th column from the left. These squares have to be painted in one of the C co...
instruction
0
81,537
7
163,074
No
output
1
81,537
7
163,075
Provide tags and a correct Python 3 solution for this coding contest problem. Boboniu gives you * r red balls, * g green balls, * b blue balls, * w white balls. He allows you to do the following operation as many times as you want: * Pick a red ball, a green ball, and a blue ball and then change th...
instruction
0
81,886
7
163,772
Tags: brute force, math Correct Solution: ``` import sys # sys.stdin = open("input.txt") def main(): tn = int(sys.stdin.readline()) for ti in range(tn): r, g, b, w = map(int, sys.stdin.readline().split()) n = r + g + b + w a, c = 0, 0 for v in (r, g, b): if v % 2 == ...
output
1
81,886
7
163,773
Provide tags and a correct Python 3 solution for this coding contest problem. Boboniu gives you * r red balls, * g green balls, * b blue balls, * w white balls. He allows you to do the following operation as many times as you want: * Pick a red ball, a green ball, and a blue ball and then change th...
instruction
0
81,887
7
163,774
Tags: brute force, math Correct Solution: ``` def odd_checker(v): tnt = v[0] % 2 + v[1] % 2 + v[2] % 2 + v[3] % 2 return tnt def main(): test = int(input()) for i in range(test): v = list(map(int, input().split())) p=odd_checker(v) if p<=1: print('Yes') else: ...
output
1
81,887
7
163,775
Provide tags and a correct Python 3 solution for this coding contest problem. Boboniu gives you * r red balls, * g green balls, * b blue balls, * w white balls. He allows you to do the following operation as many times as you want: * Pick a red ball, a green ball, and a blue ball and then change th...
instruction
0
81,888
7
163,776
Tags: brute force, math Correct Solution: ``` import sys input = sys.stdin.readline for _ in range(int(input())): a = list(map(int,input().split())) parity = [] for i in a: if i%2: parity.append("o") else: parity.append("e") o = parity.count("o") if o==2 or (o==3 and a[0]*a[1]*a[2]=...
output
1
81,888
7
163,777
Provide tags and a correct Python 3 solution for this coding contest problem. Boboniu gives you * r red balls, * g green balls, * b blue balls, * w white balls. He allows you to do the following operation as many times as you want: * Pick a red ball, a green ball, and a blue ball and then change th...
instruction
0
81,889
7
163,778
Tags: brute force, math Correct Solution: ``` from fractions import Fraction import bisect import os import io from collections import Counter import bisect from collections import defaultdict import math import random import heapq from math import sqrt import sys from functools import reduce, cmp_to_key from collecti...
output
1
81,889
7
163,779
Provide tags and a correct Python 3 solution for this coding contest problem. Boboniu gives you * r red balls, * g green balls, * b blue balls, * w white balls. He allows you to do the following operation as many times as you want: * Pick a red ball, a green ball, and a blue ball and then change th...
instruction
0
81,890
7
163,780
Tags: brute force, math Correct Solution: ``` t = int(input()) for _ in range(t): arr = list(map(int, input().split())) odd, even = 0, 0 for x in arr: if x%2 == 0: even += 1 else: odd += 1 if odd <= 1: print("Yes") continue if 0 in arr[:3]: print("No") continue arr[3] += 1 arr[2] -= 1; arr[1...
output
1
81,890
7
163,781
Provide tags and a correct Python 3 solution for this coding contest problem. Boboniu gives you * r red balls, * g green balls, * b blue balls, * w white balls. He allows you to do the following operation as many times as you want: * Pick a red ball, a green ball, and a blue ball and then change th...
instruction
0
81,891
7
163,782
Tags: brute force, math Correct Solution: ``` # -*- coding: utf-8 -*- """ Created on Wed Aug 12 20:45:19 2020 @author: Dark Soul """ t=int(input('')) arr=[] for i in range(t): arr.append(list(map(int,input().split()))) for i in arr: r=i[0] g=i[1] b=i[2] w=i[3] n1=0 for j in i: if j...
output
1
81,891
7
163,783
Provide tags and a correct Python 3 solution for this coding contest problem. Boboniu gives you * r red balls, * g green balls, * b blue balls, * w white balls. He allows you to do the following operation as many times as you want: * Pick a red ball, a green ball, and a blue ball and then change th...
instruction
0
81,892
7
163,784
Tags: brute force, math Correct Solution: ``` for _ in range(int(input())): a,b,c,d = map(int,input().split()) if( (a%2) + (b%2) + (c%2) + (d%2) <= 1 ): print("YES") elif (a>=1 and b>=1 and c>=1 and ( ((a-1)%2) + ((b-1)%2) + ((c-1)%2) + ((d+3)%2) <= 1 )): print("YES") else: print...
output
1
81,892
7
163,785