message
stringlengths
2
20.2k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
757
108k
cluster
float64
4
4
__index_level_0__
int64
1.51k
217k
Provide tags and a correct Python 3 solution for this coding contest problem. Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad day, and good and bad days are alternating in it....
instruction
0
75,611
4
151,222
Tags: greedy Correct Solution: ``` def solve(s): lists = [[] for _ in range(len(s))] cid = 0 waitSet = set() doneSet = set() zeros = set() for i, c in enumerate(s): i += 1 if c == '1': if not doneSet and not zeros: print(-1) return ...
output
1
75,611
4
151,223
Provide tags and a correct Python 3 solution for this coding contest problem. Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad day, and good and bad days are alternating in it....
instruction
0
75,612
4
151,224
Tags: greedy Correct Solution: ``` s = input() arr, zero, one = [], [], [] for i in range(len(s)): if s[i] == '0': if one: idx = one.pop() arr[idx].append(i + 1) zero.append(idx) else: zero.append(len(arr)) arr.append([i + 1]) else: ...
output
1
75,612
4
151,225
Provide tags and a correct Python 3 solution for this coding contest problem. Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad day, and good and bad days are alternating in it....
instruction
0
75,613
4
151,226
Tags: greedy Correct Solution: ``` #Codeforces Practice #Zebras (950C) from sys import stdin, stdout def main(): life = stdin.readline() zeroes = [] #A list of indices, each is a zebra ending in 0 ones = [] #A list of indices, each is a zebra ending in 1 zebras = [] #A list of lists, each is a zebr...
output
1
75,613
4
151,227
Provide tags and a correct Python 3 solution for this coding contest problem. Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad day, and good and bad days are alternating in it....
instruction
0
75,614
4
151,228
Tags: greedy Correct Solution: ``` import configparser import math import sys input = sys.stdin.readline def main(): s = input().strip() one = [] zero = [] adj = [[] for i in range(len(s))] for i in range(len(s)): if s[i] == '0': if len(one) == 0: zero.appen...
output
1
75,614
4
151,229
Provide tags and a correct Python 3 solution for this coding contest problem. Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad day, and good and bad days are alternating in it....
instruction
0
75,615
4
151,230
Tags: greedy Correct Solution: ``` temp = [int(x) for x in list(input())] #a = [] # ending with 1 b = [] # ending with 0 cnt = -1 skip = False for i in range(len(temp)): if temp[i] == 0: if cnt == -1: b.append([i+1]) else: b[cnt] += [i+1] cnt -= 1 else: ...
output
1
75,615
4
151,231
Provide tags and a correct Python 3 solution for this coding contest problem. Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad day, and good and bad days are alternating in it....
instruction
0
75,616
4
151,232
Tags: greedy Correct Solution: ``` # Codeforces Submission # User : sudoSieg # Time : 14:50:08 # Date : 21/10/2020 import io import os #input = lambda: io.BytesIO(os.read(0, os.fstat(0).st_size)).readline().strip() valid = True s = input() ze = [] oe = [] for i, j in enumerate(s): if j == '0': if...
output
1
75,616
4
151,233
Provide tags and a correct Python 3 solution for this coding contest problem. Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad day, and good and bad days are alternating in it....
instruction
0
75,617
4
151,234
Tags: greedy Correct Solution: ``` s = input() c0 = s.count('0') c1 = s.count('1') qs = c0 - c1 if qs <= 0: print(-1) exit() ans = [[] for i in range(qs)] n1=[] n0 = [i for i in range(qs)] p0 = 0 p1 = 0 for i in range(len(s)): l = s[i] if l == '0': if len(n0) <= p0: print(-1) ...
output
1
75,617
4
151,235
Provide tags and a correct Python 3 solution for this coding contest problem. Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad day, and good and bad days are alternating in it....
instruction
0
75,618
4
151,236
Tags: greedy Correct Solution: ``` def read_int(): return int(input()) def read_str(): return input() def read_list(t=int): return list(map(t, input().split())) def print_list(x): print(len(x), ' '.join(map(str, x))) # ------------------------------ def work(seqs): ans = [[] for i in range(seqs)] si = 0 ...
output
1
75,618
4
151,237
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad da...
instruction
0
75,619
4
151,238
Yes
output
1
75,619
4
151,239
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad da...
instruction
0
75,620
4
151,240
Yes
output
1
75,620
4
151,241
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad da...
instruction
0
75,621
4
151,242
Yes
output
1
75,621
4
151,243
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad da...
instruction
0
75,622
4
151,244
Yes
output
1
75,622
4
151,245
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad da...
instruction
0
75,623
4
151,246
No
output
1
75,623
4
151,247
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad da...
instruction
0
75,624
4
151,248
No
output
1
75,624
4
151,249
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad da...
instruction
0
75,625
4
151,250
No
output
1
75,625
4
151,251
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad da...
instruction
0
75,626
4
151,252
No
output
1
75,626
4
151,253
Provide a correct Python 3 solution for this coding contest problem. Today is August 24, one of the five Product Days in a year. A date m-d (m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions are satisfied (here d_{10} is the tens digit of the day ...
instruction
0
75,675
4
151,350
"Correct Solution: ``` m, d = map(int, input().split()) ans = 0 for i in range(1, m+1): for j in range(21, d+1): if i == int(str(j)[0]) * int(str(j)[1]) and int(str(j)[1]) >= 2: ans += 1 print(ans) ```
output
1
75,675
4
151,351
Provide a correct Python 3 solution for this coding contest problem. Today is August 24, one of the five Product Days in a year. A date m-d (m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions are satisfied (here d_{10} is the tens digit of the day ...
instruction
0
75,676
4
151,352
"Correct Solution: ``` M,D = map(int,input().split()) ans = 0 for i in range(2,M+1): for j in range(22,D+1): if j % 10 == 1: continue ans += (i == (j//10) * (j%10)) print(ans) ```
output
1
75,676
4
151,353
Provide a correct Python 3 solution for this coding contest problem. Today is August 24, one of the five Product Days in a year. A date m-d (m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions are satisfied (here d_{10} is the tens digit of the day ...
instruction
0
75,677
4
151,354
"Correct Solution: ``` M, D = input().split() cnt = 0 for i in range(22, int(D)+1): s = str(i) if(int(s[0])*int(s[1]) <= int(M)): cnt += 1 if(int(s[1])<= 1): cnt -= 1 print(cnt) ```
output
1
75,677
4
151,355
Provide a correct Python 3 solution for this coding contest problem. Today is August 24, one of the five Product Days in a year. A date m-d (m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions are satisfied (here d_{10} is the tens digit of the day ...
instruction
0
75,678
4
151,356
"Correct Solution: ``` m, d = map(int,input().split()) cnt = 0 if 20<=d: for i in range(20,d+1): if (i%10)*(i//10)<=m and 2<=i%10: cnt+=1 print(cnt) ```
output
1
75,678
4
151,357
Provide a correct Python 3 solution for this coding contest problem. Today is August 24, one of the five Product Days in a year. A date m-d (m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions are satisfied (here d_{10} is the tens digit of the day ...
instruction
0
75,679
4
151,358
"Correct Solution: ``` M,D=map(int,input().split()) cnt = 0 for i in range(11,D+1): d10=i//10 d1=i%10 if d1*d10 <= M and d10>=2 and d1>=2: cnt+=1 print(cnt) ```
output
1
75,679
4
151,359
Provide a correct Python 3 solution for this coding contest problem. Today is August 24, one of the five Product Days in a year. A date m-d (m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions are satisfied (here d_{10} is the tens digit of the day ...
instruction
0
75,680
4
151,360
"Correct Solution: ``` m,d=input().strip().split(' ') m,d=[int(m),int(d)] c=0 for i in range(22,d+1): d1=str(i) if int(d1[1])>=2 and int(d1[1])*int(d1[0])<=m: c+=1 print (c) ```
output
1
75,680
4
151,361
Provide a correct Python 3 solution for this coding contest problem. Today is August 24, one of the five Product Days in a year. A date m-d (m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions are satisfied (here d_{10} is the tens digit of the day ...
instruction
0
75,681
4
151,362
"Correct Solution: ``` m,d=map(int,input().split()) ans=0 for i in range(1,m+1): for j in range(1,d+1): if j//10>=2 and j%10>=2 and (j//10)*(j%10)==i: ans+=1 print(ans) ```
output
1
75,681
4
151,363
Provide a correct Python 3 solution for this coding contest problem. Today is August 24, one of the five Product Days in a year. A date m-d (m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions are satisfied (here d_{10} is the tens digit of the day ...
instruction
0
75,682
4
151,364
"Correct Solution: ``` M, D = map(int, input().split()) acc=0 for i in range(4,M+1): for j in range(22,D+1): if j%10<2: continue if i == (j//10)*(j%10): acc+=1 print(acc) ```
output
1
75,682
4
151,365
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Today is August 24, one of the five Product Days in a year. A date m-d (m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions ...
instruction
0
75,683
4
151,366
Yes
output
1
75,683
4
151,367
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Today is August 24, one of the five Product Days in a year. A date m-d (m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions ...
instruction
0
75,684
4
151,368
Yes
output
1
75,684
4
151,369
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Today is August 24, one of the five Product Days in a year. A date m-d (m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions ...
instruction
0
75,685
4
151,370
Yes
output
1
75,685
4
151,371
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Today is August 24, one of the five Product Days in a year. A date m-d (m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions ...
instruction
0
75,686
4
151,372
Yes
output
1
75,686
4
151,373
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Today is August 24, one of the five Product Days in a year. A date m-d (m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions ...
instruction
0
75,687
4
151,374
No
output
1
75,687
4
151,375
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Today is August 24, one of the five Product Days in a year. A date m-d (m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions ...
instruction
0
75,688
4
151,376
No
output
1
75,688
4
151,377
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Today is August 24, one of the five Product Days in a year. A date m-d (m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions ...
instruction
0
75,689
4
151,378
No
output
1
75,689
4
151,379
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Today is August 24, one of the five Product Days in a year. A date m-d (m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions ...
instruction
0
75,690
4
151,380
No
output
1
75,690
4
151,381
Provide a correct Python 3 solution for this coding contest problem. In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22. Constraints * 22 \leq D \leq 25 * D is an integer. Inp...
instruction
0
75,707
4
151,414
"Correct Solution: ``` d = int(input()) print('Christmas', ' Eve' * (25 - d), sep='') ```
output
1
75,707
4
151,415
Provide a correct Python 3 solution for this coding contest problem. In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22. Constraints * 22 \leq D \leq 25 * D is an integer. Inp...
instruction
0
75,708
4
151,416
"Correct Solution: ``` d=int(input()) n=25-d print("Christmas"+" Eve"*n) ```
output
1
75,708
4
151,417
Provide a correct Python 3 solution for this coding contest problem. In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22. Constraints * 22 \leq D \leq 25 * D is an integer. Inp...
instruction
0
75,709
4
151,418
"Correct Solution: ``` eve=25-int(input()) print("Christmas"+" Eve"*eve) ```
output
1
75,709
4
151,419
Provide a correct Python 3 solution for this coding contest problem. In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22. Constraints * 22 \leq D \leq 25 * D is an integer. Inp...
instruction
0
75,710
4
151,420
"Correct Solution: ``` D=int(input()) s="Christmas" i=25-D print(s+" Eve"*i) ```
output
1
75,710
4
151,421
Provide a correct Python 3 solution for this coding contest problem. In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22. Constraints * 22 \leq D \leq 25 * D is an integer. Inp...
instruction
0
75,711
4
151,422
"Correct Solution: ``` d= int(input()) a ='Christmas'+ (25-d)*' Eve' print(a) ```
output
1
75,711
4
151,423
Provide a correct Python 3 solution for this coding contest problem. In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22. Constraints * 22 \leq D \leq 25 * D is an integer. Inp...
instruction
0
75,712
4
151,424
"Correct Solution: ``` d=25-int(input()) print("Christmas"+(" "+"Eve")*d) ```
output
1
75,712
4
151,425
Provide a correct Python 3 solution for this coding contest problem. In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22. Constraints * 22 \leq D \leq 25 * D is an integer. Inp...
instruction
0
75,713
4
151,426
"Correct Solution: ``` D = int(input()) print('Christmas' + ' Eve' * abs(D - 25)) ```
output
1
75,713
4
151,427
Provide a correct Python 3 solution for this coding contest problem. In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22. Constraints * 22 \leq D \leq 25 * D is an integer. Inp...
instruction
0
75,714
4
151,428
"Correct Solution: ``` n = int(input()) print("Christmas" + (25 - n) * " Eve") ```
output
1
75,714
4
151,429
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22. ...
instruction
0
75,715
4
151,430
Yes
output
1
75,715
4
151,431
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22. ...
instruction
0
75,716
4
151,432
Yes
output
1
75,716
4
151,433
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22. ...
instruction
0
75,717
4
151,434
Yes
output
1
75,717
4
151,435
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22. ...
instruction
0
75,718
4
151,436
Yes
output
1
75,718
4
151,437
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22. ...
instruction
0
75,720
4
151,440
No
output
1
75,720
4
151,441
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22. ...
instruction
0
75,721
4
151,442
No
output
1
75,721
4
151,443
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. In some other world, today is December D-th. Write a program that prints `Christmas` if D = 25, `Christmas Eve` if D = 24, `Christmas Eve Eve` if D = 23 and `Christmas Eve Eve Eve` if D = 22. ...
instruction
0
75,722
4
151,444
No
output
1
75,722
4
151,445
Provide tags and a correct Python 3 solution for this coding contest problem. Little Lesha loves listening to music via his smartphone. But the smartphone doesn't have much memory, so Lesha listens to his favorite songs in a well-known social network InTalk. Unfortunately, internet is not that fast in the city of Eka...
instruction
0
76,276
4
152,552
Tags: implementation, math Correct Solution: ``` from math import ceil,log a,b,c=map(int,input().split()) print(ceil(log(a/b,c))) ```
output
1
76,276
4
152,553
Provide tags and a correct Python 3 solution for this coding contest problem. Little Lesha loves listening to music via his smartphone. But the smartphone doesn't have much memory, so Lesha listens to his favorite songs in a well-known social network InTalk. Unfortunately, internet is not that fast in the city of Eka...
instruction
0
76,279
4
152,558
Tags: implementation, math Correct Solution: ``` import io, os, sys try: fin = open('in') input = fin.readline except: input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline t, s, q = map(int, input().split()) c = 0 while s < t: c += 1 s *= q print (c) ```
output
1
76,279
4
152,559
Provide tags and a correct Python 3 solution for this coding contest problem. Little Lesha loves listening to music via his smartphone. But the smartphone doesn't have much memory, so Lesha listens to his favorite songs in a well-known social network InTalk. Unfortunately, internet is not that fast in the city of Eka...
instruction
0
76,280
4
152,560
Tags: implementation, math Correct Solution: ``` T,S,q=map(int,input().split()) a=0 while T>S:S*=q;a+=1 print(a) ```
output
1
76,280
4
152,561