message stringlengths 2 67k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 463 109k | cluster float64 19 19 | __index_level_0__ int64 926 217k |
|---|---|---|---|---|---|
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A and B are preparing themselves for programming contests.
To train their logical thinking and solve problems better, A and B decided to play chess. During the game A wondered whose position is... | instruction | 0 | 40,772 | 19 | 81,544 |
Yes | output | 1 | 40,772 | 19 | 81,545 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A and B are preparing themselves for programming contests.
To train their logical thinking and solve problems better, A and B decided to play chess. During the game A wondered whose position is... | instruction | 0 | 40,773 | 19 | 81,546 |
Yes | output | 1 | 40,773 | 19 | 81,547 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A and B are preparing themselves for programming contests.
To train their logical thinking and solve problems better, A and B decided to play chess. During the game A wondered whose position is... | instruction | 0 | 40,774 | 19 | 81,548 |
Yes | output | 1 | 40,774 | 19 | 81,549 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A and B are preparing themselves for programming contests.
To train their logical thinking and solve problems better, A and B decided to play chess. During the game A wondered whose position is... | instruction | 0 | 40,775 | 19 | 81,550 |
No | output | 1 | 40,775 | 19 | 81,551 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A and B are preparing themselves for programming contests.
To train their logical thinking and solve problems better, A and B decided to play chess. During the game A wondered whose position is... | instruction | 0 | 40,776 | 19 | 81,552 |
No | output | 1 | 40,776 | 19 | 81,553 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A and B are preparing themselves for programming contests.
To train their logical thinking and solve problems better, A and B decided to play chess. During the game A wondered whose position is... | instruction | 0 | 40,777 | 19 | 81,554 |
No | output | 1 | 40,777 | 19 | 81,555 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A and B are preparing themselves for programming contests.
To train their logical thinking and solve problems better, A and B decided to play chess. During the game A wondered whose position is... | instruction | 0 | 40,778 | 19 | 81,556 |
No | output | 1 | 40,778 | 19 | 81,557 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
This is an interactive problem.
Anton and Harris are playing a game to decide which of them is the king of problemsetting.
There are three piles of stones, initially containing a, b, and c sto... | instruction | 0 | 41,429 | 19 | 82,858 |
No | output | 1 | 41,429 | 19 | 82,859 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
This is an interactive problem.
Anton and Harris are playing a game to decide which of them is the king of problemsetting.
There are three piles of stones, initially containing a, b, and c sto... | instruction | 0 | 41,430 | 19 | 82,860 |
No | output | 1 | 41,430 | 19 | 82,861 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
This is an interactive problem.
Anton and Harris are playing a game to decide which of them is the king of problemsetting.
There are three piles of stones, initially containing a, b, and c sto... | instruction | 0 | 41,431 | 19 | 82,862 |
No | output | 1 | 41,431 | 19 | 82,863 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
This is an interactive problem.
Anton and Harris are playing a game to decide which of them is the king of problemsetting.
There are three piles of stones, initially containing a, b, and c sto... | instruction | 0 | 41,432 | 19 | 82,864 |
No | output | 1 | 41,432 | 19 | 82,865 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There always is something to choose from! And now, instead of "Noughts and Crosses", Inna choose a very unusual upgrade of this game. The rules of the game are given below:
There is one person playing the game. Before the beginning of the g... | instruction | 0 | 41,562 | 19 | 83,124 |
Tags: implementation
Correct Solution:
```
tests = int(input())
while tests > 0:
field = input()
# a * b = 12: (1, 12), (12, 1), (2, 6), (6, 2), (3, 4), (4, 3) <- 6
variants = []
for lines, columns in ((1, 12), (2, 6), (3, 4), (4, 3), (6, 2), (12, 1)):
def x_column(column):
global ... | output | 1 | 41,562 | 19 | 83,125 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There always is something to choose from! And now, instead of "Noughts and Crosses", Inna choose a very unusual upgrade of this game. The rules of the game are given below:
There is one person playing the game. Before the beginning of the g... | instruction | 0 | 41,563 | 19 | 83,126 |
Tags: implementation
Correct Solution:
```
n=int(input())
ar=[[1,12],[2,6],[3,4],[4,3],[6,2],[12,1]]
for _ in range(n):
s=str(input())
cou=0
ans=""
skip=False
for it in ar:
a,b=it
skip=False
for j in range(b):
if(skip):
continue
if(s[j]=="X"):
if(a==1):
ans+=f... | output | 1 | 41,563 | 19 | 83,127 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There always is something to choose from! And now, instead of "Noughts and Crosses", Inna choose a very unusual upgrade of this game. The rules of the game are given below:
There is one person playing the game. Before the beginning of the g... | instruction | 0 | 41,564 | 19 | 83,128 |
Tags: implementation
Correct Solution:
```
fact = [2,3,4,6]
n = int(input())
l1 = []
for i in range(n):
t = input()
l2 = []
if t.count("X"):
l2.append("1x12")
for j in fact:
for k in range(12//j):
flag = 0
# print(j)
for l in range(k,12,12//j):
# print(k,j,l)
if t[l] == "X":
pass... | output | 1 | 41,564 | 19 | 83,129 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There always is something to choose from! And now, instead of "Noughts and Crosses", Inna choose a very unusual upgrade of this game. The rules of the game are given below:
There is one person playing the game. Before the beginning of the g... | instruction | 0 | 41,565 | 19 | 83,130 |
Tags: implementation
Correct Solution:
```
import sys
import math
t = int(sys.stdin.readline())
for i in range(t):
st = sys.stdin.readline()
p1 = 1
p2 = [1] * 2
p3 = [1] * 3
p4 = [1] * 4
p6 = [1] * 6
p12 = 0
for j in range(1, 13):
v = 0
if(st[j - 1] == 'X'):
... | output | 1 | 41,565 | 19 | 83,131 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There always is something to choose from! And now, instead of "Noughts and Crosses", Inna choose a very unusual upgrade of this game. The rules of the game are given below:
There is one person playing the game. Before the beginning of the g... | instruction | 0 | 41,566 | 19 | 83,132 |
Tags: implementation
Correct Solution:
```
def isMatch(n,s):
x = 12//n
res = []
for i in range(0,len(s),x):
res.append(s[i:i+x])
for col in range(x):
for row in range(len(res)):
if res[row][col] != 'X':
break
elif res[row][col] == 'X' and row == len(res)-1 :
return True ... | output | 1 | 41,566 | 19 | 83,133 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There always is something to choose from! And now, instead of "Noughts and Crosses", Inna choose a very unusual upgrade of this game. The rules of the game are given below:
There is one person playing the game. Before the beginning of the g... | instruction | 0 | 41,567 | 19 | 83,134 |
Tags: implementation
Correct Solution:
```
a=[1,2,3,4,6,12]
for _ in range(int(input())):
s=input()
b=[]
for i in a:
m=12//i
for j in range(m):
if s[j::m]=="X"*i:
b+=[(i,m)]
break
print(len(b), ' '.join(str(x)+"x"+str(y) for x,y in b))
... | output | 1 | 41,567 | 19 | 83,135 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There always is something to choose from! And now, instead of "Noughts and Crosses", Inna choose a very unusual upgrade of this game. The rules of the game are given below:
There is one person playing the game. Before the beginning of the g... | instruction | 0 | 41,568 | 19 | 83,136 |
Tags: implementation
Correct Solution:
```
def is_possible(request, a):
b = 12 // a
for i in range(b):
if 'O' not in [request[i + j * b] for j in range(a)]:
return True
return False
def solve(request):
possible_ways = [1, 2, 3, 4, 6, 12]
count_ways = 0
ways = []
for... | output | 1 | 41,568 | 19 | 83,137 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There always is something to choose from! And now, instead of "Noughts and Crosses", Inna choose a very unusual upgrade of this game. The rules of the game are given below:
There is one person playing the game. Before the beginning of the g... | instruction | 0 | 41,569 | 19 | 83,138 |
Tags: implementation
Correct Solution:
```
t = int(input())
for _ in range(t):
s = input().strip()
S = [a == 'X' for a in s]
ans = []
if s == 'O'*12:
print(0)
elif s == 'X'*12:
print('6 1x12 2x6 3x4 4x3 6x2 12x1')
else:
ans.append('1x12')
s1 = [S[6*i] for i in range(0,2)]
s2 = [S[6*i+1] ... | output | 1 | 41,569 | 19 | 83,139 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There always is something to choose from! And now, instead of "Noughts and Crosses", Inna choose a very unusual upgrade of this game. The rules of the game are given below:
There is one person ... | instruction | 0 | 41,570 | 19 | 83,140 |
Yes | output | 1 | 41,570 | 19 | 83,141 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There always is something to choose from! And now, instead of "Noughts and Crosses", Inna choose a very unusual upgrade of this game. The rules of the game are given below:
There is one person ... | instruction | 0 | 41,571 | 19 | 83,142 |
Yes | output | 1 | 41,571 | 19 | 83,143 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There always is something to choose from! And now, instead of "Noughts and Crosses", Inna choose a very unusual upgrade of this game. The rules of the game are given below:
There is one person ... | instruction | 0 | 41,572 | 19 | 83,144 |
Yes | output | 1 | 41,572 | 19 | 83,145 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There always is something to choose from! And now, instead of "Noughts and Crosses", Inna choose a very unusual upgrade of this game. The rules of the game are given below:
There is one person ... | instruction | 0 | 41,573 | 19 | 83,146 |
Yes | output | 1 | 41,573 | 19 | 83,147 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There always is something to choose from! And now, instead of "Noughts and Crosses", Inna choose a very unusual upgrade of this game. The rules of the game are given below:
There is one person ... | instruction | 0 | 41,574 | 19 | 83,148 |
No | output | 1 | 41,574 | 19 | 83,149 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There always is something to choose from! And now, instead of "Noughts and Crosses", Inna choose a very unusual upgrade of this game. The rules of the game are given below:
There is one person ... | instruction | 0 | 41,575 | 19 | 83,150 |
No | output | 1 | 41,575 | 19 | 83,151 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There always is something to choose from! And now, instead of "Noughts and Crosses", Inna choose a very unusual upgrade of this game. The rules of the game are given below:
There is one person ... | instruction | 0 | 41,576 | 19 | 83,152 |
No | output | 1 | 41,576 | 19 | 83,153 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There always is something to choose from! And now, instead of "Noughts and Crosses", Inna choose a very unusual upgrade of this game. The rules of the game are given below:
There is one person ... | instruction | 0 | 41,577 | 19 | 83,154 |
No | output | 1 | 41,577 | 19 | 83,155 |
Provide tags and a correct Python 3 solution for this coding contest problem.
After the fourth season Sherlock and Moriary have realized the whole foolishness of the battle between them and decided to continue their competitions in peaceful game of Credit Cards.
Rules of this game are simple: each player bring his fa... | instruction | 0 | 41,720 | 19 | 83,440 |
Tags: data structures, dp, greedy, sortings
Correct Solution:
```
import os
import sys
from math import *
from collections import *
# from fractions import *
# from heapq import*
from bisect import *
from io import BytesIO, IOBase
def vsInput():
sys.stdin = open("input.txt", "r")
sys.stdout = open("output.tx... | output | 1 | 41,720 | 19 | 83,441 |
Provide tags and a correct Python 3 solution for this coding contest problem.
After the fourth season Sherlock and Moriary have realized the whole foolishness of the battle between them and decided to continue their competitions in peaceful game of Credit Cards.
Rules of this game are simple: each player bring his fa... | instruction | 0 | 41,721 | 19 | 83,442 |
Tags: data structures, dp, greedy, sortings
Correct Solution:
```
from collections import defaultdict
n = int(input())
S =input()
M = input()
X = []
Sher = []
Moriarty = defaultdict(int)
MorF = defaultdict(int)
Mor = []
for i in S:
Sher.append(int(i))
for j in M:
Moriarty[int(j)]+=1
MorF[int(j)]+=1
Mor.... | output | 1 | 41,721 | 19 | 83,443 |
Provide tags and a correct Python 3 solution for this coding contest problem.
After the fourth season Sherlock and Moriary have realized the whole foolishness of the battle between them and decided to continue their competitions in peaceful game of Credit Cards.
Rules of this game are simple: each player bring his fa... | instruction | 0 | 41,722 | 19 | 83,444 |
Tags: data structures, dp, greedy, sortings
Correct Solution:
```
'''input
2
88
00
'''
n = int(input())
a, b = sorted(input()), sorted(input())
i, m = 0, 0
for x in b:
if x >= a[i]:
i += 1
m += 1
print(n - m)
i, m = 0, 0
for y in b:
if y > a[i]:
i += 1
m += 1
print(m)
``` | output | 1 | 41,722 | 19 | 83,445 |
Provide tags and a correct Python 3 solution for this coding contest problem.
After the fourth season Sherlock and Moriary have realized the whole foolishness of the battle between them and decided to continue their competitions in peaceful game of Credit Cards.
Rules of this game are simple: each player bring his fa... | instruction | 0 | 41,723 | 19 | 83,446 |
Tags: data structures, dp, greedy, sortings
Correct Solution:
```
# https://codeforces.com/problemset/problem/777/B
# Problem
# Big O:
# Time complexity: O(n log (n)) + 2*(O(n) + O(n))*O(k) = O(n)*O(k)
# Space complexity: 3*O(n) = O(n)
# Problem
def value_index_greater_or_equal_than(ordered_list, number):
for i ... | output | 1 | 41,723 | 19 | 83,447 |
Provide tags and a correct Python 3 solution for this coding contest problem.
After the fourth season Sherlock and Moriary have realized the whole foolishness of the battle between them and decided to continue their competitions in peaceful game of Credit Cards.
Rules of this game are simple: each player bring his fa... | instruction | 0 | 41,724 | 19 | 83,448 |
Tags: data structures, dp, greedy, sortings
Correct Solution:
```
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Filename : 401_DIV2_B
# @Date : 2017-09-18 16:34
# @Author : LunaFire
# @Mail : 315135833@qq.com
if __name__ == "__main__":
n = int(input())
a, b = list(input()), list(input()... | output | 1 | 41,724 | 19 | 83,449 |
Provide tags and a correct Python 3 solution for this coding contest problem.
After the fourth season Sherlock and Moriary have realized the whole foolishness of the battle between them and decided to continue their competitions in peaceful game of Credit Cards.
Rules of this game are simple: each player bring his fa... | instruction | 0 | 41,725 | 19 | 83,450 |
Tags: data structures, dp, greedy, sortings
Correct Solution:
```
n=int(input())
s1=input()
s2=input()
st1=[]
st2=[]
for i in range(n):
st1.append(int(s1[i]))
st2.append(int(s2[i]))
st2.sort()
st1.sort()
ded1=[]
ded2=[]
d1=0
d2=0
for i in range(n):
for j in range(n):
if st1[j]>st2[j]:
d1... | output | 1 | 41,725 | 19 | 83,451 |
Provide tags and a correct Python 3 solution for this coding contest problem.
After the fourth season Sherlock and Moriary have realized the whole foolishness of the battle between them and decided to continue their competitions in peaceful game of Credit Cards.
Rules of this game are simple: each player bring his fa... | instruction | 0 | 41,726 | 19 | 83,452 |
Tags: data structures, dp, greedy, sortings
Correct Solution:
```
n = int(input())
a = sorted(list(input()))
b = sorted(list(input()), reverse = True)
cnt1 = [0] * 10
cnt2 = [0] * 10
for i in range(n):
cnt1[ord(b[i])-48]+=1
cnt2[ord(a[i])-48]+=1
A = 0
B = n
for i in range(n):
k = ord(a[i])-48
for j in r... | output | 1 | 41,726 | 19 | 83,453 |
Provide tags and a correct Python 3 solution for this coding contest problem.
After the fourth season Sherlock and Moriary have realized the whole foolishness of the battle between them and decided to continue their competitions in peaceful game of Credit Cards.
Rules of this game are simple: each player bring his fa... | instruction | 0 | 41,727 | 19 | 83,454 |
Tags: data structures, dp, greedy, sortings
Correct Solution:
```
from collections import defaultdict
n = int(input())
s1 = input()
s2 = input()
occ = defaultdict(int)
for i in s2:
occ[int(i)]+=1
def find_min(x):
global occ
for i in range(x, 10):
if occ[i] > 0:
occ[i]-=1
... | output | 1 | 41,727 | 19 | 83,455 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
After the fourth season Sherlock and Moriary have realized the whole foolishness of the battle between them and decided to continue their competitions in peaceful game of Credit Cards.
Rules of... | instruction | 0 | 41,728 | 19 | 83,456 |
Yes | output | 1 | 41,728 | 19 | 83,457 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
After the fourth season Sherlock and Moriary have realized the whole foolishness of the battle between them and decided to continue their competitions in peaceful game of Credit Cards.
Rules of... | instruction | 0 | 41,729 | 19 | 83,458 |
Yes | output | 1 | 41,729 | 19 | 83,459 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
After the fourth season Sherlock and Moriary have realized the whole foolishness of the battle between them and decided to continue their competitions in peaceful game of Credit Cards.
Rules of... | instruction | 0 | 41,730 | 19 | 83,460 |
Yes | output | 1 | 41,730 | 19 | 83,461 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
After the fourth season Sherlock and Moriary have realized the whole foolishness of the battle between them and decided to continue their competitions in peaceful game of Credit Cards.
Rules of... | instruction | 0 | 41,731 | 19 | 83,462 |
Yes | output | 1 | 41,731 | 19 | 83,463 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
After the fourth season Sherlock and Moriary have realized the whole foolishness of the battle between them and decided to continue their competitions in peaceful game of Credit Cards.
Rules of... | instruction | 0 | 41,732 | 19 | 83,464 |
No | output | 1 | 41,732 | 19 | 83,465 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
After the fourth season Sherlock and Moriary have realized the whole foolishness of the battle between them and decided to continue their competitions in peaceful game of Credit Cards.
Rules of... | instruction | 0 | 41,733 | 19 | 83,466 |
No | output | 1 | 41,733 | 19 | 83,467 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
After the fourth season Sherlock and Moriary have realized the whole foolishness of the battle between them and decided to continue their competitions in peaceful game of Credit Cards.
Rules of... | instruction | 0 | 41,734 | 19 | 83,468 |
No | output | 1 | 41,734 | 19 | 83,469 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
After the fourth season Sherlock and Moriary have realized the whole foolishness of the battle between them and decided to continue their competitions in peaceful game of Credit Cards.
Rules of... | instruction | 0 | 41,735 | 19 | 83,470 |
No | output | 1 | 41,735 | 19 | 83,471 |
Provide a correct Python 3 solution for this coding contest problem.
There is a puzzle to complete by combining 14 numbers from 1 to 9. Complete by adding another number to the given 13 numbers.
The conditions for completing the puzzle are
* You must have one combination of the same numbers.
* The remaining 12 numbe... | instruction | 0 | 41,965 | 19 | 83,930 |
"Correct Solution:
```
from collections import deque
try:
while True:
a = list(sorted(map(int, input())))
result = []
for i in range(1, 10):
if a.count(i) == 4:
continue
_a = sorted(a+[i])
dq = deque([(_a, 0)])
while dq:
... | output | 1 | 41,965 | 19 | 83,931 |
Provide a correct Python 3 solution for this coding contest problem.
There is a puzzle to complete by combining 14 numbers from 1 to 9. Complete by adding another number to the given 13 numbers.
The conditions for completing the puzzle are
* You must have one combination of the same numbers.
* The remaining 12 numbe... | instruction | 0 | 41,968 | 19 | 83,936 |
"Correct Solution:
```
def check_set(hand):
set_list = []
for i in range(9):
if hand.count(i + 1) >= 3:
set_list.append([i + 1, i + 1, i + 1])
if i + 1 in hand and i + 2 in hand and i + 3 in hand:
set_list.append([i + 1, i + 2, i + 3])
return set_list
def check_winni... | output | 1 | 41,968 | 19 | 83,937 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Two players are playing a game. First each of them writes an integer from 1 to 6, and then a dice is thrown. The player whose written number got closer to the number on the dice wins. If both payers have the same difference, it's a draw.
Th... | instruction | 0 | 42,423 | 19 | 84,846 |
Tags: brute force
Correct Solution:
```
a,b=map(int,input().split())
x=int(1)
aa=bb=d=int(0)
while x<=6:
if abs(a-x)<abs(b-x):
aa=aa+1
elif abs(a-x)>abs(b-x):
bb=bb+1
else:
d=d+1
x=x+1
print(aa,d,bb)
``` | output | 1 | 42,423 | 19 | 84,847 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Two players are playing a game. First each of them writes an integer from 1 to 6, and then a dice is thrown. The player whose written number got closer to the number on the dice wins. If both payers have the same difference, it's a draw.
Th... | instruction | 0 | 42,424 | 19 | 84,848 |
Tags: brute force
Correct Solution:
```
"""
βββ βββββββ βββ βββββββ βββββββ βββ ββββββ
βββββββββββββββ βββββββββββββββββββββββββββββ
ββββββ ββββββ ββββββββββββββββββββββββββββ
ββββββ ββββββ βββββββ βββββββββ βββ βββββββ
βββββββββββββββ βββββββββββββββββ βββ βββββββ
βββ βββββββ βββ ββββββββ ββββ... | output | 1 | 42,424 | 19 | 84,849 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Two players are playing a game. First each of them writes an integer from 1 to 6, and then a dice is thrown. The player whose written number got closer to the number on the dice wins. If both payers have the same difference, it's a draw.
Th... | instruction | 0 | 42,425 | 19 | 84,850 |
Tags: brute force
Correct Solution:
```
a,b=map(int,input().split())
c=0
d=0
e=0
for i in range(1,7):
if(abs(a-i)<abs(b-i)):
c=c+1
elif(abs(a-i)>abs(b-i)):
d=d+1
elif(abs(a-i)==abs(b-i)):
e=e+1
print(c,e,d,sep=" ")
``` | output | 1 | 42,425 | 19 | 84,851 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Two players are playing a game. First each of them writes an integer from 1 to 6, and then a dice is thrown. The player whose written number got closer to the number on the dice wins. If both payers have the same difference, it's a draw.
Th... | instruction | 0 | 42,426 | 19 | 84,852 |
Tags: brute force
Correct Solution:
```
first=0
second=0
draw=0
z,x=list(map(int,input().split()))
for i in range(1,7):
#print('(i-z)=%d (i-x)=%d'%(abs(i-z),abs(i-x)))
if abs(i-z)<abs(i-x):
first+=1
# print('first',first)
elif abs(i-z)>abs(i-x) :
second+=1
# print('second',se... | output | 1 | 42,426 | 19 | 84,853 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Two players are playing a game. First each of them writes an integer from 1 to 6, and then a dice is thrown. The player whose written number got closer to the number on the dice wins. If both payers have the same difference, it's a draw.
Th... | instruction | 0 | 42,427 | 19 | 84,854 |
Tags: brute force
Correct Solution:
```
a, b = (int(s) for s in input().split())
results = [0, 0, 0]
for i in range(1, 7):
if abs(a - i) < abs(b - i):
results[0] += 1
elif abs(a - i) > abs(b - i):
results[2] += 1
else:
results[1] += 1
print(results[0], results[1], results[2])
... | output | 1 | 42,427 | 19 | 84,855 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.