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
Provide tags and a correct Python 3 solution for this coding contest problem. Hyakugoku has just retired from being the resident deity of the South Black Snail Temple in order to pursue her dream of becoming a cartoonist. She spent six months in that temple just playing "Cat's Cradle" so now she wants to try a differe...
instruction
0
11,732
19
23,464
Tags: dp, probabilities, shortest paths Correct Solution: ``` def pos(x, y): if y & 1: return y * w + w - 1 - x return y * w + x CUBE = 6 h, w = 10, 10 n = h * w grid = [] for y in range(h): line = list(map(int, input().split())) grid.append(line) grid.reverse() # print(*grid, sep='\n') to =...
output
1
11,732
19
23,465
Provide tags and a correct Python 3 solution for this coding contest problem. Hyakugoku has just retired from being the resident deity of the South Black Snail Temple in order to pursue her dream of becoming a cartoonist. She spent six months in that temple just playing "Cat's Cradle" so now she wants to try a differe...
instruction
0
11,733
19
23,466
Tags: dp, probabilities, shortest paths Correct Solution: ``` from math import * c=10 av=[] for i in range(c): l=[int(s) for s in input().split()] if i%2==0: l.reverse() for j in range(c): if l[j]%2==0: l[j]=c*l[j] else: l[j]=c*l[j]+c-1-2*j av=l+av d=[...
output
1
11,733
19
23,467
Provide tags and a correct Python 3 solution for this coding contest problem. Hyakugoku has just retired from being the resident deity of the South Black Snail Temple in order to pursue her dream of becoming a cartoonist. She spent six months in that temple just playing "Cat's Cradle" so now she wants to try a differe...
instruction
0
11,734
19
23,468
Tags: dp, probabilities, shortest paths Correct Solution: ``` #!/usr/bin/python3 import array from fractions import Fraction import functools import itertools import math import os import sys def main(): H = [read_ints() for _ in range(10)] print(solve(H)) def pos_idx(x, y): i = y * 10 if y % 2 == ...
output
1
11,734
19
23,469
Provide tags and a correct Python 3 solution for this coding contest problem. Hyakugoku has just retired from being the resident deity of the South Black Snail Temple in order to pursue her dream of becoming a cartoonist. She spent six months in that temple just playing "Cat's Cradle" so now she wants to try a differe...
instruction
0
11,735
19
23,470
Tags: dp, probabilities, shortest paths Correct Solution: ``` board = [] for i in range(10): board.append([int(i) for i in input().split()]) def next_squares(x, y): current_dir = 1 if x%2 else -1 # print(x, y, current_dir) res = [] for _ in range(6): nx, ny = x, y + current_dir if n...
output
1
11,735
19
23,471
Provide tags and a correct Python 3 solution for this coding contest problem. Hyakugoku has just retired from being the resident deity of the South Black Snail Temple in order to pursue her dream of becoming a cartoonist. She spent six months in that temple just playing "Cat's Cradle" so now she wants to try a differe...
instruction
0
11,736
19
23,472
Tags: dp, probabilities, shortest paths Correct Solution: ``` links = list(range(100)) # 0 0 = left up # 10*y+x # i = height # j = pos for i in range(10): l = list(map(int, input().split())) for j, h in enumerate(l): coo = i*10+(j if i%2==0 else 9-j) target = (i-h)*10+(j if (i-h)%2==0 else 9-j) links[coo] = ta...
output
1
11,736
19
23,473
Provide tags and a correct Python 3 solution for this coding contest problem. Hyakugoku has just retired from being the resident deity of the South Black Snail Temple in order to pursue her dream of becoming a cartoonist. She spent six months in that temple just playing "Cat's Cradle" so now she wants to try a differe...
instruction
0
11,737
19
23,474
Tags: dp, probabilities, shortest paths Correct Solution: ``` t=[] def corresp(i,j): return 100 - (i*10 + (j if not i%2 else (9-j))) paths=[[i] for i in range(101)] for i in range(10): z=[int(k) for k in input().split(" ")] if i%2: t+=z[::-1] else: t+=z for j in range(10): ...
output
1
11,737
19
23,475
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Hyakugoku has just retired from being the resident deity of the South Black Snail Temple in order to pursue her dream of becoming a cartoonist. She spent six months in that temple just playing "...
instruction
0
11,738
19
23,476
Yes
output
1
11,738
19
23,477
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Hyakugoku has just retired from being the resident deity of the South Black Snail Temple in order to pursue her dream of becoming a cartoonist. She spent six months in that temple just playing "...
instruction
0
11,739
19
23,478
No
output
1
11,739
19
23,479
Provide tags and a correct Python 3 solution for this coding contest problem. There are n cards numbered 1, …, n. The card i has a red digit r_i and a blue digit b_i written on it. We arrange all n cards in random order from left to right, with all permutations of 1, …, n having the same probability. We then read all...
instruction
0
11,828
19
23,656
Tags: math, probabilities Correct Solution: ``` def main(): t = int(input()) for ti in range(t): sz = int(input()) rs = input() rsz = len(rs)//sz r = 0 bs = input() bsz = len(bs)//sz b = 0 for ni in range(sz): ri = ni * rsz ...
output
1
11,828
19
23,657
Provide tags and a correct Python 3 solution for this coding contest problem. There are n cards numbered 1, …, n. The card i has a red digit r_i and a blue digit b_i written on it. We arrange all n cards in random order from left to right, with all permutations of 1, …, n having the same probability. We then read all...
instruction
0
11,829
19
23,658
Tags: math, probabilities Correct Solution: ``` import sys try:sys.stdin,sys.stdout=open('in.txt','r'),open('out.txt','w') except:pass ii1=lambda:int(sys.stdin.readline().strip()) # for interger is1=lambda:sys.stdin.readline().strip() # for str iia=lambda:list(map(int,sys.stdin.readline().strip().split())) # for List[i...
output
1
11,829
19
23,659
Provide tags and a correct Python 3 solution for this coding contest problem. There are n cards numbered 1, …, n. The card i has a red digit r_i and a blue digit b_i written on it. We arrange all n cards in random order from left to right, with all permutations of 1, …, n having the same probability. We then read all...
instruction
0
11,830
19
23,660
Tags: math, probabilities Correct Solution: ``` T = int(input()) for _ in range(T): n = int(input()) r = [int(c) for c in input()] b = [int(c) for c in input()] A = sum([r[i]>b[i] for i in range(n)]) B = sum([b[i]>r[i] for i in range(n)]) C = n - A - B if A>B: print ('RED') eli...
output
1
11,830
19
23,661
Provide tags and a correct Python 3 solution for this coding contest problem. There are n cards numbered 1, …, n. The card i has a red digit r_i and a blue digit b_i written on it. We arrange all n cards in random order from left to right, with all permutations of 1, …, n having the same probability. We then read all...
instruction
0
11,831
19
23,662
Tags: math, probabilities Correct Solution: ``` test1=int(input()) for _ in range(test1): n=int(input()) a=input() b=input() s1=s2=0 for i in range(n): if(int(a[i])>int(b[i])): s1+=1 elif(int(b[i])>int(a[i])): s2+=1 if(s1==s2): print("EQUAL") e...
output
1
11,831
19
23,663
Provide tags and a correct Python 3 solution for this coding contest problem. There are n cards numbered 1, …, n. The card i has a red digit r_i and a blue digit b_i written on it. We arrange all n cards in random order from left to right, with all permutations of 1, …, n having the same probability. We then read all...
instruction
0
11,832
19
23,664
Tags: math, probabilities Correct Solution: ``` for _ in range(int(input())): n=int(input()) s=input() s1=input() a=0 b=0 for i in range(n): if s[i]>s1[i]: a=a+1 elif s[i]<s1[i]: b=b+1 if a>b: print("RED") elif b>a: print("BLUE") ...
output
1
11,832
19
23,665
Provide tags and a correct Python 3 solution for this coding contest problem. There are n cards numbered 1, …, n. The card i has a red digit r_i and a blue digit b_i written on it. We arrange all n cards in random order from left to right, with all permutations of 1, …, n having the same probability. We then read all...
instruction
0
11,833
19
23,666
Tags: math, probabilities Correct Solution: ``` for _ in range(int(input())): n=int(input()) r=list(map(int,input())) b=list(map(int,input())) red=0 blue=0 for i in range(n): if r[i]>b[i]: red+=1 elif b[i]>r[i]: blue+=1 if red>blue: print("RED") elif ...
output
1
11,833
19
23,667
Provide tags and a correct Python 3 solution for this coding contest problem. There are n cards numbered 1, …, n. The card i has a red digit r_i and a blue digit b_i written on it. We arrange all n cards in random order from left to right, with all permutations of 1, …, n having the same probability. We then read all...
instruction
0
11,834
19
23,668
Tags: math, probabilities Correct Solution: ``` #import sys #import math #sys.stdout=open("python/output.txt","w") #sys.stdin=open("python/input.txt","r") t=int(input()) for i in range(t): n=int(input()) r=input() b=input() rl=list(r) red=0 blue=0 bl=list(b) for i in range(n): ...
output
1
11,834
19
23,669
Provide tags and a correct Python 3 solution for this coding contest problem. There are n cards numbered 1, …, n. The card i has a red digit r_i and a blue digit b_i written on it. We arrange all n cards in random order from left to right, with all permutations of 1, …, n having the same probability. We then read all...
instruction
0
11,835
19
23,670
Tags: math, probabilities Correct Solution: ``` t = int(input()) res = [] for i in range(t): n = int(input()) reds = input() reds = list(map(int,[char for char in reds])) blues = input() blues = list(map(int,[char for char in blues])) bluepoints,redpoints =0,0 for card in range(n): blue = blues[card...
output
1
11,835
19
23,671
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n cards numbered 1, …, n. The card i has a red digit r_i and a blue digit b_i written on it. We arrange all n cards in random order from left to right, with all permutations of 1, …, ...
instruction
0
11,836
19
23,672
Yes
output
1
11,836
19
23,673
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n cards numbered 1, …, n. The card i has a red digit r_i and a blue digit b_i written on it. We arrange all n cards in random order from left to right, with all permutations of 1, …, ...
instruction
0
11,837
19
23,674
Yes
output
1
11,837
19
23,675
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n cards numbered 1, …, n. The card i has a red digit r_i and a blue digit b_i written on it. We arrange all n cards in random order from left to right, with all permutations of 1, …, ...
instruction
0
11,838
19
23,676
Yes
output
1
11,838
19
23,677
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n cards numbered 1, …, n. The card i has a red digit r_i and a blue digit b_i written on it. We arrange all n cards in random order from left to right, with all permutations of 1, …, ...
instruction
0
11,839
19
23,678
Yes
output
1
11,839
19
23,679
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n cards numbered 1, …, n. The card i has a red digit r_i and a blue digit b_i written on it. We arrange all n cards in random order from left to right, with all permutations of 1, …, ...
instruction
0
11,840
19
23,680
No
output
1
11,840
19
23,681
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n cards numbered 1, …, n. The card i has a red digit r_i and a blue digit b_i written on it. We arrange all n cards in random order from left to right, with all permutations of 1, …, ...
instruction
0
11,841
19
23,682
No
output
1
11,841
19
23,683
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n cards numbered 1, …, n. The card i has a red digit r_i and a blue digit b_i written on it. We arrange all n cards in random order from left to right, with all permutations of 1, …, ...
instruction
0
11,842
19
23,684
No
output
1
11,842
19
23,685
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n cards numbered 1, …, n. The card i has a red digit r_i and a blue digit b_i written on it. We arrange all n cards in random order from left to right, with all permutations of 1, …, ...
instruction
0
11,843
19
23,686
No
output
1
11,843
19
23,687
Provide tags and a correct Python 3 solution for this coding contest problem. The Little Elephant loves to play with color cards. He has n cards, each has exactly two colors (the color of the front side and the color of the back side). Initially, all the cards lay on the table with the front side up. In one move the ...
instruction
0
11,908
19
23,816
Tags: binary search, data structures Correct Solution: ``` def solve(): n = int(input()) cards = [] cnt = {} for i in range(n): card = tuple(map(int, input().split(' '))) cards.append(card) cnt[card[0]] = [0, 0] cnt[card[1]] = [0, 0] for card in cards: if ca...
output
1
11,908
19
23,817
Provide tags and a correct Python 3 solution for this coding contest problem. The Little Elephant loves to play with color cards. He has n cards, each has exactly two colors (the color of the front side and the color of the back side). Initially, all the cards lay on the table with the front side up. In one move the ...
instruction
0
11,909
19
23,818
Tags: binary search, data structures Correct Solution: ``` def main(): n = int(input()) d = {} for i in range(n): a, b = [int(i) for i in input().split()] if a == b: if a not in d: d[a] = [0, 0] d[a][0] += 1 else: if a...
output
1
11,909
19
23,819
Provide tags and a correct Python 3 solution for this coding contest problem. The Little Elephant loves to play with color cards. He has n cards, each has exactly two colors (the color of the front side and the color of the back side). Initially, all the cards lay on the table with the front side up. In one move the ...
instruction
0
11,910
19
23,820
Tags: binary search, data structures Correct Solution: ``` from collections import Counter import sys n=int(input()) ans=10**20 fr={} ba={} for _ in range(n): x,y=map(int,input().split()) if x in fr: fr[x]+=1 else: fr[x]=1 if x!=y: if y in ba: ba[y]+=1 else: ...
output
1
11,910
19
23,821
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The Little Elephant loves to play with color cards. He has n cards, each has exactly two colors (the color of the front side and the color of the back side). Initially, all the cards lay on the...
instruction
0
11,911
19
23,822
No
output
1
11,911
19
23,823
Provide tags and a correct Python 3 solution for this coding contest problem. During the break, we decided to relax and play dominoes. Our box with Domino was empty, so we decided to borrow the teacher's dominoes. The teacher responded instantly at our request. He put nm dominoes on the table as an n × 2m rectangle s...
instruction
0
11,997
19
23,994
Tags: constructive algorithms, greedy Correct Solution: ``` a,b=map(int,input().split()) c=list() x00=0 x01=0 x11=0 for i in range(a): c.append(list(input().split())) x11+=c[-1].count('11') x01+=c[-1].count('01')+c[-1].count('10') x00=a*b-x11-x01 new=[[]for i in range(b)] i=0 while x11>0: x11-=1 new...
output
1
11,997
19
23,995
Provide tags and a correct Python 3 solution for this coding contest problem. During the break, we decided to relax and play dominoes. Our box with Domino was empty, so we decided to borrow the teacher's dominoes. The teacher responded instantly at our request. He put nm dominoes on the table as an n × 2m rectangle s...
instruction
0
11,998
19
23,996
Tags: constructive algorithms, greedy Correct Solution: ``` n, m = map(int, input().split()) k, d = n * m, 2 * m c = {'11': 0, '01': 0, '10': 0} for i in range(n): t = input() for i in ('11', '01', '10'): c[i] += t.count(i) a, b = c['11'], c['10'] + c['01'] t = ['11'] * a + (b // 2) * ['10', '01'] + ['10...
output
1
11,998
19
23,997
Provide tags and a correct Python 3 solution for this coding contest problem. During the break, we decided to relax and play dominoes. Our box with Domino was empty, so we decided to borrow the teacher's dominoes. The teacher responded instantly at our request. He put nm dominoes on the table as an n × 2m rectangle s...
instruction
0
11,999
19
23,998
Tags: constructive algorithms, greedy Correct Solution: ``` n, m = map(int, input().split()) cnt0 = 0 cnt2 = 0 for i in range(n): line = input() cnt0 += line.count("00") cnt2 += line.count("11") mat = [ [-1]*(m) for i in range(n) ] col = [0]*(2*m) strB = [ "00", "01", "10", "11" ] i = j = 0 while cnt2 > 0: c...
output
1
11,999
19
23,999
Provide tags and a correct Python 3 solution for this coding contest problem. During the break, we decided to relax and play dominoes. Our box with Domino was empty, so we decided to borrow the teacher's dominoes. The teacher responded instantly at our request. He put nm dominoes on the table as an n × 2m rectangle s...
instruction
0
12,000
19
24,000
Tags: constructive algorithms, greedy Correct Solution: ``` def find_matrix_col_sum(mat): max_sum = -1 for cols in range(len(mat[0])): s = 0 for i in range(2): for rows in range(len(mat)): s+=int(mat[rows][cols][i]) if s > max_sum: max_sum ...
output
1
12,000
19
24,001
Provide tags and a correct Python 3 solution for this coding contest problem. During the break, we decided to relax and play dominoes. Our box with Domino was empty, so we decided to borrow the teacher's dominoes. The teacher responded instantly at our request. He put nm dominoes on the table as an n × 2m rectangle s...
instruction
0
12,001
19
24,002
Tags: constructive algorithms, greedy Correct Solution: ``` n, m = map(int, input().split()) doubles, singles = 0, 0 for r in range(n): for s in input().split(): if s == '11': doubles += 1 elif s != '00': singles += 1 lines = { 'zero': ' '.join(m * [ '00' ]), 'double'...
output
1
12,001
19
24,003
Provide tags and a correct Python 3 solution for this coding contest problem. During the break, we decided to relax and play dominoes. Our box with Domino was empty, so we decided to borrow the teacher's dominoes. The teacher responded instantly at our request. He put nm dominoes on the table as an n × 2m rectangle s...
instruction
0
12,002
19
24,004
Tags: constructive algorithms, greedy Correct Solution: ``` n, m = map(int, input().split()) cnt1 = 0 cnt2 = 0 for i in range(n): for x in input().split(): if x == "11": cnt2 += 1 elif x == "01": cnt1 += 1 elif x == "10": cnt1 += 1 cnt0 = n*m - cnt1 - cnt2 mat = [ [-1]*(m) for i in range(n) ] col = [0]*(...
output
1
12,002
19
24,005
Provide tags and a correct Python 3 solution for this coding contest problem. During the break, we decided to relax and play dominoes. Our box with Domino was empty, so we decided to borrow the teacher's dominoes. The teacher responded instantly at our request. He put nm dominoes on the table as an n × 2m rectangle s...
instruction
0
12,003
19
24,006
Tags: constructive algorithms, greedy Correct Solution: ``` line = input().split() n = int(line[0]) m = int(line[1]) one = 0 double = 0 switch = -1 switchm = -1 dom = [["00" for i in range(m)] for j in range(n)] for i in range(n): line = input().split() for j in range(m): num = int(line[j][0])+int(line[...
output
1
12,003
19
24,007
Provide tags and a correct Python 3 solution for this coding contest problem. During the break, we decided to relax and play dominoes. Our box with Domino was empty, so we decided to borrow the teacher's dominoes. The teacher responded instantly at our request. He put nm dominoes on the table as an n × 2m rectangle s...
instruction
0
12,004
19
24,008
Tags: constructive algorithms, greedy Correct Solution: ``` n, m = map(int, input().split()) k, d = n * m, 2 * m c = {'11': 0, '01': 0, '10': 0} for i in range(n): t = input() for i in ('11', '01', '10'): c[i] += t.count(i) a, b = c['11'], c['10'] + c['01'] t = ['11'] * a + (b // 2) * ['10', '01'] + ['10'] * (b...
output
1
12,004
19
24,009
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. During the break, we decided to relax and play dominoes. Our box with Domino was empty, so we decided to borrow the teacher's dominoes. The teacher responded instantly at our request. He put nm...
instruction
0
12,005
19
24,010
No
output
1
12,005
19
24,011
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. During the break, we decided to relax and play dominoes. Our box with Domino was empty, so we decided to borrow the teacher's dominoes. The teacher responded instantly at our request. He put nm...
instruction
0
12,006
19
24,012
No
output
1
12,006
19
24,013
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. During the break, we decided to relax and play dominoes. Our box with Domino was empty, so we decided to borrow the teacher's dominoes. The teacher responded instantly at our request. He put nm...
instruction
0
12,007
19
24,014
No
output
1
12,007
19
24,015
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. During the break, we decided to relax and play dominoes. Our box with Domino was empty, so we decided to borrow the teacher's dominoes. The teacher responded instantly at our request. He put nm...
instruction
0
12,008
19
24,016
No
output
1
12,008
19
24,017
Provide tags and a correct Python 3 solution for this coding contest problem. Uncle Fyodor, Matroskin the Cat and Sharic the Dog live their simple but happy lives in Prostokvashino. Sometimes they receive parcels from Uncle Fyodor’s parents and sometimes from anonymous benefactors, in which case it is hard to determin...
instruction
0
12,025
19
24,050
Tags: implementation, schedules Correct Solution: ``` import sys a, b, c = input().strip(), input().strip(), input().strip() def beats(x, y): if x == 'rock' and y == 'scissors': return True if x == 'scissors' and y == 'paper': return True if x == 'paper' and y == 'rock': return True return False ...
output
1
12,025
19
24,051
Provide tags and a correct Python 3 solution for this coding contest problem. Uncle Fyodor, Matroskin the Cat and Sharic the Dog live their simple but happy lives in Prostokvashino. Sometimes they receive parcels from Uncle Fyodor’s parents and sometimes from anonymous benefactors, in which case it is hard to determin...
instruction
0
12,026
19
24,052
Tags: implementation, schedules Correct Solution: ``` F=input() M=input() S=input() Beater={"rock":"paper","paper":"scissors","scissors":"rock"} if(F==M and S==Beater[F]): print("S") elif(F==S and M==Beater[F]): print("M") elif(S==M and F==Beater[S]): print("F") else: print("?") ```
output
1
12,026
19
24,053
Provide tags and a correct Python 3 solution for this coding contest problem. Uncle Fyodor, Matroskin the Cat and Sharic the Dog live their simple but happy lives in Prostokvashino. Sometimes they receive parcels from Uncle Fyodor’s parents and sometimes from anonymous benefactors, in which case it is hard to determin...
instruction
0
12,027
19
24,054
Tags: implementation, schedules Correct Solution: ``` a=input() b=input() c=input() if (a==b and b==c) or (a!=b and b!=c and a!=c): print('?') elif (a=='rock' and b=='scissors' and b==c) or (a=='paper' and b=='rock' and b==c) or (a=='scissors' and b=='paper' and b==c): print('F') elif (b=='rock' and a=='scissor...
output
1
12,027
19
24,055
Provide tags and a correct Python 3 solution for this coding contest problem. Uncle Fyodor, Matroskin the Cat and Sharic the Dog live their simple but happy lives in Prostokvashino. Sometimes they receive parcels from Uncle Fyodor’s parents and sometimes from anonymous benefactors, in which case it is hard to determin...
instruction
0
12,028
19
24,056
Tags: implementation, schedules Correct Solution: ``` F=str(input()) M=str(input()) W=str(input()) if F=="rock" and M=="scissors" and W=="scissors": print("F") elif F=="rock" and M=="paper" and W=="rock": print("M") elif F=="rock" and M=="rock" and W=="paper": print("S") elif F=="paper" and M=="rock" and W=...
output
1
12,028
19
24,057
Provide tags and a correct Python 3 solution for this coding contest problem. Uncle Fyodor, Matroskin the Cat and Sharic the Dog live their simple but happy lives in Prostokvashino. Sometimes they receive parcels from Uncle Fyodor’s parents and sometimes from anonymous benefactors, in which case it is hard to determin...
instruction
0
12,029
19
24,058
Tags: implementation, schedules Correct Solution: ``` F = input() M = input() S = input() ans = ["F", "M","S"] #print(set([F,M,S])) if len(set([F,M,S]))!=2: print("?") else: if [F,M,S].count("rock")==2: if "paper" in [F,M,S]:print(ans[[F,M,S].index("paper")]) else:print("?") elif [F,M,S].cou...
output
1
12,029
19
24,059
Provide tags and a correct Python 3 solution for this coding contest problem. Uncle Fyodor, Matroskin the Cat and Sharic the Dog live their simple but happy lives in Prostokvashino. Sometimes they receive parcels from Uncle Fyodor’s parents and sometimes from anonymous benefactors, in which case it is hard to determin...
instruction
0
12,030
19
24,060
Tags: implementation, schedules Correct Solution: ``` f = "" m = "" s = "" paper = "paper" rock = "rock" scissors = "scissors" def compare(f, s, m): if f == s and s == m: return "?" # F wins if f == paper: if s == rock and m == rock: return "F" if f == rock: if...
output
1
12,030
19
24,061
Provide tags and a correct Python 3 solution for this coding contest problem. Uncle Fyodor, Matroskin the Cat and Sharic the Dog live their simple but happy lives in Prostokvashino. Sometimes they receive parcels from Uncle Fyodor’s parents and sometimes from anonymous benefactors, in which case it is hard to determin...
instruction
0
12,031
19
24,062
Tags: implementation, schedules Correct Solution: ``` f = input() m = input() s = input() t = [f, m, s] if t.count('rock') == 3 or t.count('paper') == 3 or t.count('scissors') == 3: print('?') exit() if t.count('rock') == 1 and t.count('paper') == 1 and t.count('scissors') == 1: print('?') exit() if t....
output
1
12,031
19
24,063
Provide tags and a correct Python 3 solution for this coding contest problem. Uncle Fyodor, Matroskin the Cat and Sharic the Dog live their simple but happy lives in Prostokvashino. Sometimes they receive parcels from Uncle Fyodor’s parents and sometimes from anonymous benefactors, in which case it is hard to determin...
instruction
0
12,032
19
24,064
Tags: implementation, schedules Correct Solution: ``` def winner(f,s): if f == "r": if s == "r": return 0 elif s == "s": return 1 return -1 elif f == "s": if s == "s": return 0 elif s == "p": return 1 return -1 e...
output
1
12,032
19
24,065
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Uncle Fyodor, Matroskin the Cat and Sharic the Dog live their simple but happy lives in Prostokvashino. Sometimes they receive parcels from Uncle Fyodor’s parents and sometimes from anonymous be...
instruction
0
12,033
19
24,066
Yes
output
1
12,033
19
24,067
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Uncle Fyodor, Matroskin the Cat and Sharic the Dog live their simple but happy lives in Prostokvashino. Sometimes they receive parcels from Uncle Fyodor’s parents and sometimes from anonymous be...
instruction
0
12,034
19
24,068
Yes
output
1
12,034
19
24,069