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. Manao is trying to open a rather challenging lock. The lock has n buttons on it and to open it, you should press the buttons in a certain order to open the lock. When you push some button, it ei...
instruction
0
2,765
19
5,530
No
output
1
2,765
19
5,531
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Manao is trying to open a rather challenging lock. The lock has n buttons on it and to open it, you should press the buttons in a certain order to open the lock. When you push some button, it ei...
instruction
0
2,766
19
5,532
No
output
1
2,766
19
5,533
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Manao is trying to open a rather challenging lock. The lock has n buttons on it and to open it, you should press the buttons in a certain order to open the lock. When you push some button, it ei...
instruction
0
2,767
19
5,534
No
output
1
2,767
19
5,535
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Radewoosh is playing a computer game. There are n levels, numbered 1 through n. Levels are divided into k regions (groups). Each region contains some positive number of consecutive levels. The ...
instruction
0
2,933
19
5,866
No
output
1
2,933
19
5,867
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Radewoosh is playing a computer game. There are n levels, numbered 1 through n. Levels are divided into k regions (groups). Each region contains some positive number of consecutive levels. The ...
instruction
0
2,934
19
5,868
No
output
1
2,934
19
5,869
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Radewoosh is playing a computer game. There are n levels, numbered 1 through n. Levels are divided into k regions (groups). Each region contains some positive number of consecutive levels. The ...
instruction
0
2,935
19
5,870
No
output
1
2,935
19
5,871
Provide tags and a correct Python 3 solution for this coding contest problem. Vasily has a deck of cards consisting of n cards. There is an integer on each of the cards, this integer is between 1 and 100 000, inclusive. It is possible that some cards have the same integers on them. Vasily decided to sort the cards. T...
instruction
0
3,020
19
6,040
Tags: data structures, implementation, sortings Correct Solution: ``` from collections import deque import heapq n = int(input()) cards_help = list(map(int, input().split())) cards = [ (cards_help[i],-1*i) for i in range(n) ] heapq.heapify(cards) draws = 0 removed = 0 while cards: prev = -1 new_removals = 0...
output
1
3,020
19
6,041
Provide tags and a correct Python 3 solution for this coding contest problem. Vasily has a deck of cards consisting of n cards. There is an integer on each of the cards, this integer is between 1 and 100 000, inclusive. It is possible that some cards have the same integers on them. Vasily decided to sort the cards. T...
instruction
0
3,021
19
6,042
Tags: data structures, implementation, sortings Correct Solution: ``` def main(): input() numbers = tuple(map(int, input().split())) d = [] for i in range(len(numbers)): while len(d) <= numbers[i]: d.append([]) d[numbers[i]].append(i) dd = [[]] for line in d: ...
output
1
3,021
19
6,043
Provide tags and a correct Python 3 solution for this coding contest problem. Vasily has a deck of cards consisting of n cards. There is an integer on each of the cards, this integer is between 1 and 100 000, inclusive. It is possible that some cards have the same integers on them. Vasily decided to sort the cards. T...
instruction
0
3,022
19
6,044
Tags: data structures, implementation, sortings Correct Solution: ``` from collections import deque import heapq n = int(input()) cards_help = list(map(int, input().split())) cards = [ (cards_help[i],-1*i) for i in range(n) ] heapq.heapify(cards) draws = 0 removed = 0 while cards: prev = -1 new_removals = 0 ...
output
1
3,022
19
6,045
Provide tags and a correct Python 3 solution for this coding contest problem. Vasily has a deck of cards consisting of n cards. There is an integer on each of the cards, this integer is between 1 and 100 000, inclusive. It is possible that some cards have the same integers on them. Vasily decided to sort the cards. T...
instruction
0
3,023
19
6,046
Tags: data structures, implementation, sortings Correct Solution: ``` def solve(arr): b = list(enumerate(arr)) b.sort(key=lambda x: (x[1])) res = 0 prev_right = -1 prev_level = -1 cur_level = 1 cur_value = -1 cur_right = -1 for i, v in b: if v > cur_value: prev_le...
output
1
3,023
19
6,047
Provide tags and a correct Python 3 solution for this coding contest problem. Vasily has a deck of cards consisting of n cards. There is an integer on each of the cards, this integer is between 1 and 100 000, inclusive. It is possible that some cards have the same integers on them. Vasily decided to sort the cards. T...
instruction
0
3,024
19
6,048
Tags: data structures, implementation, sortings Correct Solution: ``` n = int(input()) s = list(map(int,input().split(' '))) a = [] for i in range(max(s)): a.append([]) for i in range(len(s)): a[s[i]-1].append(i) a = list(filter(lambda x: x != [], a)) if len(a) > 1: for i in range(1,len(a)): if ...
output
1
3,024
19
6,049
Provide tags and a correct Python 3 solution for this coding contest problem. Vasily has a deck of cards consisting of n cards. There is an integer on each of the cards, this integer is between 1 and 100 000, inclusive. It is possible that some cards have the same integers on them. Vasily decided to sort the cards. T...
instruction
0
3,025
19
6,050
Tags: data structures, implementation, sortings Correct Solution: ``` from bisect import bisect_left def read(): return [int(x) for x in input().split()] n = read() a = read() vec = [list() for i in range(max(a)+1)] for i in range(len(a)): vec[a[i]].append(i) def solve(): ans =0 dis = 1 p = 0 ...
output
1
3,025
19
6,051
Provide tags and a correct Python 3 solution for this coding contest problem. Vasily has a deck of cards consisting of n cards. There is an integer on each of the cards, this integer is between 1 and 100 000, inclusive. It is possible that some cards have the same integers on them. Vasily decided to sort the cards. T...
instruction
0
3,026
19
6,052
Tags: data structures, implementation, sortings Correct Solution: ``` # -*- coding: utf-8 -*- import sys # fout = open("output.txt", "w") fin = sys.stdin # fin = open("input.txt", "r") fout = sys.stdout n = int(fin.readline()) a = list(map(int, fin.readline().split())) def solution(n, a): sorted_arr = [(i, ele...
output
1
3,026
19
6,053
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasily has a deck of cards consisting of n cards. There is an integer on each of the cards, this integer is between 1 and 100 000, inclusive. It is possible that some cards have the same integer...
instruction
0
3,027
19
6,054
No
output
1
3,027
19
6,055
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasily has a deck of cards consisting of n cards. There is an integer on each of the cards, this integer is between 1 and 100 000, inclusive. It is possible that some cards have the same integer...
instruction
0
3,028
19
6,056
No
output
1
3,028
19
6,057
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasily has a deck of cards consisting of n cards. There is an integer on each of the cards, this integer is between 1 and 100 000, inclusive. It is possible that some cards have the same integer...
instruction
0
3,029
19
6,058
No
output
1
3,029
19
6,059
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vasily has a deck of cards consisting of n cards. There is an integer on each of the cards, this integer is between 1 and 100 000, inclusive. It is possible that some cards have the same integer...
instruction
0
3,030
19
6,060
No
output
1
3,030
19
6,061
Provide tags and a correct Python 3 solution for this coding contest problem. Recently Vasya decided to improve his pistol shooting skills. Today his coach offered him the following exercise. He placed n cans in a row on a table. Cans are numbered from left to right from 1 to n. Vasya has to knock down each can exactl...
instruction
0
3,424
19
6,848
Tags: greedy, implementation, sortings Correct Solution: ``` n = int(input()) l = list(map(int, input().split())) ind = {} i = 0 s = 0 for j in l: if j in ind.keys(): ind[j].append(str(i + 1)) else: ind[j] = [str(i + 1)] i += 1 l.sort(key = lambda x : -x) for x in range(len(l)): s += l[x...
output
1
3,424
19
6,849
Provide tags and a correct Python 3 solution for this coding contest problem. Recently Vasya decided to improve his pistol shooting skills. Today his coach offered him the following exercise. He placed n cans in a row on a table. Cans are numbered from left to right from 1 to n. Vasya has to knock down each can exactl...
instruction
0
3,425
19
6,850
Tags: greedy, implementation, sortings Correct Solution: ``` n = int(input()) a = [(int(el), i + 1) for i, el in enumerate(input().split())] a = sorted(a, reverse=True) shots = 0 for i, (el, _) in enumerate(a): shots += i * el + 1 print(shots) print(*(i for _, i in a)) ```
output
1
3,425
19
6,851
Provide tags and a correct Python 3 solution for this coding contest problem. Recently Vasya decided to improve his pistol shooting skills. Today his coach offered him the following exercise. He placed n cans in a row on a table. Cans are numbered from left to right from 1 to n. Vasya has to knock down each can exactl...
instruction
0
3,426
19
6,852
Tags: greedy, implementation, sortings Correct Solution: ``` n = int(input()) a = list(map(int, input().split())) r = [] ans = 0 for i in range(n): pos = -1 for j in range(n): if (pos == -1 or a[j] > a[pos]): pos = j r.append(pos + 1) ans += i * a[pos] + 1 a[pos] = 0 print(ans) print(*r) ```
output
1
3,426
19
6,853
Provide tags and a correct Python 3 solution for this coding contest problem. Recently Vasya decided to improve his pistol shooting skills. Today his coach offered him the following exercise. He placed n cans in a row on a table. Cans are numbered from left to right from 1 to n. Vasya has to knock down each can exactl...
instruction
0
3,427
19
6,854
Tags: greedy, implementation, sortings Correct Solution: ``` n=int(input()) x=list(map(int,input().split())) y=[] for i in range(n) : y.append([x[i],i+1]) y=sorted(y);s=0;temp=[] y=list(reversed(y)) for i in range(n) : s=s+(y[i][0]*i+1) temp.append(y[i][1]) print(s) for c in temp : print(c,end=' ') ``...
output
1
3,427
19
6,855
Provide tags and a correct Python 3 solution for this coding contest problem. Recently Vasya decided to improve his pistol shooting skills. Today his coach offered him the following exercise. He placed n cans in a row on a table. Cans are numbered from left to right from 1 to n. Vasya has to knock down each can exactl...
instruction
0
3,428
19
6,856
Tags: greedy, implementation, sortings Correct Solution: ``` n=int(input()) aa=list(map(int, input().split())) a=[ [0]*2 for i in range(n)] for i in range(n): a[i][0]=aa[i] a[i][1]=i+1 #for i in range(n): #for j in range(2): #print(a[i][j], end=' ') #print() a.sort(key= lambda x: x[0]) #for i in...
output
1
3,428
19
6,857
Provide tags and a correct Python 3 solution for this coding contest problem. Recently Vasya decided to improve his pistol shooting skills. Today his coach offered him the following exercise. He placed n cans in a row on a table. Cans are numbered from left to right from 1 to n. Vasya has to knock down each can exactl...
instruction
0
3,429
19
6,858
Tags: greedy, implementation, sortings Correct Solution: ``` n = int(input()) h = list(map(int, input().split())) s = 0 c = [] i = 0 while i < n: c.append(h.index(max(h))+1) s += max(h)*i+1 h[h.index(max(h))] = -100 i+=1 print(s) i = 0 while i < len(c): print(c[i], end=' ') i+=1 ```
output
1
3,429
19
6,859
Provide tags and a correct Python 3 solution for this coding contest problem. Recently Vasya decided to improve his pistol shooting skills. Today his coach offered him the following exercise. He placed n cans in a row on a table. Cans are numbered from left to right from 1 to n. Vasya has to knock down each can exactl...
instruction
0
3,430
19
6,860
Tags: greedy, implementation, sortings Correct Solution: ``` n = int(input()) s = map(int,input().split()) s = list(s) # max(s) - это дорогая опСрация (O(n)), Ρ‚ΠΎΡ‡Π½ΠΎ Ρ‚Π°ΠΊ ΠΆΠ΅, ΠΊΠ°ΠΊ ΠΈ s.index(a) # Π₯отя для этой Π·Π°Π΄Π°Ρ‡ΠΈ это Π½Π΅ ΠΏΡ€ΠΈΠ½Ρ†ΠΈΠΏΠΈΠ°Π»ΡŒΠ½ΠΎ, всС ΠΆΠ΅ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡƒ ΠΌΠΎΠΆΠ½ΠΎ сильно ΡƒΡΠΊΠΎΡ€ΠΈΡ‚ΡŒ # БСйчас Π΅Ρ‘ ΡΠ»ΠΎΠΆΠ½ΠΎΡΡ‚ΡŒ Ρ€Π°Π²Π½Π° O(n^2), Π° ΠΌΡ‹ уско...
output
1
3,430
19
6,861
Provide tags and a correct Python 3 solution for this coding contest problem. Recently Vasya decided to improve his pistol shooting skills. Today his coach offered him the following exercise. He placed n cans in a row on a table. Cans are numbered from left to right from 1 to n. Vasya has to knock down each can exactl...
instruction
0
3,431
19
6,862
Tags: greedy, implementation, sortings Correct Solution: ``` # -*- coding: utf-8 -*- """ Created on Wed Jul 29 07:49:14 2020 @author: Harshal """ n=int(input()) arr=list(map(int,input().split())) temp=[(c,i) for i,c in enumerate(arr)] temp.sort(reverse=True) score=0 order=[] for i,can in enumerate(temp): scor...
output
1
3,431
19
6,863
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Recently Vasya decided to improve his pistol shooting skills. Today his coach offered him the following exercise. He placed n cans in a row on a table. Cans are numbered from left to right from ...
instruction
0
3,432
19
6,864
Yes
output
1
3,432
19
6,865
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Recently Vasya decided to improve his pistol shooting skills. Today his coach offered him the following exercise. He placed n cans in a row on a table. Cans are numbered from left to right from ...
instruction
0
3,433
19
6,866
Yes
output
1
3,433
19
6,867
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Recently Vasya decided to improve his pistol shooting skills. Today his coach offered him the following exercise. He placed n cans in a row on a table. Cans are numbered from left to right from ...
instruction
0
3,434
19
6,868
Yes
output
1
3,434
19
6,869
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Recently Vasya decided to improve his pistol shooting skills. Today his coach offered him the following exercise. He placed n cans in a row on a table. Cans are numbered from left to right from ...
instruction
0
3,435
19
6,870
Yes
output
1
3,435
19
6,871
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Recently Vasya decided to improve his pistol shooting skills. Today his coach offered him the following exercise. He placed n cans in a row on a table. Cans are numbered from left to right from ...
instruction
0
3,436
19
6,872
No
output
1
3,436
19
6,873
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Recently Vasya decided to improve his pistol shooting skills. Today his coach offered him the following exercise. He placed n cans in a row on a table. Cans are numbered from left to right from ...
instruction
0
3,437
19
6,874
No
output
1
3,437
19
6,875
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Recently Vasya decided to improve his pistol shooting skills. Today his coach offered him the following exercise. He placed n cans in a row on a table. Cans are numbered from left to right from ...
instruction
0
3,438
19
6,876
No
output
1
3,438
19
6,877
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Recently Vasya decided to improve his pistol shooting skills. Today his coach offered him the following exercise. He placed n cans in a row on a table. Cans are numbered from left to right from ...
instruction
0
3,439
19
6,878
No
output
1
3,439
19
6,879
Provide a correct Python 3 solution for this coding contest problem. problem Prepare the Othello board. The upper left is $ (1,1) $ and the lower right is $ (8,8) $. The board to be prepared here is $ (5,4) as follows. ) There is no $ black stone. ........ ........ ........ ... ox ... .... o ... ........ ........ ....
instruction
0
4,130
19
8,260
"Correct Solution: ``` def inpl(): return list(map(int, input().split())) from collections import defaultdict G = dict() for i in range(9): G[(i, 9)] = 0 G[(9, i)] = 0 G[(9, 9)] = 0 for i in range(8)[::-1]: a = 8 - i b = -(-(8 - i)//2) i= i+1 for j in range(8)[::-1]: if j % 2 == 1: ...
output
1
4,130
19
8,261
Provide a correct Python 3 solution for this coding contest problem. problem Prepare the Othello board. The upper left is $ (1,1) $ and the lower right is $ (8,8) $. The board to be prepared here is $ (5,4) as follows. ) There is no $ black stone. ........ ........ ........ ... ox ... .... o ... ........ ........ ....
instruction
0
4,131
19
8,262
"Correct Solution: ``` #!usr/bin/env python3 from collections import defaultdict from heapq import heappush, heappop import sys import math import bisect import random def LI(): return list(map(int, sys.stdin.readline().split())) def I(): return int(sys.stdin.readline()) def LS():return list(map(list, sys.stdin.readlin...
output
1
4,131
19
8,263
Provide a correct Python 3 solution for this coding contest problem. problem Prepare the Othello board. The upper left is $ (1,1) $ and the lower right is $ (8,8) $. The board to be prepared here is $ (5,4) as follows. ) There is no $ black stone. ........ ........ ........ ... ox ... .... o ... ........ ........ ....
instruction
0
4,132
19
8,264
"Correct Solution: ``` q = int(input()) li = [input().split() for i in range(q)] for i in li: a, b, c, d = map(int, i) ans = 0 for j in range(a, c+1): for k in range(b, d+1): ans += 0 if j%2 == 1 and k%2 == 0 else 1 print(ans) ```
output
1
4,132
19
8,265
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Two kittens, Max and Min, play with a pair of non-negative integers x and y. As you can guess from their names, kitten Max loves to maximize and kitten Min loves to minimize. As part of this gam...
instruction
0
4,599
19
9,198
No
output
1
4,599
19
9,199
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Two kittens, Max and Min, play with a pair of non-negative integers x and y. As you can guess from their names, kitten Max loves to maximize and kitten Min loves to minimize. As part of this gam...
instruction
0
4,600
19
9,200
No
output
1
4,600
19
9,201
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Two kittens, Max and Min, play with a pair of non-negative integers x and y. As you can guess from their names, kitten Max loves to maximize and kitten Min loves to minimize. As part of this gam...
instruction
0
4,601
19
9,202
No
output
1
4,601
19
9,203
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Two kittens, Max and Min, play with a pair of non-negative integers x and y. As you can guess from their names, kitten Max loves to maximize and kitten Min loves to minimize. As part of this gam...
instruction
0
4,602
19
9,204
No
output
1
4,602
19
9,205
Provide a correct Python 3 solution for this coding contest problem. Life is not easy. Sometimes it is beyond your control. Now, as contestants of ACM ICPC, you might be just tasting the bitter of life. But don't worry! Do not look only on the dark side of life, but look also on the bright side. Life may be an enjoyab...
instruction
0
4,982
19
9,964
"Correct Solution: ``` # AOJ 1210: Die Game # Python3 2018.7.22 bal4u dic = {'s':1, 'w':2, 'e':3, 'n':4} rot = [[0,1,2,3,4,5,6],[0,2,6,3,4,1,5],[0,4,2,1,6,5,3],[0,3,2,6,1,5,4],[0,5,1,3,4,6,2]] while True: n = int(input()) if n == 0: break dice = [i for i in range(7)] for j in range(n): a = in...
output
1
4,982
19
9,965
Provide a correct Python 3 solution for this coding contest problem. Problem statement A $ 2 $ human-player match-up game tournament is about to take place in front of Kyoto University Camphor Tree. There are $ 2 ^ N $ participants in this tournament, numbered from $ 1 $ to $ 2 ^ N $. Winning or losing when $ 2 $ o...
instruction
0
4,994
19
9,988
"Correct Solution: ``` #!usr/bin/env python3 from collections import defaultdict, deque from heapq import heappush, heappop from itertools import permutations, accumulate import sys import math import bisect def LI(): return [int(x) for x in sys.stdin.readline().split()] def I(): return int(sys.stdin.readline()) def LS...
output
1
4,994
19
9,989
Provide a correct Python 3 solution for this coding contest problem. Problem statement A $ 2 $ human-player match-up game tournament is about to take place in front of Kyoto University Camphor Tree. There are $ 2 ^ N $ participants in this tournament, numbered from $ 1 $ to $ 2 ^ N $. Winning or losing when $ 2 $ o...
instruction
0
4,995
19
9,990
"Correct Solution: ``` import sys readline = sys.stdin.readline N = int(readline()) Ns = 1<<N S = [None]+list(map(int, readline().strip())) P = list(map(int, readline().split())) res = [None]*Ns res[0] = P res[1] = P[1:] + [P[0]] Ans = [None]*Ns for i in range(Ns): ri = res[i] leng = len(ri) for lev...
output
1
4,995
19
9,991
Provide a correct Python 3 solution for this coding contest problem. Problem statement A $ 2 $ human-player match-up game tournament is about to take place in front of Kyoto University Camphor Tree. There are $ 2 ^ N $ participants in this tournament, numbered from $ 1 $ to $ 2 ^ N $. Winning or losing when $ 2 $ o...
instruction
0
4,996
19
9,992
"Correct Solution: ``` import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N = int(readline()) S = [0] + [int(x) - ord('0') for x in readline().rstrip()] P = [int(x) for x in read().split()] P += P dp = [P] for i in range(N+1): P = dp[i] newP =...
output
1
4,996
19
9,993
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Cardbluff is popular sport game in Telegram. Each Cardbluff player has ever dreamed about entrance in the professional layer. There are n judges now in the layer and you are trying to pass the e...
instruction
0
5,077
19
10,154
No
output
1
5,077
19
10,155
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Cardbluff is popular sport game in Telegram. Each Cardbluff player has ever dreamed about entrance in the professional layer. There are n judges now in the layer and you are trying to pass the e...
instruction
0
5,078
19
10,156
No
output
1
5,078
19
10,157
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Cardbluff is popular sport game in Telegram. Each Cardbluff player has ever dreamed about entrance in the professional layer. There are n judges now in the layer and you are trying to pass the e...
instruction
0
5,079
19
10,158
No
output
1
5,079
19
10,159
Provide tags and a correct Python 3 solution for this coding contest problem. Tokitsukaze is playing a game derivated from Japanese mahjong. In this game, she has three tiles in her hand. Each tile she owns is a suited tile, which means it has a suit (manzu, pinzu or souzu) and a number (a digit ranged from 1 to 9). I...
instruction
0
5,103
19
10,206
Tags: brute force, implementation Correct Solution: ``` from collections import defaultdict as dfd d = dfd(int) arr = input().split() arr.sort() for i in arr: d[i] += 1 if max(d.values())==3 or (arr[0][1]==arr[1][1]==arr[2][1] and int(arr[0][0])+1==int(arr[1][0]) and int(arr[1][0])+1==int(arr[2][0])): print(...
output
1
5,103
19
10,207
Provide tags and a correct Python 3 solution for this coding contest problem. Tokitsukaze is playing a game derivated from Japanese mahjong. In this game, she has three tiles in her hand. Each tile she owns is a suited tile, which means it has a suit (manzu, pinzu or souzu) and a number (a digit ranged from 1 to 9). I...
instruction
0
5,104
19
10,208
Tags: brute force, implementation Correct Solution: ``` a = sorted(list(map(lambda x: ord(x[0]) + 256 * ord(x[1]), input().split()))) res = 2 if a[1] - a[0] in [0, 1, 2] or a[2] - a[1] in [0, 1, 2]: res = 1 if (a[0] == a[1] and a[1] == a[2]) or (a[0] + 1 == a[1] and a[1] + 1 == a[2]): res = 0 print(res) ```
output
1
5,104
19
10,209
Provide tags and a correct Python 3 solution for this coding contest problem. Tokitsukaze is playing a game derivated from Japanese mahjong. In this game, she has three tiles in her hand. Each tile she owns is a suited tile, which means it has a suit (manzu, pinzu or souzu) and a number (a digit ranged from 1 to 9). I...
instruction
0
5,105
19
10,210
Tags: brute force, implementation Correct Solution: ``` x,y,z = input().split() v = list((x,y,z)) v.sort() #print(v) a = int(v[0][0]) b = int(v[1][0]) c = int(v[2][0]) l = v[0][1] m = v[1][1] n = v[2][1] #print(a,b,c,l,m,n) if x==y and y==z: print(0) elif x==y and y!=z or x==z and y!=z or y==z and x!=z: pr...
output
1
5,105
19
10,211