message stringlengths 2 23.4k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 129 108k | cluster float64 6 6 | __index_level_0__ int64 258 216k |
|---|---|---|---|---|---|
Provide tags and a correct Python 3 solution for this coding contest problem.
Memory is performing a walk on the two-dimensional plane, starting at the origin. He is given a string s with his directions for motion:
* An 'L' indicates he should move one unit left.
* An 'R' indicates he should move one unit right.... | instruction | 0 | 35,614 | 6 | 71,228 |
Tags: implementation, strings
Correct Solution:
```
l=input()
if(len(l)%2!=0):
print(-1)
elif(l.count('R')==l.count('L') and l.count('U')==l.count('D')):
print(0)
else:
s=0
a=max(l.count('R'),l.count('L'))-min(l.count('R'),l.count('L'))
b=max(l.count('U'),l.count('D'))-min(l.count('U'),l.count('D'))
if(a>b):
a-... | output | 1 | 35,614 | 6 | 71,229 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Memory is performing a walk on the two-dimensional plane, starting at the origin. He is given a string s with his directions for motion:
* An 'L' indicates he should move one unit left.
* An 'R' indicates he should move one unit right.... | instruction | 0 | 35,615 | 6 | 71,230 |
Tags: implementation, strings
Correct Solution:
```
s=input()
r=l=d=u=0
for i in s:
if i=='R':
r+=1
if i=='L':
l+=1
if i=='D':
d+=1
if i=='U':
u+=1
if (u+d+r+l)%2==0:
#print("u={},r={},l={},d={}".format(u,r,l,d))
if u==d and r==l:
print("0")
else:
... | output | 1 | 35,615 | 6 | 71,231 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Memory is performing a walk on the two-dimensional plane, starting at the origin. He is given a string s with his directions for motion:
* An 'L' indicates he should move one unit left.
* An 'R' indicates he should move one unit right.... | instruction | 0 | 35,616 | 6 | 71,232 |
Tags: implementation, strings
Correct Solution:
```
S = input()
l = 0
r = 0
u = 0
d = 0
if len(S)%2!=0:
print(-1)
else:
for i in S:
if i=='L':
l+=1
elif i=='R':
r+=1
elif i=='U':
u+=1
else:
d+=1
lr = abs(l-r)
ud = abs(u-d)
... | output | 1 | 35,616 | 6 | 71,233 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Memory is performing a walk on the two-dimensional plane, starting at the origin. He is given a string s with his directions for motion:
* An 'L' indicates he should move one unit left.
* An 'R' indicates he should move one unit right.... | instruction | 0 | 35,617 | 6 | 71,234 |
Tags: implementation, strings
Correct Solution:
```
#!/usr/bin/env python
#-*-coding:utf-8 -*-
x=y=0
for d in input():
if'L'==d:x-=1
elif'R'==d:x+=1
elif'D'==d:y-=1
else:y+=1
y=abs(x)+abs(y)
print(-1 if 1&y else y>>1)
``` | output | 1 | 35,617 | 6 | 71,235 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Memory is performing a walk on the two-dimensional plane, starting at the origin. He is given a string s with his directions for motion:
* An 'L' indicates he should move one unit left.
* An 'R' indicates he should move one unit right.... | instruction | 0 | 35,618 | 6 | 71,236 |
Tags: implementation, strings
Correct Solution:
```
t=input()
t=list(t)
x,y=0,0
for i in range(0,len(t)):
if(t[i]=='U'):
x+=1
if(t[i]=='D'):
x-=1
if(t[i]=='L'):
y+=1
if(t[i]=='R'):
y-=1
if(x<0):
x*=-1
if(y<0):
y*=-1
if(len(t)%2!=0):
print(-1)
else:
print((... | output | 1 | 35,618 | 6 | 71,237 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Memory is performing a walk on the two-dimensional plane, starting at the origin. He is given a string s with his directions for motion:
* An 'L' indicates he should move one unit left.
* An 'R' indicates he should move one unit right.... | instruction | 0 | 35,619 | 6 | 71,238 |
Tags: implementation, strings
Correct Solution:
```
s = input()
if len(s)%2 != 0:
print('-1')
exit()
L = 0
R = 0
U = 0
D = 0
for a in s:
if a == 'L':
L+=1
elif a == 'R':
R+=1
elif a == 'D':
D+=1
else:
U+=1
rem_L_R = abs(L-R)
rem_U_D = abs(U-D)
print(int(rem_U_D/2 ... | output | 1 | 35,619 | 6 | 71,239 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day, the Grasshopper was jumping on the lawn and found a piece of paper with a string. Grasshopper became interested what is the minimum jump ability he should have in order to be able to reach the far end of the string, jumping only on ... | instruction | 0 | 35,628 | 6 | 71,256 |
Tags: implementation
Correct Solution:
```
import sys
def main():
input = sys.stdin.readline().strip()
prev = -1
maxStep = 0
for i,ch in enumerate(input):
if (ch == 'A' or ch == 'E' or
ch =='I' or ch == 'O' or ch =='U' or ch=='Y'):
maxStep = max(abs(i-prev),maxStep)
... | output | 1 | 35,628 | 6 | 71,257 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day, the Grasshopper was jumping on the lawn and found a piece of paper with a string. Grasshopper became interested what is the minimum jump ability he should have in order to be able to reach the far end of the string, jumping only on ... | instruction | 0 | 35,629 | 6 | 71,258 |
Tags: implementation
Correct Solution:
```
a=input()
vowels=['A','E','I','O','U','Y']
ls=[]
for i in range (len(a)):
if a[i] in vowels:
ls.append(i)
if ls==[]:
print (len(a)+1)
else:
mx=0
for i in range (1,len(ls)):
mx=max(mx,ls[i]-ls[i-1])
print (max(mx,ls[0]+1,len(a)-ls... | output | 1 | 35,629 | 6 | 71,259 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day, the Grasshopper was jumping on the lawn and found a piece of paper with a string. Grasshopper became interested what is the minimum jump ability he should have in order to be able to reach the far end of the string, jumping only on ... | instruction | 0 | 35,630 | 6 | 71,260 |
Tags: implementation
Correct Solution:
```
s = input()
a = []
for i in range(len(s)):
if s[i] == 'A' or s[i] == 'E' or s[i] == 'U' or s[i] == 'I' or s[i] == 'O' or s[i] == 'Y' :
a.append(1)
else:
a.append(0)
a.append(1)
num = 0
maximum = 0
for i in range(len(a)):
num += 1
if a[i] ==... | output | 1 | 35,630 | 6 | 71,261 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day, the Grasshopper was jumping on the lawn and found a piece of paper with a string. Grasshopper became interested what is the minimum jump ability he should have in order to be able to reach the far end of the string, jumping only on ... | instruction | 0 | 35,631 | 6 | 71,262 |
Tags: implementation
Correct Solution:
```
def Main():
v = [ 'A', 'E', 'I', 'O', 'U','Y']
s = input()
# s = ' ' + s
# s = s + ' '
A = []
cnt = 0
# print(s)
for i in range(len(s) ):
if s[i] == 'A' or s[i] == 'E' or s[i] == 'I' or s[i] == 'O' or s[i] == 'U' or s[i] == 'Y':
... | output | 1 | 35,631 | 6 | 71,263 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day, the Grasshopper was jumping on the lawn and found a piece of paper with a string. Grasshopper became interested what is the minimum jump ability he should have in order to be able to reach the far end of the string, jumping only on ... | instruction | 0 | 35,632 | 6 | 71,264 |
Tags: implementation
Correct Solution:
```
a = input()
b = ['A', 'E', 'I', 'O', 'U', 'Y']
c = []
c.append(-1)
for i in range(len(a)):
if a[i] in b:
c.append(i)
c.append(len(a))
ans = 0
for i in range(len(c) - 1):
ans = max(ans, c[i + 1] - c[i])
print(ans)
``` | output | 1 | 35,632 | 6 | 71,265 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day, the Grasshopper was jumping on the lawn and found a piece of paper with a string. Grasshopper became interested what is the minimum jump ability he should have in order to be able to reach the far end of the string, jumping only on ... | instruction | 0 | 35,633 | 6 | 71,266 |
Tags: implementation
Correct Solution:
```
s=str(input())
res,last=0,-1
for i in range(len(s)):
if(s[i] in 'AEIOUY'):
res=max(res,i-last)
last=i
if(last==-1):
print(len(s)+1)
else:
print(max(res,len(s)-last))
``` | output | 1 | 35,633 | 6 | 71,267 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day, the Grasshopper was jumping on the lawn and found a piece of paper with a string. Grasshopper became interested what is the minimum jump ability he should have in order to be able to reach the far end of the string, jumping only on ... | instruction | 0 | 35,634 | 6 | 71,268 |
Tags: implementation
Correct Solution:
```
str = str(input())
list = list(str)
res = 0
max = 0
for i in list:
if ((i != 'A') and (i != 'E') and (i != 'I') and (i != 'O') and (i != 'U') and (i != 'Y') ):
res += 1
if res > max:
max = res
else:
res = 0
print(max + 1)
... | output | 1 | 35,634 | 6 | 71,269 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day, the Grasshopper was jumping on the lawn and found a piece of paper with a string. Grasshopper became interested what is the minimum jump ability he should have in order to be able to reach the far end of the string, jumping only on ... | instruction | 0 | 35,635 | 6 | 71,270 |
Tags: implementation
Correct Solution:
```
n=input()
l=len(n)
a="AEIOUY"
j=-1
ans=0
for i in range(l):
if n[i] in a:
ans=max(ans,i-j)
j=i
ans=max(l-j,ans)
if j==-1:
print(l+1)
else:
print(ans)
``` | output | 1 | 35,635 | 6 | 71,271 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One day, the Grasshopper was jumping on the lawn and found a piece of paper with a string. Grasshopper became interested what is the minimum jump ability he should have in order to be able to re... | instruction | 0 | 35,636 | 6 | 71,272 |
Yes | output | 1 | 35,636 | 6 | 71,273 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One day, the Grasshopper was jumping on the lawn and found a piece of paper with a string. Grasshopper became interested what is the minimum jump ability he should have in order to be able to re... | instruction | 0 | 35,637 | 6 | 71,274 |
Yes | output | 1 | 35,637 | 6 | 71,275 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One day, the Grasshopper was jumping on the lawn and found a piece of paper with a string. Grasshopper became interested what is the minimum jump ability he should have in order to be able to re... | instruction | 0 | 35,638 | 6 | 71,276 |
Yes | output | 1 | 35,638 | 6 | 71,277 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One day, the Grasshopper was jumping on the lawn and found a piece of paper with a string. Grasshopper became interested what is the minimum jump ability he should have in order to be able to re... | instruction | 0 | 35,641 | 6 | 71,282 |
No | output | 1 | 35,641 | 6 | 71,283 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One day, the Grasshopper was jumping on the lawn and found a piece of paper with a string. Grasshopper became interested what is the minimum jump ability he should have in order to be able to re... | instruction | 0 | 35,642 | 6 | 71,284 |
No | output | 1 | 35,642 | 6 | 71,285 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One day, the Grasshopper was jumping on the lawn and found a piece of paper with a string. Grasshopper became interested what is the minimum jump ability he should have in order to be able to re... | instruction | 0 | 35,643 | 6 | 71,286 |
No | output | 1 | 35,643 | 6 | 71,287 |
Provide tags and a correct Python 3 solution for this coding contest problem.
As it's the first of April, Heidi is suspecting that the news she reads today are fake, and she does not want to look silly in front of all the contestants. She knows that a newspiece is fake if it contains heidi as a subsequence. Help Heidi... | instruction | 0 | 35,663 | 6 | 71,326 |
Tags: implementation, strings
Correct Solution:
```
# -*- coding: utf-8 -*-
# @Date : 2019-01-24 12:04:10
# @Author : raj lath (oorja.halt@gmail.com)
# @Link : link
# @Version : 1.0.0
from sys import stdin
max_val=int(10e12)
min_val=int(-10e12)
def read_int() : return int(stdin.readline())
def read_ints(... | output | 1 | 35,663 | 6 | 71,327 |
Provide tags and a correct Python 3 solution for this coding contest problem.
As it's the first of April, Heidi is suspecting that the news she reads today are fake, and she does not want to look silly in front of all the contestants. She knows that a newspiece is fake if it contains heidi as a subsequence. Help Heidi... | instruction | 0 | 35,668 | 6 | 71,336 |
Tags: implementation, strings
Correct Solution:
```
import sys
Input = sys.stdin.readline
s = Input()
a = 'heidi'
q = 0
for i in s:
if i == a[q]:
q += 1
if q == 5:
break
print('YES' if q == 5 else 'NO')
# FMZJMSOMPMSL
``` | output | 1 | 35,668 | 6 | 71,337 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
VK just opened its second HQ in St. Petersburg! Side of its office building has a huge string s written on its side. This part of the office is supposed to be split into m meeting rooms in such ... | instruction | 0 | 36,207 | 6 | 72,414 |
No | output | 1 | 36,207 | 6 | 72,415 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
VK just opened its second HQ in St. Petersburg! Side of its office building has a huge string s written on its side. This part of the office is supposed to be split into m meeting rooms in such ... | instruction | 0 | 36,208 | 6 | 72,416 |
No | output | 1 | 36,208 | 6 | 72,417 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
VK just opened its second HQ in St. Petersburg! Side of its office building has a huge string s written on its side. This part of the office is supposed to be split into m meeting rooms in such ... | instruction | 0 | 36,209 | 6 | 72,418 |
No | output | 1 | 36,209 | 6 | 72,419 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
VK just opened its second HQ in St. Petersburg! Side of its office building has a huge string s written on its side. This part of the office is supposed to be split into m meeting rooms in such ... | instruction | 0 | 36,210 | 6 | 72,420 |
No | output | 1 | 36,210 | 6 | 72,421 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance. Recently, he has decided to take a couple of old songs and make dubstep remixes from them.
Let's assume that a song consists of some numb... | instruction | 0 | 36,362 | 6 | 72,724 |
Tags: strings
Correct Solution:
```
a = input().split('WUB')
s = ''
for i in a:
if i != '':
s = s + i + ' '
print(s[:-1])
``` | output | 1 | 36,362 | 6 | 72,725 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance. Recently, he has decided to take a couple of old songs and make dubstep remixes from them.
Let's assume that a song consists of some numb... | instruction | 0 | 36,363 | 6 | 72,726 |
Tags: strings
Correct Solution:
```
s = input()
S = s.split("WUB")
Ns = []
for i in S:
if i:
Ns.append(i)
print((' '.join(Ns)).strip())
``` | output | 1 | 36,363 | 6 | 72,727 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance. Recently, he has decided to take a couple of old songs and make dubstep remixes from them.
Let's assume that a song consists of some numb... | instruction | 0 | 36,364 | 6 | 72,728 |
Tags: strings
Correct Solution:
```
s = input().split("WUB")
for i in s:
if len(i)!=0:
print(i, end =" ")
print()
``` | output | 1 | 36,364 | 6 | 72,729 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance. Recently, he has decided to take a couple of old songs and make dubstep remixes from them.
Let's assume that a song consists of some numb... | instruction | 0 | 36,365 | 6 | 72,730 |
Tags: strings
Correct Solution:
```
print(*list(input().split("WUB")))
``` | output | 1 | 36,365 | 6 | 72,731 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance. Recently, he has decided to take a couple of old songs and make dubstep remixes from them.
Let's assume that a song consists of some numb... | instruction | 0 | 36,366 | 6 | 72,732 |
Tags: strings
Correct Solution:
```
s = input()
storage = []
afterwub = False
started = False
i = 0
while i < len(s):
if s[i] == 'W' and len(storage) == 0:
storage.append(s[i])
elif s[i] == 'U' and len(storage) == 1:
storage.append(s[i])
elif s[i] == 'B' and len(storage) == 2:
#print... | output | 1 | 36,366 | 6 | 72,733 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance. Recently, he has decided to take a couple of old songs and make dubstep remixes from them.
Let's assume that a song consists of some numb... | instruction | 0 | 36,367 | 6 | 72,734 |
Tags: strings
Correct Solution:
```
s = input()
if "WUB" in s:
x = s.replace("WUB"," ").strip()
print(x)
else:
print(s)
``` | output | 1 | 36,367 | 6 | 72,735 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance. Recently, he has decided to take a couple of old songs and make dubstep remixes from them.
Let's assume that a song consists of some numb... | instruction | 0 | 36,368 | 6 | 72,736 |
Tags: strings
Correct Solution:
```
s = input().strip()
tokens = list(filter(None,s.split("WUB")))
res = ''
for token in tokens:
res += token+' '
print(res.strip())
``` | output | 1 | 36,368 | 6 | 72,737 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance. Recently, he has decided to take a couple of old songs and make dubstep remixes from them.
Let's assume that a song consists of some numb... | instruction | 0 | 36,369 | 6 | 72,738 |
Tags: strings
Correct Solution:
```
x=input()
x=x.split("WUB")
for i in x:
print(i,end=" ")
``` | output | 1 | 36,369 | 6 | 72,739 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Recently, Valery have come across an entirely new programming language. Most of all the language attracted him with template functions and procedures. Let us remind you that templates are tools of a language, designed to encode generic algor... | instruction | 0 | 37,096 | 6 | 74,192 |
Tags: binary search, brute force, expression parsing, implementation
Correct Solution:
```
n = int(input())
v = dict()
f, f1 = [], []
for i in range(n):
t = input()
t1 = ''
k = t.find("d") + 1
while t[k] == " ":
k += 1
t = t[k:]
for i in t:
if i != " ":
t1 += i
t ... | output | 1 | 37,096 | 6 | 74,193 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Recently, Valery have come across an entirely new programming language. Most of all the language attracted him with template functions and procedures. Let us remind you that templates are tools of a language, designed to encode generic algor... | instruction | 0 | 37,097 | 6 | 74,194 |
Tags: binary search, brute force, expression parsing, implementation
Correct Solution:
```
func=int(input())
fnames=[]
fargs=[]
for i in range(func):
s=input().strip()[:-1].split('(')
fnames.append(s[0].split()[1])
arr=[j.strip() for j in s[1].split(',')]
fargs.append(arr)
#print(fnames)
#print(fargs)
s... | output | 1 | 37,097 | 6 | 74,195 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Recently, Valery have come across an entirely new programming language. Most of all the language attracted him with template functions and procedures. Let us remind you that templates are tools of a language, designed to encode generic algor... | instruction | 0 | 37,098 | 6 | 74,196 |
Tags: binary search, brute force, expression parsing, implementation
Correct Solution:
```
def main():
from collections import defaultdict
import sys
strings = sys.stdin.read().split('\n')
strings.reverse()
f = defaultdict(lambda: defaultdict(int))
n = int(strings.pop())
for i... | output | 1 | 37,098 | 6 | 74,197 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Recently, Valery have come across an entirely new programming language. Most of all the language attracted him with template functions and procedures. Let us remind you that templates are tools of a language, designed to encode generic algor... | instruction | 0 | 37,099 | 6 | 74,198 |
Tags: binary search, brute force, expression parsing, implementation
Correct Solution:
```
n=int(input())
funcs=[input().replace(' ','')[4:] for i in range(n) ]
funcs2=[f.replace('(',',').replace(')','').split(',') for f in funcs]
m=int(input())
vars=[input().strip().split() for i in range(m) ]
vard={l[1]:l[0] for l in... | output | 1 | 37,099 | 6 | 74,199 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Recently, Valery have come across an entirely new programming language. Most of all the language attracted him with template functions and procedures. Let us remind you that templates are tools of a language, designed to encode generic algor... | instruction | 0 | 37,100 | 6 | 74,200 |
Tags: binary search, brute force, expression parsing, implementation
Correct Solution:
```
n=int(input())
funcnames=[]
funcs=[]
for i in range(n):
x=input()
funcnames.append(list(list(x.split('('))[0].split())[1].strip())
x=list(x.split('('))[1].strip()[:-1]
x=list(map(str.strip,list(x.split(','))))
... | output | 1 | 37,100 | 6 | 74,201 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Recently, Valery have come across an entirely new programming language. Most of all the language attracted him with template functions and procedures. Let us remind you that templates are tools of a language, designed to encode generic algor... | instruction | 0 | 37,101 | 6 | 74,202 |
Tags: binary search, brute force, expression parsing, implementation
Correct Solution:
```
n=int(input())
fu=[input().replace(' ','')[4:].replace('(',',').replace(')','').split(',') for i in range(n)]
m=int(input())
v=[input().strip().split() for i in range(m)]
vd={l[1]:l[0] for l in v}
k=int(input())
c=[input().strip(... | output | 1 | 37,101 | 6 | 74,203 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Recently, Valery have come across an entirely new programming language. Most of all the language attracted him with template functions and procedures. Let us remind you that templates are tools of a language, designed to encode generic algor... | instruction | 0 | 37,102 | 6 | 74,204 |
Tags: binary search, brute force, expression parsing, implementation
Correct Solution:
```
I=input
R=str.replace
P=range
D=lambda:P(int(I()))
T={}
d={}
def rf(s):
print(s.split())
for _ in D():s=R(R(I(),'void',''),' ','');t=s.find('(');k=s[:t];d[k]=d.get(k,[])+[s[t+1:-1].split(',')]
for _ in D():a,b=I().split();T[b]=a... | output | 1 | 37,102 | 6 | 74,205 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a text consisting of n lines. Each line contains some space-separated words, consisting of lowercase English letters.
We define a syllable as a string that contains exactly one vowel and any arbitrary number (possibly none) of... | instruction | 0 | 37,323 | 6 | 74,646 |
Tags: implementation, strings
Correct Solution:
```
n = int(input())
V = {'a','e','i','o','u','y'}
p = input().split()
p = [int(i) for i in p]
c = [0 for i in range(n)]
for i in range(n):
A = list(input())
for v in V:
c[i] += A.count(v)
assert(len(c) == n)
flag = 1
for i in range(n):
if(c[i] != p[i]):
flag... | output | 1 | 37,323 | 6 | 74,647 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a text consisting of n lines. Each line contains some space-separated words, consisting of lowercase English letters.
We define a syllable as a string that contains exactly one vowel and any arbitrary number (possibly none) of... | instruction | 0 | 37,324 | 6 | 74,648 |
Tags: implementation, strings
Correct Solution:
```
n = int(input())
p=list(map(int,input().split()))
f=0
for i in range(n):
s=input()
if s.count('a')+s.count('e')+s.count('i')+s.count('o')+s.count('u')+s.count('y')==p[i]:
f+=1
if f==n:
print('YES')
else:
print('NO')
``` | output | 1 | 37,324 | 6 | 74,649 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a text consisting of n lines. Each line contains some space-separated words, consisting of lowercase English letters.
We define a syllable as a string that contains exactly one vowel and any arbitrary number (possibly none) of... | instruction | 0 | 37,325 | 6 | 74,650 |
Tags: implementation, strings
Correct Solution:
```
from sys import exit
def num_vow(s):
vow = ['a', 'e', 'o', 'i', 'u', 'y']
r = 0
for i in vow:
r += s.count(i)
return r
n = int(input())
p = list(map(int, input().split()))
f = True
for i in range(n):
s = input()
if num_vow(s) != p[i]... | output | 1 | 37,325 | 6 | 74,651 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a text consisting of n lines. Each line contains some space-separated words, consisting of lowercase English letters.
We define a syllable as a string that contains exactly one vowel and any arbitrary number (possibly none) of... | instruction | 0 | 37,326 | 6 | 74,652 |
Tags: implementation, strings
Correct Solution:
```
__author__ = 'Think'
n=int(input())
p=[int(i) for i in input().split()]
broken=False
for i in range(n):
line=input()
total=0
for s in line:
if s in ["a", "e", "i", "u", "o", "y"]:
total+=1
if total!=p[i]:
print("NO")
broken=True
break
if not broken:
pr... | output | 1 | 37,326 | 6 | 74,653 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a text consisting of n lines. Each line contains some space-separated words, consisting of lowercase English letters.
We define a syllable as a string that contains exactly one vowel and any arbitrary number (possibly none) of... | instruction | 0 | 37,327 | 6 | 74,654 |
Tags: implementation, strings
Correct Solution:
```
from sys import *
n=int(input())
p=[int(z) for z in input().split()]
glas=set([ "a", "e", "i", "o", "u", "y"])
for i in range(n):
s=input()
nogl=0
for j in s:
if j in glas:
nogl+=1
if nogl!=p[i]:
print("NO")
exit(0)... | output | 1 | 37,327 | 6 | 74,655 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a text consisting of n lines. Each line contains some space-separated words, consisting of lowercase English letters.
We define a syllable as a string that contains exactly one vowel and any arbitrary number (possibly none) of... | instruction | 0 | 37,328 | 6 | 74,656 |
Tags: implementation, strings
Correct Solution:
```
input()
answer = "YES"
vowels = set("aeiouy")
for p in map(int, input().split()):
if p != sum(l in vowels for l in input()):
answer = "NO"
break
print(answer)
``` | output | 1 | 37,328 | 6 | 74,657 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a text consisting of n lines. Each line contains some space-separated words, consisting of lowercase English letters.
We define a syllable as a string that contains exactly one vowel and any arbitrary number (possibly none) of... | instruction | 0 | 37,329 | 6 | 74,658 |
Tags: implementation, strings
Correct Solution:
```
num = int(input())
li = [int(x) for x in input().split()]
s = set(list("aeiouy"))
lis = [ len("".join(filter(lambda x: x in s,input()))) for x in range(num)]
print("YES" if lis == li else "NO")
``` | output | 1 | 37,329 | 6 | 74,659 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a text consisting of n lines. Each line contains some space-separated words, consisting of lowercase English letters.
We define a syllable as a string that contains exactly one vowel and any arbitrary number (possibly none) of... | instruction | 0 | 37,330 | 6 | 74,660 |
Tags: implementation, strings
Correct Solution:
```
n = int(input())
a = map(int, input().split())
for w in a:
s = input()
if w != sum(s.count(c) for c in "aeiouy"):
print("NO")
exit(0)
print("YES")
``` | output | 1 | 37,330 | 6 | 74,661 |
Provide a correct Python 3 solution for this coding contest problem.
Background
The kindergarten attached to the University of Aizu is a kindergarten where children who love programming gather. Yu, one of the kindergarten children, loves lowercase letters as much as programming. Yu-kun decided to write a scoring prog... | instruction | 0 | 37,704 | 6 | 75,408 |
"Correct Solution:
```
alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
v, e = map(int, input().split())
a = list(input().split())
g = [[] for _ in range(v)]
for _ in range(e):
s, t = map(int, input().split())
g[s].ap... | output | 1 | 37,704 | 6 | 75,409 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.