message stringlengths 2 59.7k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 37 108k | cluster float64 20 20 | __index_level_0__ int64 74 217k |
|---|---|---|---|---|---|
Provide tags and a correct Python 3 solution for this coding contest problem.
Little X used to play a card game called "24 Game", but recently he has found it too easy. So he invented a new game.
Initially you have a sequence of n integers: 1, 2, ..., n. In a single step, you can pick two of them, let's denote them a... | instruction | 0 | 102,442 | 20 | 204,884 |
Tags: constructive algorithms, greedy, math
Correct Solution:
```
#------------------------template--------------------------#
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.std... | output | 1 | 102,442 | 20 | 204,885 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little X used to play a card game called "24 Game", but recently he has found it too easy. So he invented a new game.
Initially you have a sequence of n integers: 1, 2, ..., n. In a single step, you can pick two of them, let's denote them a... | instruction | 0 | 102,443 | 20 | 204,886 |
Tags: constructive algorithms, greedy, math
Correct Solution:
```
def logs(n):
if n == 4: return [(1,1,2), (1,2,3), (1,6,4)]
if n == 5: return [(2,5,4), (2,9,3), (1,12,2), (1,24,1)]
ans = [(3,i+1,i) for i in range(n-1, 4, -2)]
ans.extend(logs(4 + n%2))
ans += [(1,24,1) for i in range(n-1-len(ans))]
... | output | 1 | 102,443 | 20 | 204,887 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little X used to play a card game called "24 Game", but recently he has found it too easy. So he invented a new game.
Initially you have a sequence of n integers: 1, 2, ..., n. In a single step, you can pick two of them, let's denote them a... | instruction | 0 | 102,444 | 20 | 204,888 |
Tags: constructive algorithms, greedy, math
Correct Solution:
```
a = int(input())
if a<=3:
print("NO")
elif a%2==0:
print("YES")
print('4 * 3 = 12')
print('12 * 2 = 24')
print('24 * 1 = 24')
for i in range(6, a+1, 2):
print(str(i), '-', str(i-1), '= 1')
print('24 * 1 = 24')
eli... | output | 1 | 102,444 | 20 | 204,889 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little X used to play a card game called "24 Game", but recently he has found it too easy. So he invented a new game.
Initially you have a sequence of n integers: 1, 2, ..., n. In a single step, you can pick two of them, let's denote them a... | instruction | 0 | 102,445 | 20 | 204,890 |
Tags: constructive algorithms, greedy, math
Correct Solution:
```
n = int(input())
if n < 4:
print('NO')
elif n == 4:
print('YES')
print('1 * 2 = 2')
print('2 * 3 = 6')
print('6 * 4 = 24')
elif n == 5:
print('YES')
print('4 * 5 = 20')
print('3 - 1 = 2')
print('20 + 2 = 22')
print... | output | 1 | 102,445 | 20 | 204,891 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little X used to play a card game called "24 Game", but recently he has found it too easy. So he invented a new game.
Initially you have a sequence of n integers: 1, 2, ..., n. In a single step, you can pick two of them, let's denote them a... | instruction | 0 | 102,446 | 20 | 204,892 |
Tags: constructive algorithms, greedy, math
Correct Solution:
```
n = int(input())
if n >= 4:
print("YES")
moves = 0
for i in range(5 + (0 if n % 2 == 0 else 1), n, 2):
print(str(i+1) + ' - ' + str(i) + ' = ' + str(1))
moves += 1
if n % 2 == 0:
print('2 * 3 = 6')
print('6 * 4 = 24')
moves += 2
else:
p... | output | 1 | 102,446 | 20 | 204,893 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little X used to play a card game called "24 Game", but recently he has found it too easy. So he invented a new game.
Initially you have a sequence of n integers: 1, 2, ..., n. In a single step, you can pick two of them, let's denote them a... | instruction | 0 | 102,447 | 20 | 204,894 |
Tags: constructive algorithms, greedy, math
Correct Solution:
```
n = int(input())
if n<=3:
print("NO")
else:
print("YES")
if n%2==0:
for i in range(5,n,2):
print(i+1,'-' ,i,'=',1)
print(1,'*',2,'=',2)
print(2,'*',3,'=',6)
print(6,'*',4,'=',24)
for i in ra... | output | 1 | 102,447 | 20 | 204,895 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little X used to play a card game called "24 Game", but recently he has found it too easy. So he invented a new game.
Initially you have a sequence of n integers: 1, 2, ..., n. In a single step, you can pick two of them, let's denote them a... | instruction | 0 | 102,448 | 20 | 204,896 |
Tags: constructive algorithms, greedy, math
Correct Solution:
```
n=int(input())
if (n==1 or n==2 or n==3):
print ("NO")
exit(0)
else:
print ("YES")
if (n%2==0):
print ("1 * 2 = 2")
print ("2 * 3 = 6")
print ("6 * 4 = 24")
for i in range(5,n+1,2):
print (i+1,"... | output | 1 | 102,448 | 20 | 204,897 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little X used to play a card game called "24 Game", but recently he has found it too easy. So he invented a new game.
Initially you have a sequence of n integers: 1, 2, ..., n. In a single step... | instruction | 0 | 102,449 | 20 | 204,898 |
Yes | output | 1 | 102,449 | 20 | 204,899 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little X used to play a card game called "24 Game", but recently he has found it too easy. So he invented a new game.
Initially you have a sequence of n integers: 1, 2, ..., n. In a single step... | instruction | 0 | 102,450 | 20 | 204,900 |
Yes | output | 1 | 102,450 | 20 | 204,901 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little X used to play a card game called "24 Game", but recently he has found it too easy. So he invented a new game.
Initially you have a sequence of n integers: 1, 2, ..., n. In a single step... | instruction | 0 | 102,451 | 20 | 204,902 |
Yes | output | 1 | 102,451 | 20 | 204,903 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little X used to play a card game called "24 Game", but recently he has found it too easy. So he invented a new game.
Initially you have a sequence of n integers: 1, 2, ..., n. In a single step... | instruction | 0 | 102,452 | 20 | 204,904 |
Yes | output | 1 | 102,452 | 20 | 204,905 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little X used to play a card game called "24 Game", but recently he has found it too easy. So he invented a new game.
Initially you have a sequence of n integers: 1, 2, ..., n. In a single step... | instruction | 0 | 102,453 | 20 | 204,906 |
No | output | 1 | 102,453 | 20 | 204,907 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little X used to play a card game called "24 Game", but recently he has found it too easy. So he invented a new game.
Initially you have a sequence of n integers: 1, 2, ..., n. In a single step... | instruction | 0 | 102,454 | 20 | 204,908 |
No | output | 1 | 102,454 | 20 | 204,909 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little X used to play a card game called "24 Game", but recently he has found it too easy. So he invented a new game.
Initially you have a sequence of n integers: 1, 2, ..., n. In a single step... | instruction | 0 | 102,455 | 20 | 204,910 |
No | output | 1 | 102,455 | 20 | 204,911 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little X used to play a card game called "24 Game", but recently he has found it too easy. So he invented a new game.
Initially you have a sequence of n integers: 1, 2, ..., n. In a single step... | instruction | 0 | 102,456 | 20 | 204,912 |
No | output | 1 | 102,456 | 20 | 204,913 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Drazil is playing a math game with Varda.
Let's define <image> for positive integer x as a product of factorials of its digits. For example, <image>.
First, they choose a decimal number a consisting of n digits that contains at least one d... | instruction | 0 | 102,464 | 20 | 204,928 |
Tags: greedy, math, sortings
Correct Solution:
```
n = int(input())
a = input()
arr = []
t=0
for i in a:
if int(i)!=1 and int(i)!=0:
arr.append(int(i))
t+=1
final = []
for i in range(t):
if arr[i]==2:
final.append(2)
elif arr[i]==3:
final.append(3)
elif arr[i]==4:
... | output | 1 | 102,464 | 20 | 204,929 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Drazil is playing a math game with Varda.
Let's define <image> for positive integer x as a product of factorials of its digits. For example, <image>.
First, they choose a decimal number a consisting of n digits that contains at least one d... | instruction | 0 | 102,465 | 20 | 204,930 |
Tags: greedy, math, sortings
Correct Solution:
```
## necessary imports
import sys
input = sys.stdin.readline
from math import log2, log, ceil
# swap_array function
def swaparr(arr, a,b):
temp = arr[a];
arr[a] = arr[b];
arr[b] = temp
## gcd function
def gcd(a,b):
if a == 0:
return b
return... | output | 1 | 102,465 | 20 | 204,931 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Drazil is playing a math game with Varda.
Let's define <image> for positive integer x as a product of factorials of its digits. For example, <image>.
First, they choose a decimal number a consisting of n digits that contains at least one d... | instruction | 0 | 102,466 | 20 | 204,932 |
Tags: greedy, math, sortings
Correct Solution:
```
n = int(input())
a = input()
A = []
for i in a:
i = int(i)
if i == 2:
A.append(2)
elif i == 3:
A.append(3)
elif i == 4:
A.append(2)
A.append(2)
A.append(3)
elif i == 5:
A.append(5)
elif i == 6:
... | output | 1 | 102,466 | 20 | 204,933 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Drazil is playing a math game with Varda.
Let's define <image> for positive integer x as a product of factorials of its digits. For example, <image>.
First, they choose a decimal number a consisting of n digits that contains at least one d... | instruction | 0 | 102,467 | 20 | 204,934 |
Tags: greedy, math, sortings
Correct Solution:
```
'''input
3
555
'''
n = int(input())
s = input()
d = {7:0, 5:0, 3:0, 2:0}
for x in s:
if x == '2':
d[2] += 1
elif x == '3':
d[3] += 1
elif x == '4':
d[3] += 1
d[2] += 2
elif x == '5':
d[5] += 1
elif x == '6':
d[5] += 1
d[3] += 1
elif x == '7':
d[7]... | output | 1 | 102,467 | 20 | 204,935 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Drazil is playing a math game with Varda.
Let's define <image> for positive integer x as a product of factorials of its digits. For example, <image>.
First, they choose a decimal number a consisting of n digits that contains at least one d... | instruction | 0 | 102,468 | 20 | 204,936 |
Tags: greedy, math, sortings
Correct Solution:
```
n = int(input())
a = list(map(int, input()))
m = ['', '', '2', '3', '322', '5', '53', '7', '7222', '7332']
print(''.join(sorted((''.join(m[t] for t in a)), reverse=True)))
``` | output | 1 | 102,468 | 20 | 204,937 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Drazil is playing a math game with Varda.
Let's define <image> for positive integer x as a product of factorials of its digits. For example, <image>.
First, they choose a decimal number a consisting of n digits that contains at least one d... | instruction | 0 | 102,469 | 20 | 204,938 |
Tags: greedy, math, sortings
Correct Solution:
```
input()
a=input()
b=['','','2','3','223','5','35','7','2227','2337']
print(''.join(sorted(''.join([b[int(i)]for i in a]),reverse=True)))
``` | output | 1 | 102,469 | 20 | 204,939 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Drazil is playing a math game with Varda.
Let's define <image> for positive integer x as a product of factorials of its digits. For example, <image>.
First, they choose a decimal number a consisting of n digits that contains at least one d... | instruction | 0 | 102,470 | 20 | 204,940 |
Tags: greedy, math, sortings
Correct Solution:
```
n=int(input())
s=list(input())
d={
'2': '2',
'3': '3',
'4': '322',
'5': '5',
'6': '35',
'7': '7',
'8': '2227',
'9': '2337'
}
ans=''
for i in s:
if i>'1':
ans+=d[i]
print(''.join(sorted(list(ans),reverse=True)))
``` | output | 1 | 102,470 | 20 | 204,941 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Drazil is playing a math game with Varda.
Let's define <image> for positive integer x as a product of factorials of its digits. For example, <image>.
First, they choose a decimal number a consisting of n digits that contains at least one d... | instruction | 0 | 102,471 | 20 | 204,942 |
Tags: greedy, math, sortings
Correct Solution:
```
import sys
lines = sys.stdin.readlines()
N = int(lines[0].strip())
num = lines[1].strip()
factor = {2:{2:1}, 3: {3:1}, 4:{2:2}, 5:{5:1}, 6:{2:1, 3:1}, 7:{7:1}, 8:{2:3}, 9:{3:2}}
factorial = [{}, {}]
tmp = {}
for i in range(2, 10):
for k in factor[i].keys():
... | output | 1 | 102,471 | 20 | 204,943 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Drazil is playing a math game with Varda.
Let's define <image> for positive integer x as a product of factorials of its digits. For example, <image>.
First, they choose a decimal number a cons... | instruction | 0 | 102,472 | 20 | 204,944 |
Yes | output | 1 | 102,472 | 20 | 204,945 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Drazil is playing a math game with Varda.
Let's define <image> for positive integer x as a product of factorials of its digits. For example, <image>.
First, they choose a decimal number a cons... | instruction | 0 | 102,473 | 20 | 204,946 |
Yes | output | 1 | 102,473 | 20 | 204,947 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Drazil is playing a math game with Varda.
Let's define <image> for positive integer x as a product of factorials of its digits. For example, <image>.
First, they choose a decimal number a cons... | instruction | 0 | 102,474 | 20 | 204,948 |
Yes | output | 1 | 102,474 | 20 | 204,949 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Drazil is playing a math game with Varda.
Let's define <image> for positive integer x as a product of factorials of its digits. For example, <image>.
First, they choose a decimal number a cons... | instruction | 0 | 102,475 | 20 | 204,950 |
Yes | output | 1 | 102,475 | 20 | 204,951 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Drazil is playing a math game with Varda.
Let's define <image> for positive integer x as a product of factorials of its digits. For example, <image>.
First, they choose a decimal number a cons... | instruction | 0 | 102,476 | 20 | 204,952 |
No | output | 1 | 102,476 | 20 | 204,953 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Drazil is playing a math game with Varda.
Let's define <image> for positive integer x as a product of factorials of its digits. For example, <image>.
First, they choose a decimal number a cons... | instruction | 0 | 102,477 | 20 | 204,954 |
No | output | 1 | 102,477 | 20 | 204,955 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Drazil is playing a math game with Varda.
Let's define <image> for positive integer x as a product of factorials of its digits. For example, <image>.
First, they choose a decimal number a cons... | instruction | 0 | 102,478 | 20 | 204,956 |
No | output | 1 | 102,478 | 20 | 204,957 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Drazil is playing a math game with Varda.
Let's define <image> for positive integer x as a product of factorials of its digits. For example, <image>.
First, they choose a decimal number a cons... | instruction | 0 | 102,479 | 20 | 204,958 |
No | output | 1 | 102,479 | 20 | 204,959 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Input
The input contains a single integer a (1 ≤ a ≤ 99).
Output
Output "YES" or "NO".
Examples
Input
5
Output
YES
Input
13
Output
NO
Input
24
Output
NO
Input
46
Output
YES | instruction | 0 | 102,940 | 20 | 205,880 |
Tags: brute force
Correct Solution:
```
numWords = ["1","7","9"]
FirstNums = ["1","2","7","9"]
def isKanBan(n):
if(n == "10" or n == "11"):
return "NO"
if(n == "12"):
return "YES"
if(len(n) > 1):
if(n[0] in FirstNums):
return "NO"
for el in n:
if(el in num... | output | 1 | 102,940 | 20 | 205,881 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Input
The input contains a single integer a (1 ≤ a ≤ 99).
Output
Output "YES" or "NO".
Examples
Input
5
Output
YES
Input
13
Output
NO
Input
24
Output
NO
Input
46
Output
YES | instruction | 0 | 102,941 | 20 | 205,882 |
Tags: brute force
Correct Solution:
```
print("YES"if 0xbe880002fabeafabe800be800>>99-int(input())&1else"NO")
``` | output | 1 | 102,941 | 20 | 205,883 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Input
The input contains a single integer a (1 ≤ a ≤ 99).
Output
Output "YES" or "NO".
Examples
Input
5
Output
YES
Input
13
Output
NO
Input
24
Output
NO
Input
46
Output
YES | instruction | 0 | 102,942 | 20 | 205,884 |
Tags: brute force
Correct Solution:
```
a = [0, 2, 3, 4, 5, 6, 8, 12, 30, 32, 33, 34, 35, 36, 38, 40, 42, 43, 44, 45, 46, 48, 50, 52, 53, 54, 55, 56, 58, 60, 62, 63, 64, 65, 66, 68, 80, 82, 83, 84, 85, 86, 88]
n = int(input())
if n in a:
print("YES")
else:
print("NO")
``` | output | 1 | 102,942 | 20 | 205,885 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Input
The input contains a single integer a (1 ≤ a ≤ 99).
Output
Output "YES" or "NO".
Examples
Input
5
Output
YES
Input
13
Output
NO
Input
24
Output
NO
Input
46
Output
YES | instruction | 0 | 102,943 | 20 | 205,886 |
Tags: brute force
Correct Solution:
```
num = input().rjust(2, '0')
tens, nums = ['1', '2', '7', '9'], ['1', '7', '9']
if num[0] in tens or num[1] in nums:
if num != '12':
print('NO')
else:
print('YES')
else:
print('YES')
``` | output | 1 | 102,943 | 20 | 205,887 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Input
The input contains a single integer a (1 ≤ a ≤ 99).
Output
Output "YES" or "NO".
Examples
Input
5
Output
YES
Input
13
Output
NO
Input
24
Output
NO
Input
46
Output
YES | instruction | 0 | 102,944 | 20 | 205,888 |
Tags: brute force
Correct Solution:
```
n = int(input())
q = ["1","7","9","10","11","13","14","15","16","17","18","19","20",
"21","22","23","24","25","26","27","28","29","31","37","39",
"41","47","49","51","57","59","61","67","69",
"70","71","72","73","74","75","76","77","78","79",
"81","87","89","9... | output | 1 | 102,944 | 20 | 205,889 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Input
The input contains a single integer a (1 ≤ a ≤ 99).
Output
Output "YES" or "NO".
Examples
Input
5
Output
YES
Input
13
Output
NO
Input
24
Output
NO
Input
46
Output
YES | instruction | 0 | 102,945 | 20 | 205,890 |
Tags: brute force
Correct Solution:
```
n=int(input())
l=list(map(int,list(str(n))))
if 7 in l or 9 in l or (n>=13 and n<=29) or l[-1]==1 or n==10 or n==11 or (n>=70 and n<=79) or (n>=90):
print ("NO")
else:
print ("YES")
``` | output | 1 | 102,945 | 20 | 205,891 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Input
The input contains a single integer a (1 ≤ a ≤ 99).
Output
Output "YES" or "NO".
Examples
Input
5
Output
YES
Input
13
Output
NO
Input
24
Output
NO
Input
46
Output
YES | instruction | 0 | 102,946 | 20 | 205,892 |
Tags: brute force
Correct Solution:
```
n='0'+input()
print('YNEOS'[n!='012'and(n[-2]in'1279'or n[-1]in'179')::2])
``` | output | 1 | 102,946 | 20 | 205,893 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Input
The input contains a single integer a (1 ≤ a ≤ 99).
Output
Output "YES" or "NO".
Examples
Input
5
Output
YES
Input
13
Output
NO
Input
24
Output
NO
Input
46
Output
YES | instruction | 0 | 102,947 | 20 | 205,894 |
Tags: brute force
Correct Solution:
```
# Kanban Numbers - codeforces
#
import math
import sys
input = sys.stdin.readline
def inp():
return int(input())
def isKanban(n):
arr = [
0,1,0,0,0,0,0,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,1,0,1,0,... | output | 1 | 102,947 | 20 | 205,895 |
Provide tags and a correct Python 3 solution for this coding contest problem.
When Serezha was three years old, he was given a set of cards with letters for his birthday. They were arranged into words in the way which formed the boy's mother favorite number in binary notation. Serezha started playing with them immedia... | instruction | 0 | 102,994 | 20 | 205,988 |
Tags: implementation, sortings, strings
Correct Solution:
```
n = int(input())
q = list(input())
z = 0
e = 0
r = 0
o = 0
n = 0
for i in q:
if i == "z":
z+=1
elif i == "e":
e +=1
elif i =="o":
o+=1
elif i=="n":
n+=1
elif i == "r":
r += 1
while (n>0 and o>0 and e>0):
print(1,end=" ")
n-=1
o -=1
e -=1
w... | output | 1 | 102,994 | 20 | 205,989 |
Provide tags and a correct Python 3 solution for this coding contest problem.
When Serezha was three years old, he was given a set of cards with letters for his birthday. They were arranged into words in the way which formed the boy's mother favorite number in binary notation. Serezha started playing with them immedia... | instruction | 0 | 102,995 | 20 | 205,990 |
Tags: implementation, sortings, strings
Correct Solution:
```
n=int(input())
a=list(input())
z=a.count('z')
o=a.count('n')
for i in range(o):
print(1,end=' ')
for i in range(z):
print(0,end=' ')
``` | output | 1 | 102,995 | 20 | 205,991 |
Provide tags and a correct Python 3 solution for this coding contest problem.
When Serezha was three years old, he was given a set of cards with letters for his birthday. They were arranged into words in the way which formed the boy's mother favorite number in binary notation. Serezha started playing with them immedia... | instruction | 0 | 102,996 | 20 | 205,992 |
Tags: implementation, sortings, strings
Correct Solution:
```
n = int(input())
s = input()
d = {'z': 0, 'e': 0, 'r': 0, 'o': 0, 'n': 0}
res = []
for i in s:
d[i] = d[i] + 1
while(d['n'] > 0):
if(d['o'] and d['n'] and d['e']):
res.append(1)
d['o'] -= 1
d['n'] -= 1
d['e'] -= 1... | output | 1 | 102,996 | 20 | 205,993 |
Provide tags and a correct Python 3 solution for this coding contest problem.
When Serezha was three years old, he was given a set of cards with letters for his birthday. They were arranged into words in the way which formed the boy's mother favorite number in binary notation. Serezha started playing with them immedia... | instruction | 0 | 102,997 | 20 | 205,994 |
Tags: implementation, sortings, strings
Correct Solution:
```
n = int(input())
s = list(input())
print("1 "*s.count("n") + "0 "*s.count("z"))
``` | output | 1 | 102,997 | 20 | 205,995 |
Provide tags and a correct Python 3 solution for this coding contest problem.
When Serezha was three years old, he was given a set of cards with letters for his birthday. They were arranged into words in the way which formed the boy's mother favorite number in binary notation. Serezha started playing with them immedia... | instruction | 0 | 102,998 | 20 | 205,996 |
Tags: implementation, sortings, strings
Correct Solution:
```
N = int(input())
words = input()
one = words.count("n")
zero = words.count("z")
ans = "1 "*one + "0 "*zero
print(ans)
``` | output | 1 | 102,998 | 20 | 205,997 |
Provide tags and a correct Python 3 solution for this coding contest problem.
When Serezha was three years old, he was given a set of cards with letters for his birthday. They were arranged into words in the way which formed the boy's mother favorite number in binary notation. Serezha started playing with them immedia... | instruction | 0 | 102,999 | 20 | 205,998 |
Tags: implementation, sortings, strings
Correct Solution:
```
n=int(input())
jumble=input()
result=list()
for i in range(0,n):
if jumble[i]=='z':
result.append('0')
elif jumble[i]=='n':
result.insert(0,'1')
print(" ".join(result))
``` | output | 1 | 102,999 | 20 | 205,999 |
Provide tags and a correct Python 3 solution for this coding contest problem.
When Serezha was three years old, he was given a set of cards with letters for his birthday. They were arranged into words in the way which formed the boy's mother favorite number in binary notation. Serezha started playing with them immedia... | instruction | 0 | 103,000 | 20 | 206,000 |
Tags: implementation, sortings, strings
Correct Solution:
```
def solve(s):
n = r = 0
for c in s:
if c == "n":
n += 1
continue
if c == "r":
r += 1
ans = " ".join(["1" for i in range(n)] + ["0" for i in range(r)])
return ans
input()
s = input()
print(... | output | 1 | 103,000 | 20 | 206,001 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
When Serezha was three years old, he was given a set of cards with letters for his birthday. They were arranged into words in the way which formed the boy's mother favorite number in binary nota... | instruction | 0 | 103,002 | 20 | 206,004 |
Yes | output | 1 | 103,002 | 20 | 206,005 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
When Serezha was three years old, he was given a set of cards with letters for his birthday. They were arranged into words in the way which formed the boy's mother favorite number in binary nota... | instruction | 0 | 103,003 | 20 | 206,006 |
Yes | output | 1 | 103,003 | 20 | 206,007 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
When Serezha was three years old, he was given a set of cards with letters for his birthday. They were arranged into words in the way which formed the boy's mother favorite number in binary nota... | instruction | 0 | 103,004 | 20 | 206,008 |
Yes | output | 1 | 103,004 | 20 | 206,009 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
When Serezha was three years old, he was given a set of cards with letters for his birthday. They were arranged into words in the way which formed the boy's mother favorite number in binary nota... | instruction | 0 | 103,005 | 20 | 206,010 |
Yes | output | 1 | 103,005 | 20 | 206,011 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.