message stringlengths 2 11.9k | message_type stringclasses 2 values | message_id int64 0 1 | conversation_id int64 137 108k | cluster float64 18 18 | __index_level_0__ int64 274 217k |
|---|---|---|---|---|---|
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a text of single-space separated words, consisting of small and capital Latin letters.
Volume of the word is number of capital letters in the word. Volume of the text is maximum volume of all words in the text.
Calculate the volume of the given text.
Input
The first line contains one integer number n (1 ≤ n ≤ 200) — length of the text.
The second line contains text of single-space separated words s1, s2, ..., si, consisting only of small and capital Latin letters.
Output
Print one integer number — volume of text.
Examples
Input
7
NonZERO
Output
5
Input
24
this is zero answer text
Output
0
Input
24
Harbour Space University
Output
1
Note
In the first example there is only one word, there are 5 capital letters in it.
In the second example all of the words contain 0 capital letters.
Submitted Solution:
```
#make it zero when you meet space.
def textVolume(n,s):
C=["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"]
con=0
contadores=[]
for x in s:
if x in C:
con=con+1
elif x==" ":
con=0
contadores.append(con)
contadores.sort(reverse=True)
return contadores[0]
def main():
n=int(input())
s = input()
print(textVolume(n,s))
if __name__ == "__main__":
main()
``` | instruction | 0 | 94,091 | 18 | 188,182 |
No | output | 1 | 94,091 | 18 | 188,183 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a text of single-space separated words, consisting of small and capital Latin letters.
Volume of the word is number of capital letters in the word. Volume of the text is maximum volume of all words in the text.
Calculate the volume of the given text.
Input
The first line contains one integer number n (1 ≤ n ≤ 200) — length of the text.
The second line contains text of single-space separated words s1, s2, ..., si, consisting only of small and capital Latin letters.
Output
Print one integer number — volume of text.
Examples
Input
7
NonZERO
Output
5
Input
24
this is zero answer text
Output
0
Input
24
Harbour Space University
Output
1
Note
In the first example there is only one word, there are 5 capital letters in it.
In the second example all of the words contain 0 capital letters.
Submitted Solution:
```
a=int(input())
n=input()
t=0
for i in range(0,a):
if ((ord(n[i])>=65) and (ord(n[i])<=90)):t+=1
if (ord(n[i])==32):t=0
print(t)
``` | instruction | 0 | 94,092 | 18 | 188,184 |
No | output | 1 | 94,092 | 18 | 188,185 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a text of single-space separated words, consisting of small and capital Latin letters.
Volume of the word is number of capital letters in the word. Volume of the text is maximum volume of all words in the text.
Calculate the volume of the given text.
Input
The first line contains one integer number n (1 ≤ n ≤ 200) — length of the text.
The second line contains text of single-space separated words s1, s2, ..., si, consisting only of small and capital Latin letters.
Output
Print one integer number — volume of text.
Examples
Input
7
NonZERO
Output
5
Input
24
this is zero answer text
Output
0
Input
24
Harbour Space University
Output
1
Note
In the first example there is only one word, there are 5 capital letters in it.
In the second example all of the words contain 0 capital letters.
Submitted Solution:
```
N = int(input())
A = str(input())
chars = []
chars2 = []
chars3 = []
for i in A:
chars.append(i)
curr = 0
mx = 0
x = len(chars)
for i in range(0,x):
if chars[i] == ' ':
if curr > mx:
mx = curr
curr = 0
elif chars[i] == chars[i].upper():
curr = curr + 1
print(mx)
``` | instruction | 0 | 94,093 | 18 | 188,186 |
No | output | 1 | 94,093 | 18 | 188,187 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a string S consisting of uppercase English letters. Find the length of the longest ACGT string that is a substring (see Notes) of S.
Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.
Constraints
* S is a string of length between 1 and 10 (inclusive).
* Each character in S is an uppercase English letter.
Input
Input is given from Standard Input in the following format:
S
Output
Print the length of the longest ACGT string that is a substring of S.
Examples
Input
ATCODER
Output
3
Input
HATAGAYA
Output
5
Input
SHINJUKU
Output
0
Submitted Solution:
```
import re
print(max(list(map(len, re.compile(r'[A|G|C|T]*').findall(input())))))
``` | instruction | 0 | 94,203 | 18 | 188,406 |
Yes | output | 1 | 94,203 | 18 | 188,407 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a string S consisting of uppercase English letters. Find the length of the longest ACGT string that is a substring (see Notes) of S.
Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.
Constraints
* S is a string of length between 1 and 10 (inclusive).
* Each character in S is an uppercase English letter.
Input
Input is given from Standard Input in the following format:
S
Output
Print the length of the longest ACGT string that is a substring of S.
Examples
Input
ATCODER
Output
3
Input
HATAGAYA
Output
5
Input
SHINJUKU
Output
0
Submitted Solution:
```
S = input()
ans = 0
l = 0
for c in S:
if c in 'ATCG':
l += 1
ans = max(ans, l)
else:
l = 0
print(ans)
``` | instruction | 0 | 94,204 | 18 | 188,408 |
Yes | output | 1 | 94,204 | 18 | 188,409 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a string S consisting of uppercase English letters. Find the length of the longest ACGT string that is a substring (see Notes) of S.
Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.
Constraints
* S is a string of length between 1 and 10 (inclusive).
* Each character in S is an uppercase English letter.
Input
Input is given from Standard Input in the following format:
S
Output
Print the length of the longest ACGT string that is a substring of S.
Examples
Input
ATCODER
Output
3
Input
HATAGAYA
Output
5
Input
SHINJUKU
Output
0
Submitted Solution:
```
s=input()
k = 0
m = 0
for z in s:
if z in "ACGT":
k += 1
if m < k:
m = k
else:
k = 0
print(m)
``` | instruction | 0 | 94,205 | 18 | 188,410 |
Yes | output | 1 | 94,205 | 18 | 188,411 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a string S consisting of uppercase English letters. Find the length of the longest ACGT string that is a substring (see Notes) of S.
Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.
Constraints
* S is a string of length between 1 and 10 (inclusive).
* Each character in S is an uppercase English letter.
Input
Input is given from Standard Input in the following format:
S
Output
Print the length of the longest ACGT string that is a substring of S.
Examples
Input
ATCODER
Output
3
Input
HATAGAYA
Output
5
Input
SHINJUKU
Output
0
Submitted Solution:
```
S=input()
ans=cur=0
for c in S:
if c in 'ACGT':
cur+=1
ans=max(ans,cur)
else:
cur=0
print(ans)
``` | instruction | 0 | 94,206 | 18 | 188,412 |
Yes | output | 1 | 94,206 | 18 | 188,413 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a string S consisting of uppercase English letters. Find the length of the longest ACGT string that is a substring (see Notes) of S.
Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.
Constraints
* S is a string of length between 1 and 10 (inclusive).
* Each character in S is an uppercase English letter.
Input
Input is given from Standard Input in the following format:
S
Output
Print the length of the longest ACGT string that is a substring of S.
Examples
Input
ATCODER
Output
3
Input
HATAGAYA
Output
5
Input
SHINJUKU
Output
0
Submitted Solution:
```
#!/usr/bin/env python
# coding: utf-8
# In[11]:
S=input()
t=list()
ct=0
for i in range(len(S)):
if S[i]=='A' or S[i]=='C' or S[i]=='T' or S[i]=='G':
i+=1
ct+=1
else:
t.append(ct)
ct=0
i+=1
print(max(t))
# In[ ]:
``` | instruction | 0 | 94,207 | 18 | 188,414 |
No | output | 1 | 94,207 | 18 | 188,415 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a string S consisting of uppercase English letters. Find the length of the longest ACGT string that is a substring (see Notes) of S.
Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.
Constraints
* S is a string of length between 1 and 10 (inclusive).
* Each character in S is an uppercase English letter.
Input
Input is given from Standard Input in the following format:
S
Output
Print the length of the longest ACGT string that is a substring of S.
Examples
Input
ATCODER
Output
3
Input
HATAGAYA
Output
5
Input
SHINJUKU
Output
0
Submitted Solution:
```
s = input()
acgt = {"A", "C", "G", "T"}
ans = 0
now = 0
for i in range(len(s)):
if s[i] in acgt:
now += 1
else:
ans = max(ans, now)
now = 0
print(ans)
``` | instruction | 0 | 94,208 | 18 | 188,416 |
No | output | 1 | 94,208 | 18 | 188,417 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a string S consisting of uppercase English letters. Find the length of the longest ACGT string that is a substring (see Notes) of S.
Here, a ACGT string is a string that contains no characters other than `A`, `C`, `G` and `T`.
Constraints
* S is a string of length between 1 and 10 (inclusive).
* Each character in S is an uppercase English letter.
Input
Input is given from Standard Input in the following format:
S
Output
Print the length of the longest ACGT string that is a substring of S.
Examples
Input
ATCODER
Output
3
Input
HATAGAYA
Output
5
Input
SHINJUKU
Output
0
Submitted Solution:
```
import sys
arg = input()
scavenger=''
warehouse=[]
longest=0
i=0
for tmp in arg[0:]:
if tmp=='A' or tmp=='T' or tmp=='C' or tmp=='G':
scavenger=scavenger+tmp
else:
warehouse.append(scavenger)
scavenger=''
for tmp in warehouse[0:]:
if len(tmp)>longest:
longest=len(tmp)
print(longest)
``` | instruction | 0 | 94,210 | 18 | 188,420 |
No | output | 1 | 94,210 | 18 | 188,421 |
Provide a correct Python 3 solution for this coding contest problem.
We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.
Print all strings that are written on the most number of votes, in lexicographical order.
Constraints
* 1 \leq N \leq 2 \times 10^5
* S_i (1 \leq i \leq N) are strings consisting of lowercase English letters.
* The length of S_i (1 \leq i \leq N) is between 1 and 10 (inclusive).
Input
Input is given from Standard Input in the following format:
N
S_1
:
S_N
Output
Print all strings in question in lexicographical order.
Examples
Input
7
beat
vet
beet
bed
vet
bet
beet
Output
beet
vet
Input
8
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
Output
buffalo
Input
7
bass
bass
kick
kick
bass
kick
kick
Output
kick
Input
4
ushi
tapu
nichia
kun
Output
kun
nichia
tapu
ushi | instruction | 0 | 95,047 | 18 | 190,094 |
"Correct Solution:
```
n=int(input())
S=[input() for _ in range(n)]
from collections import Counter
d=Counter(S)
e=[]
c=d.most_common()[0][1]
for i in d.keys():
if d[i]==c:
e.append(i)
e.sort()
print(*e,sep="\n")
``` | output | 1 | 95,047 | 18 | 190,095 |
Provide a correct Python 3 solution for this coding contest problem.
We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.
Print all strings that are written on the most number of votes, in lexicographical order.
Constraints
* 1 \leq N \leq 2 \times 10^5
* S_i (1 \leq i \leq N) are strings consisting of lowercase English letters.
* The length of S_i (1 \leq i \leq N) is between 1 and 10 (inclusive).
Input
Input is given from Standard Input in the following format:
N
S_1
:
S_N
Output
Print all strings in question in lexicographical order.
Examples
Input
7
beat
vet
beet
bed
vet
bet
beet
Output
beet
vet
Input
8
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
Output
buffalo
Input
7
bass
bass
kick
kick
bass
kick
kick
Output
kick
Input
4
ushi
tapu
nichia
kun
Output
kun
nichia
tapu
ushi | instruction | 0 | 95,048 | 18 | 190,096 |
"Correct Solution:
```
N=int(input())
S={}
for n in range(N):
s=input()
S[s]=S.get(s,0)+1
maxS=max(S.values())
S=[k for k,v in S.items() if v==maxS]
print('\n'.join(sorted(S)))
``` | output | 1 | 95,048 | 18 | 190,097 |
Provide a correct Python 3 solution for this coding contest problem.
We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.
Print all strings that are written on the most number of votes, in lexicographical order.
Constraints
* 1 \leq N \leq 2 \times 10^5
* S_i (1 \leq i \leq N) are strings consisting of lowercase English letters.
* The length of S_i (1 \leq i \leq N) is between 1 and 10 (inclusive).
Input
Input is given from Standard Input in the following format:
N
S_1
:
S_N
Output
Print all strings in question in lexicographical order.
Examples
Input
7
beat
vet
beet
bed
vet
bet
beet
Output
beet
vet
Input
8
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
Output
buffalo
Input
7
bass
bass
kick
kick
bass
kick
kick
Output
kick
Input
4
ushi
tapu
nichia
kun
Output
kun
nichia
tapu
ushi | instruction | 0 | 95,049 | 18 | 190,098 |
"Correct Solution:
```
n = int(input())
d = {}
for i in range(n):
s = input()
d[s] = d.get(s,0)+1
m = max(d[i] for i in d)
for s in sorted(d):
if d[s]==m:
print(s)
``` | output | 1 | 95,049 | 18 | 190,099 |
Provide a correct Python 3 solution for this coding contest problem.
We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.
Print all strings that are written on the most number of votes, in lexicographical order.
Constraints
* 1 \leq N \leq 2 \times 10^5
* S_i (1 \leq i \leq N) are strings consisting of lowercase English letters.
* The length of S_i (1 \leq i \leq N) is between 1 and 10 (inclusive).
Input
Input is given from Standard Input in the following format:
N
S_1
:
S_N
Output
Print all strings in question in lexicographical order.
Examples
Input
7
beat
vet
beet
bed
vet
bet
beet
Output
beet
vet
Input
8
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
Output
buffalo
Input
7
bass
bass
kick
kick
bass
kick
kick
Output
kick
Input
4
ushi
tapu
nichia
kun
Output
kun
nichia
tapu
ushi | instruction | 0 | 95,050 | 18 | 190,100 |
"Correct Solution:
```
N = int(input())
d = {}
for i in range(N):
tmp = input()
d[tmp] = d.get(tmp,0) + 1
m = max(d[i] for i in d)
max_list = [i for i in d if d[i] == m]
print("\n".join(sorted(max_list)))
``` | output | 1 | 95,050 | 18 | 190,101 |
Provide a correct Python 3 solution for this coding contest problem.
We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.
Print all strings that are written on the most number of votes, in lexicographical order.
Constraints
* 1 \leq N \leq 2 \times 10^5
* S_i (1 \leq i \leq N) are strings consisting of lowercase English letters.
* The length of S_i (1 \leq i \leq N) is between 1 and 10 (inclusive).
Input
Input is given from Standard Input in the following format:
N
S_1
:
S_N
Output
Print all strings in question in lexicographical order.
Examples
Input
7
beat
vet
beet
bed
vet
bet
beet
Output
beet
vet
Input
8
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
Output
buffalo
Input
7
bass
bass
kick
kick
bass
kick
kick
Output
kick
Input
4
ushi
tapu
nichia
kun
Output
kun
nichia
tapu
ushi | instruction | 0 | 95,051 | 18 | 190,102 |
"Correct Solution:
```
from collections import Counter
n = int(input())
s = [input() for i in range(n)]
c = Counter(s)
mc = c.most_common()
ans = [i[0] for i in mc if i[1] == mc[0][1]]
ans.sort()
for i in ans:
print(i)
``` | output | 1 | 95,051 | 18 | 190,103 |
Provide a correct Python 3 solution for this coding contest problem.
We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.
Print all strings that are written on the most number of votes, in lexicographical order.
Constraints
* 1 \leq N \leq 2 \times 10^5
* S_i (1 \leq i \leq N) are strings consisting of lowercase English letters.
* The length of S_i (1 \leq i \leq N) is between 1 and 10 (inclusive).
Input
Input is given from Standard Input in the following format:
N
S_1
:
S_N
Output
Print all strings in question in lexicographical order.
Examples
Input
7
beat
vet
beet
bed
vet
bet
beet
Output
beet
vet
Input
8
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
Output
buffalo
Input
7
bass
bass
kick
kick
bass
kick
kick
Output
kick
Input
4
ushi
tapu
nichia
kun
Output
kun
nichia
tapu
ushi | instruction | 0 | 95,052 | 18 | 190,104 |
"Correct Solution:
```
from collections import defaultdict
n = int(input())
dic = defaultdict(int)
for i in range(n):
dic[input()] += 1
max_s = max(dic.values())
for k, v in sorted(dic.items()):
if v == max_s:
print(k)
``` | output | 1 | 95,052 | 18 | 190,105 |
Provide a correct Python 3 solution for this coding contest problem.
We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.
Print all strings that are written on the most number of votes, in lexicographical order.
Constraints
* 1 \leq N \leq 2 \times 10^5
* S_i (1 \leq i \leq N) are strings consisting of lowercase English letters.
* The length of S_i (1 \leq i \leq N) is between 1 and 10 (inclusive).
Input
Input is given from Standard Input in the following format:
N
S_1
:
S_N
Output
Print all strings in question in lexicographical order.
Examples
Input
7
beat
vet
beet
bed
vet
bet
beet
Output
beet
vet
Input
8
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
Output
buffalo
Input
7
bass
bass
kick
kick
bass
kick
kick
Output
kick
Input
4
ushi
tapu
nichia
kun
Output
kun
nichia
tapu
ushi | instruction | 0 | 95,053 | 18 | 190,106 |
"Correct Solution:
```
n=int(input())
c={}
for _ in range(n): s=input(); c[s]=c.get(s,0)+1
m=max(c.values())
print(*sorted(k for k,v in c.items() if v==m))
``` | output | 1 | 95,053 | 18 | 190,107 |
Provide a correct Python 3 solution for this coding contest problem.
We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.
Print all strings that are written on the most number of votes, in lexicographical order.
Constraints
* 1 \leq N \leq 2 \times 10^5
* S_i (1 \leq i \leq N) are strings consisting of lowercase English letters.
* The length of S_i (1 \leq i \leq N) is between 1 and 10 (inclusive).
Input
Input is given from Standard Input in the following format:
N
S_1
:
S_N
Output
Print all strings in question in lexicographical order.
Examples
Input
7
beat
vet
beet
bed
vet
bet
beet
Output
beet
vet
Input
8
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
Output
buffalo
Input
7
bass
bass
kick
kick
bass
kick
kick
Output
kick
Input
4
ushi
tapu
nichia
kun
Output
kun
nichia
tapu
ushi | instruction | 0 | 95,054 | 18 | 190,108 |
"Correct Solution:
```
from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
c = Counter(S)
c_max = max(c.values())
[print(x) for x in sorted([s for s in set(S) if c[s] == c_max])]
``` | output | 1 | 95,054 | 18 | 190,109 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.
Print all strings that are written on the most number of votes, in lexicographical order.
Constraints
* 1 \leq N \leq 2 \times 10^5
* S_i (1 \leq i \leq N) are strings consisting of lowercase English letters.
* The length of S_i (1 \leq i \leq N) is between 1 and 10 (inclusive).
Input
Input is given from Standard Input in the following format:
N
S_1
:
S_N
Output
Print all strings in question in lexicographical order.
Examples
Input
7
beat
vet
beet
bed
vet
bet
beet
Output
beet
vet
Input
8
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
Output
buffalo
Input
7
bass
bass
kick
kick
bass
kick
kick
Output
kick
Input
4
ushi
tapu
nichia
kun
Output
kun
nichia
tapu
ushi
Submitted Solution:
```
import collections
n = int(input())
l = [str(input()) for i in range(n)]
c = collections.Counter(l).most_common()[::1]
res = sorted([i[0] for i in c if i[1] == c[0][1]])
[print(i) for i in res]
``` | instruction | 0 | 95,055 | 18 | 190,110 |
Yes | output | 1 | 95,055 | 18 | 190,111 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.
Print all strings that are written on the most number of votes, in lexicographical order.
Constraints
* 1 \leq N \leq 2 \times 10^5
* S_i (1 \leq i \leq N) are strings consisting of lowercase English letters.
* The length of S_i (1 \leq i \leq N) is between 1 and 10 (inclusive).
Input
Input is given from Standard Input in the following format:
N
S_1
:
S_N
Output
Print all strings in question in lexicographical order.
Examples
Input
7
beat
vet
beet
bed
vet
bet
beet
Output
beet
vet
Input
8
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
Output
buffalo
Input
7
bass
bass
kick
kick
bass
kick
kick
Output
kick
Input
4
ushi
tapu
nichia
kun
Output
kun
nichia
tapu
ushi
Submitted Solution:
```
import collections as coll
N = int(input())
A = [input() for _ in range(N)]
C = coll.Counter(A).most_common()
C = sorted([k for k,v in C if v == C[0][1]])
print(*C, sep='\n')
``` | instruction | 0 | 95,056 | 18 | 190,112 |
Yes | output | 1 | 95,056 | 18 | 190,113 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.
Print all strings that are written on the most number of votes, in lexicographical order.
Constraints
* 1 \leq N \leq 2 \times 10^5
* S_i (1 \leq i \leq N) are strings consisting of lowercase English letters.
* The length of S_i (1 \leq i \leq N) is between 1 and 10 (inclusive).
Input
Input is given from Standard Input in the following format:
N
S_1
:
S_N
Output
Print all strings in question in lexicographical order.
Examples
Input
7
beat
vet
beet
bed
vet
bet
beet
Output
beet
vet
Input
8
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
Output
buffalo
Input
7
bass
bass
kick
kick
bass
kick
kick
Output
kick
Input
4
ushi
tapu
nichia
kun
Output
kun
nichia
tapu
ushi
Submitted Solution:
```
from collections import Counter
N = int(input())
c = Counter([input() for _ in range(N)])
mv = max(c.values())
[print(w) for w in sorted(c.keys()) if c[w] == mv]
``` | instruction | 0 | 95,057 | 18 | 190,114 |
Yes | output | 1 | 95,057 | 18 | 190,115 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.
Print all strings that are written on the most number of votes, in lexicographical order.
Constraints
* 1 \leq N \leq 2 \times 10^5
* S_i (1 \leq i \leq N) are strings consisting of lowercase English letters.
* The length of S_i (1 \leq i \leq N) is between 1 and 10 (inclusive).
Input
Input is given from Standard Input in the following format:
N
S_1
:
S_N
Output
Print all strings in question in lexicographical order.
Examples
Input
7
beat
vet
beet
bed
vet
bet
beet
Output
beet
vet
Input
8
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
Output
buffalo
Input
7
bass
bass
kick
kick
bass
kick
kick
Output
kick
Input
4
ushi
tapu
nichia
kun
Output
kun
nichia
tapu
ushi
Submitted Solution:
```
import collections
n = int(input())
c = collections.Counter([ input() for i in range(n) ])
ma = max(c.values())
print(*sorted([ i for i, j in c.items() if j == ma ]), sep='\n')
``` | instruction | 0 | 95,058 | 18 | 190,116 |
Yes | output | 1 | 95,058 | 18 | 190,117 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.
Print all strings that are written on the most number of votes, in lexicographical order.
Constraints
* 1 \leq N \leq 2 \times 10^5
* S_i (1 \leq i \leq N) are strings consisting of lowercase English letters.
* The length of S_i (1 \leq i \leq N) is between 1 and 10 (inclusive).
Input
Input is given from Standard Input in the following format:
N
S_1
:
S_N
Output
Print all strings in question in lexicographical order.
Examples
Input
7
beat
vet
beet
bed
vet
bet
beet
Output
beet
vet
Input
8
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
Output
buffalo
Input
7
bass
bass
kick
kick
bass
kick
kick
Output
kick
Input
4
ushi
tapu
nichia
kun
Output
kun
nichia
tapu
ushi
Submitted Solution:
```
N = int(input())
S = []
for i in range(N):
tmp = input()
S.append(tmp)
S.sort()
if N == 1:
print(S[0])
exit()
ans = []
SS = []
count = 1
print(S)
for i in range(N-1):
if i == N-2:
if S[i] == S[i+1]:
count += 1
ans.append(count)
SS.append(S[i])
else:
ans.append(count)
SS.append(S[i])
ans.append(1)
SS.append(S[i+1])
elif S[i] == S[i+1]:
count += 1
else:
ans.append(count)
SS.append(S[i])
count = 1
m = max(ans)
for i in range(len(SS)):
if ans[i] == m:
print(SS[i])
``` | instruction | 0 | 95,059 | 18 | 190,118 |
No | output | 1 | 95,059 | 18 | 190,119 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.
Print all strings that are written on the most number of votes, in lexicographical order.
Constraints
* 1 \leq N \leq 2 \times 10^5
* S_i (1 \leq i \leq N) are strings consisting of lowercase English letters.
* The length of S_i (1 \leq i \leq N) is between 1 and 10 (inclusive).
Input
Input is given from Standard Input in the following format:
N
S_1
:
S_N
Output
Print all strings in question in lexicographical order.
Examples
Input
7
beat
vet
beet
bed
vet
bet
beet
Output
beet
vet
Input
8
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
Output
buffalo
Input
7
bass
bass
kick
kick
bass
kick
kick
Output
kick
Input
4
ushi
tapu
nichia
kun
Output
kun
nichia
tapu
ushi
Submitted Solution:
```
N = int(input())
s = [0] * N
time = [1] * N
j = 0
for i in range(N):
inp = str(input())
if inp in s:
x = s.index(inp)
time[x] += 1
else:
s[j] = inp
j += 1
ans = max(time)
#print(s, time)
for i in range(N):
if time[i] == ans:
if s[i] != 0:
print(s[i])
``` | instruction | 0 | 95,060 | 18 | 190,120 |
No | output | 1 | 95,060 | 18 | 190,121 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.
Print all strings that are written on the most number of votes, in lexicographical order.
Constraints
* 1 \leq N \leq 2 \times 10^5
* S_i (1 \leq i \leq N) are strings consisting of lowercase English letters.
* The length of S_i (1 \leq i \leq N) is between 1 and 10 (inclusive).
Input
Input is given from Standard Input in the following format:
N
S_1
:
S_N
Output
Print all strings in question in lexicographical order.
Examples
Input
7
beat
vet
beet
bed
vet
bet
beet
Output
beet
vet
Input
8
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
Output
buffalo
Input
7
bass
bass
kick
kick
bass
kick
kick
Output
kick
Input
4
ushi
tapu
nichia
kun
Output
kun
nichia
tapu
ushi
Submitted Solution:
```
from collections import Counter
n=int(input())
s = [input() for _ in range(n)]
c=[i for i,j in Counter(s).items() if j == max(Counter(s).values())]
for k in c:
print(k)
``` | instruction | 0 | 95,061 | 18 | 190,122 |
No | output | 1 | 95,061 | 18 | 190,123 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.
Print all strings that are written on the most number of votes, in lexicographical order.
Constraints
* 1 \leq N \leq 2 \times 10^5
* S_i (1 \leq i \leq N) are strings consisting of lowercase English letters.
* The length of S_i (1 \leq i \leq N) is between 1 and 10 (inclusive).
Input
Input is given from Standard Input in the following format:
N
S_1
:
S_N
Output
Print all strings in question in lexicographical order.
Examples
Input
7
beat
vet
beet
bed
vet
bet
beet
Output
beet
vet
Input
8
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
Output
buffalo
Input
7
bass
bass
kick
kick
bass
kick
kick
Output
kick
Input
4
ushi
tapu
nichia
kun
Output
kun
nichia
tapu
ushi
Submitted Solution:
```
import sys
input = sys.stdin.readline
N = int(input())
S = []
for x in range(N):
S.append(input().rstrip())
S_label_n = []
S_label = list(set(S))
for x in S_label:
S_label_n.append(S.count(x))
max_n =max(S_label_n)
maxIndex = [i for i, x in enumerate(S_label_n) if x ==max_n ]
ans_list = []
for x in maxIndex:
ans_list.append(S_label[x])
ans_list.sort()
for x in ans_list:
print(x)
``` | instruction | 0 | 95,062 | 18 | 190,124 |
No | output | 1 | 95,062 | 18 | 190,125 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
New Year is getting near. So it's time to change handles on codeforces. Mishka wants to change his handle but in such a way that people would not forget who he is.
To make it work, he only allowed to change letters case. More formally, during one handle change he can choose any segment of his handle [i; i + l - 1] and apply tolower or toupper to all letters of his handle on this segment (more fomally, replace all uppercase letters with corresponding lowercase or vice versa). The length l is fixed for all changes.
Because it is not allowed to change codeforces handle too often, Mishka can perform at most k such operations. What is the minimum value of min(lower, upper) (where lower is the number of lowercase letters, and upper is the number of uppercase letters) can be obtained after optimal sequence of changes?
Input
The first line of the input contains three integers n, k and l (1 ≤ n, k, l ≤ 10^6, l ≤ n) — the length of Mishka's handle, the number of changes and the length of the segment.
The second line of the input contains one string s, consisting of n lowercase and uppercase Latin letters — Mishka's handle.
Output
Print one integer — the minimum value of min(lower, upper) after that Mishka change his handle at most k times in a way described in the problem statement.
Examples
Input
7 1 4
PikMike
Output
0
Input
15 2 2
AaAaAAaaAAAAaaA
Output
2
Input
14 2 6
aBcdEFGHIJklMn
Output
0
Input
9 2 2
aAaAAAaaA
Output
1
Submitted Solution:
```
n,k,l=map(int,input().split())
s=input()
o=n
u=['A'<=c<='Z' for c in s]
#u=[0,0,0,1,1,0,0,1]*(n//8)
d = [0] * (n+1)
c = [0] * (n+1)
for f in [lambda x:x, lambda x:1-x]:
lo=0
hi=n
for _ in range(50):
test = (lo + hi)/2
d[0]=c[0]=0
for i in range(n):
d[i+1]=d[i]+f(u[i])
c[i+1]=c[i]
if i >= l-1 and d[i+1]>d[i+1-l]+test:
d[i+1]=d[i+1-l]+test
c[i+1]=c[i]+1
cost,count=d[n],c[n]
if count<=k:
out=cost-test*count
hi=test
else:
lo=test
o=min(o,out)
print(max(0,round(o)))
``` | instruction | 0 | 95,387 | 18 | 190,774 |
No | output | 1 | 95,387 | 18 | 190,775 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
New Year is getting near. So it's time to change handles on codeforces. Mishka wants to change his handle but in such a way that people would not forget who he is.
To make it work, he only allowed to change letters case. More formally, during one handle change he can choose any segment of his handle [i; i + l - 1] and apply tolower or toupper to all letters of his handle on this segment (more fomally, replace all uppercase letters with corresponding lowercase or vice versa). The length l is fixed for all changes.
Because it is not allowed to change codeforces handle too often, Mishka can perform at most k such operations. What is the minimum value of min(lower, upper) (where lower is the number of lowercase letters, and upper is the number of uppercase letters) can be obtained after optimal sequence of changes?
Input
The first line of the input contains three integers n, k and l (1 ≤ n, k, l ≤ 10^6, l ≤ n) — the length of Mishka's handle, the number of changes and the length of the segment.
The second line of the input contains one string s, consisting of n lowercase and uppercase Latin letters — Mishka's handle.
Output
Print one integer — the minimum value of min(lower, upper) after that Mishka change his handle at most k times in a way described in the problem statement.
Examples
Input
7 1 4
PikMike
Output
0
Input
15 2 2
AaAaAAaaAAAAaaA
Output
2
Input
14 2 6
aBcdEFGHIJklMn
Output
0
Input
9 2 2
aAaAAAaaA
Output
1
Submitted Solution:
```
# 1279F - New Year And Handle Change
# Great example of the "Aliens Trick" - DP optimization
# dp[i] = max(dp[i-1] + s[i], (i + 1 - max(i-l+1, 0)) + dp[i-l] - lambda)
def dp(i, table, l, s, theta):
if i in table:
return table[i]
else:
if i < 0:
table[i] = [0, 0]
return table[i]
else:
table[i] = [0, 0]
a = dp(i-1, table, l, s, theta)[0] + int(s[i])
a_cnt = dp(i-1, table, l, s, theta)[1]
b = dp(i-l, table, l, s, theta)[0] + \
(i + 1 - max(i-l+1, 0)) - theta
b_cnt = dp(i-l, table, l, s, theta)[1] + 1
if a >= b:
table[i][0], table[i][1] = a, a_cnt
else:
table[i][0], table[i][1] = b, b_cnt
return table[i]
def binary_search(n, k, l, s):
low, high = 0, l+1
theta = 0
count = 0
while low < high:
count += 1
theta = int((low+high)/2)
dp_table = {}
ans = dp(n-1, dp_table, l, s, theta)
if ans[1] == k:
return theta
elif ans[1] > k:
low = theta+1
else:
high = theta
# print(count)
return low
if __name__ == "__main__":
inp = input().rstrip().split(" ")
n, k, l = int(inp[0]), int(inp[1]), int(inp[2])
s = input().rstrip()
s_lower = "" # maximize lowercase here, ie. the 1s
s_upper = "" # maximize uppercase here, ie, the 1s
for char in s:
if char.islower():
s_lower += "1"
s_upper += "0"
else:
s_lower += "0"
s_upper += "1"
theta = binary_search(n, k, l, s_upper)
#print("theta = %d" % theta)
table = {}
ans = dp(n-1, table, l, s_upper, theta)
# print(table)
ans1 = n - (ans[0] + theta*k)
theta = binary_search(n, k, l, s_lower)
table = {}
ans = dp(n-1, table, l, s_upper, theta)
ans2 = n - (ans[0] + theta*k)
ans = min(ans1, ans2)
print(ans)
``` | instruction | 0 | 95,388 | 18 | 190,776 |
No | output | 1 | 95,388 | 18 | 190,777 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
New Year is getting near. So it's time to change handles on codeforces. Mishka wants to change his handle but in such a way that people would not forget who he is.
To make it work, he only allowed to change letters case. More formally, during one handle change he can choose any segment of his handle [i; i + l - 1] and apply tolower or toupper to all letters of his handle on this segment (more fomally, replace all uppercase letters with corresponding lowercase or vice versa). The length l is fixed for all changes.
Because it is not allowed to change codeforces handle too often, Mishka can perform at most k such operations. What is the minimum value of min(lower, upper) (where lower is the number of lowercase letters, and upper is the number of uppercase letters) can be obtained after optimal sequence of changes?
Input
The first line of the input contains three integers n, k and l (1 ≤ n, k, l ≤ 10^6, l ≤ n) — the length of Mishka's handle, the number of changes and the length of the segment.
The second line of the input contains one string s, consisting of n lowercase and uppercase Latin letters — Mishka's handle.
Output
Print one integer — the minimum value of min(lower, upper) after that Mishka change his handle at most k times in a way described in the problem statement.
Examples
Input
7 1 4
PikMike
Output
0
Input
15 2 2
AaAaAAaaAAAAaaA
Output
2
Input
14 2 6
aBcdEFGHIJklMn
Output
0
Input
9 2 2
aAaAAAaaA
Output
1
Submitted Solution:
```
n,k,l=map(int,input().split())
s=input()
lo=0
hi=n#Allowed
o=n
u=['A'<=c<='Z' for c in s]
#u=[0,0,0,1,1,0,0,1]*(n//8)
d = [0] * (n+1)
c = [0] * (n+1)
for f in [lambda x:x, lambda x:1-x]:
for _ in range(50):
test = (lo + hi)/2
d[0]=c[0]=0
for i in range(n):
d[i+1]=d[i]+f(u[i])
c[i+1]=c[i]
if i >= l-1 and d[i+1]>d[i+1-l]+test:
d[i+1]=d[i+1-l]+test
c[i+1]=c[i]+1
cost,count=d[n],c[n]
if count<=k:
out=cost-test*k
hi=test
else:
lo=test
o=min(o,out)
print(round(o))
``` | instruction | 0 | 95,389 | 18 | 190,778 |
No | output | 1 | 95,389 | 18 | 190,779 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
New Year is getting near. So it's time to change handles on codeforces. Mishka wants to change his handle but in such a way that people would not forget who he is.
To make it work, he only allowed to change letters case. More formally, during one handle change he can choose any segment of his handle [i; i + l - 1] and apply tolower or toupper to all letters of his handle on this segment (more fomally, replace all uppercase letters with corresponding lowercase or vice versa). The length l is fixed for all changes.
Because it is not allowed to change codeforces handle too often, Mishka can perform at most k such operations. What is the minimum value of min(lower, upper) (where lower is the number of lowercase letters, and upper is the number of uppercase letters) can be obtained after optimal sequence of changes?
Input
The first line of the input contains three integers n, k and l (1 ≤ n, k, l ≤ 10^6, l ≤ n) — the length of Mishka's handle, the number of changes and the length of the segment.
The second line of the input contains one string s, consisting of n lowercase and uppercase Latin letters — Mishka's handle.
Output
Print one integer — the minimum value of min(lower, upper) after that Mishka change his handle at most k times in a way described in the problem statement.
Examples
Input
7 1 4
PikMike
Output
0
Input
15 2 2
AaAaAAaaAAAAaaA
Output
2
Input
14 2 6
aBcdEFGHIJklMn
Output
0
Input
9 2 2
aAaAAAaaA
Output
1
Submitted Solution:
```
s = input()
_,k,l = [int(ss) for ss in s.split()]
s = input()
abc = "abcdefghijklmnopqrstuvwxyz"
b = [0 if ss in abc else 1 for ss in s]
cnt = 0
arr = []
for bb in b:
if bb == 0:
cnt += 1
else:
if cnt > 0:
arr.append(cnt)
cnt = 0
else:
if cnt > 0:
arr.append(cnt)
cnt = 0
arr = sorted(arr)[::-1]
res = sum(b)
for i,_ in enumerate(arr):
while arr[i] > l and l > 0:
res += k
arr[i] -= k
l -= 1
res = len(b) - res - sum(arr[:l])
print(res)
``` | instruction | 0 | 95,390 | 18 | 190,780 |
No | output | 1 | 95,390 | 18 | 190,781 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vasya plays the LionAge II. He was bored of playing with a stupid computer, so he installed this popular MMORPG, to fight with his friends. Vasya came up with the name of his character — non-empty string s, consisting of a lowercase Latin letters. However, in order not to put up a front of friends, Vasya has decided to change no more than k letters of the character name so that the new name sounded as good as possible. Euphony of the line is defined as follows: for each pair of adjacent letters x and y (x immediately precedes y) the bonus c(x, y) is added to the result. Your task is to determine what the greatest Euphony can be obtained by changing at most k letters in the name of the Vasya's character.
Input
The first line contains character's name s and an integer number k (0 ≤ k ≤ 100). The length of the nonempty string s does not exceed 100. The second line contains an integer number n (0 ≤ n ≤ 676) — amount of pairs of letters, giving bonus to the euphony. The next n lines contain description of these pairs «x y c», which means that sequence xy gives bonus c (x, y — lowercase Latin letters, - 1000 ≤ c ≤ 1000). It is guaranteed that no pair x y mentioned twice in the input data.
Output
Output the only number — maximum possible euphony оf the new character's name.
Examples
Input
winner 4
4
s e 7
o s 8
l o 13
o o 8
Output
36
Input
abcdef 1
5
a b -10
b c 5
c d 5
d e 5
e f 5
Output
20
Note
In the first example the most euphony name will be looser. It is easy to calculate that its euphony is 36.
Submitted Solution:
```
import string
s, k = input().split()
max_changes = int(k)
len_s = len(s)
alpha = string.ascii_lowercase
bonuses = { ch: { ch: 0 for ch in alpha } for ch in alpha }
for i in range(int(input())):
a, b, x = input().split()
bonuses[a][b] = int(x)
def improve(current, changed, a, b, score):
if b not in current[changed] or current[changed][b] < score:
current[changed][b] = score
#print('%c: current[%d][%c] <- %d' % (a, changed, b, score))
current = [ { s[0]: 0 }, { ch: 0 for ch in alpha } ]
for pos in range(1, len_s):
previous = current
len_current = min(len(previous) + 1, max_changes + 1)
current = [ {} for i in range(len_current) ]
for changed, scores in enumerate(previous):
for a, score in scores.items():
for b, bonus in bonuses[a].items():
if b == s[pos]:
if changed < len(current):
improve(current, changed, a, b, score + bonus)
elif changed + 1 < len(current):
improve(current, changed + 1, a, b, score + bonus)
best = 0
for changed, scores in enumerate(current):
for score in scores.values():
best = max(best, score)
print(best)
``` | instruction | 0 | 95,743 | 18 | 191,486 |
No | output | 1 | 95,743 | 18 | 191,487 |
Provide a correct Python 3 solution for this coding contest problem.
As a New Year's gift, Dolphin received a string s of length 19.
The string s has the following format: `[five lowercase English letters],[seven lowercase English letters],[five lowercase English letters]`.
Dolphin wants to convert the comma-separated string s into a space-separated string.
Write a program to perform the conversion for him.
Constraints
* The length of s is 19.
* The sixth and fourteenth characters in s are `,`.
* The other characters in s are lowercase English letters.
Input
The input is given from Standard Input in the following format:
s
Output
Print the string after the conversion.
Examples
Input
happy,newyear,enjoy
Output
happy newyear enjoy
Input
haiku,atcoder,tasks
Output
haiku atcoder tasks
Input
abcde,fghihgf,edcba
Output
abcde fghihgf edcba | instruction | 0 | 95,950 | 18 | 191,900 |
"Correct Solution:
```
A, B, C = input().split(",")
print(A, B, C)
``` | output | 1 | 95,950 | 18 | 191,901 |
Provide a correct Python 3 solution for this coding contest problem.
As a New Year's gift, Dolphin received a string s of length 19.
The string s has the following format: `[five lowercase English letters],[seven lowercase English letters],[five lowercase English letters]`.
Dolphin wants to convert the comma-separated string s into a space-separated string.
Write a program to perform the conversion for him.
Constraints
* The length of s is 19.
* The sixth and fourteenth characters in s are `,`.
* The other characters in s are lowercase English letters.
Input
The input is given from Standard Input in the following format:
s
Output
Print the string after the conversion.
Examples
Input
happy,newyear,enjoy
Output
happy newyear enjoy
Input
haiku,atcoder,tasks
Output
haiku atcoder tasks
Input
abcde,fghihgf,edcba
Output
abcde fghihgf edcba | instruction | 0 | 95,951 | 18 | 191,902 |
"Correct Solution:
```
s = input().replace(',',' ')
print(s)
``` | output | 1 | 95,951 | 18 | 191,903 |
Provide a correct Python 3 solution for this coding contest problem.
As a New Year's gift, Dolphin received a string s of length 19.
The string s has the following format: `[five lowercase English letters],[seven lowercase English letters],[five lowercase English letters]`.
Dolphin wants to convert the comma-separated string s into a space-separated string.
Write a program to perform the conversion for him.
Constraints
* The length of s is 19.
* The sixth and fourteenth characters in s are `,`.
* The other characters in s are lowercase English letters.
Input
The input is given from Standard Input in the following format:
s
Output
Print the string after the conversion.
Examples
Input
happy,newyear,enjoy
Output
happy newyear enjoy
Input
haiku,atcoder,tasks
Output
haiku atcoder tasks
Input
abcde,fghihgf,edcba
Output
abcde fghihgf edcba | instruction | 0 | 95,952 | 18 | 191,904 |
"Correct Solution:
```
s=input()
s_2=s.replace(",", " ")
print(s_2)
``` | output | 1 | 95,952 | 18 | 191,905 |
Provide a correct Python 3 solution for this coding contest problem.
As a New Year's gift, Dolphin received a string s of length 19.
The string s has the following format: `[five lowercase English letters],[seven lowercase English letters],[five lowercase English letters]`.
Dolphin wants to convert the comma-separated string s into a space-separated string.
Write a program to perform the conversion for him.
Constraints
* The length of s is 19.
* The sixth and fourteenth characters in s are `,`.
* The other characters in s are lowercase English letters.
Input
The input is given from Standard Input in the following format:
s
Output
Print the string after the conversion.
Examples
Input
happy,newyear,enjoy
Output
happy newyear enjoy
Input
haiku,atcoder,tasks
Output
haiku atcoder tasks
Input
abcde,fghihgf,edcba
Output
abcde fghihgf edcba | instruction | 0 | 95,953 | 18 | 191,906 |
"Correct Solution:
```
a=input().split(",")
print(" ".join(a))
``` | output | 1 | 95,953 | 18 | 191,907 |
Provide a correct Python 3 solution for this coding contest problem.
As a New Year's gift, Dolphin received a string s of length 19.
The string s has the following format: `[five lowercase English letters],[seven lowercase English letters],[five lowercase English letters]`.
Dolphin wants to convert the comma-separated string s into a space-separated string.
Write a program to perform the conversion for him.
Constraints
* The length of s is 19.
* The sixth and fourteenth characters in s are `,`.
* The other characters in s are lowercase English letters.
Input
The input is given from Standard Input in the following format:
s
Output
Print the string after the conversion.
Examples
Input
happy,newyear,enjoy
Output
happy newyear enjoy
Input
haiku,atcoder,tasks
Output
haiku atcoder tasks
Input
abcde,fghihgf,edcba
Output
abcde fghihgf edcba | instruction | 0 | 95,954 | 18 | 191,908 |
"Correct Solution:
```
L = input().split(',')
print(' '.join(L))
``` | output | 1 | 95,954 | 18 | 191,909 |
Provide a correct Python 3 solution for this coding contest problem.
As a New Year's gift, Dolphin received a string s of length 19.
The string s has the following format: `[five lowercase English letters],[seven lowercase English letters],[five lowercase English letters]`.
Dolphin wants to convert the comma-separated string s into a space-separated string.
Write a program to perform the conversion for him.
Constraints
* The length of s is 19.
* The sixth and fourteenth characters in s are `,`.
* The other characters in s are lowercase English letters.
Input
The input is given from Standard Input in the following format:
s
Output
Print the string after the conversion.
Examples
Input
happy,newyear,enjoy
Output
happy newyear enjoy
Input
haiku,atcoder,tasks
Output
haiku atcoder tasks
Input
abcde,fghihgf,edcba
Output
abcde fghihgf edcba | instruction | 0 | 95,955 | 18 | 191,910 |
"Correct Solution:
```
a,b,c = input().split(sep=",")
print(a,b,c)
``` | output | 1 | 95,955 | 18 | 191,911 |
Provide a correct Python 3 solution for this coding contest problem.
As a New Year's gift, Dolphin received a string s of length 19.
The string s has the following format: `[five lowercase English letters],[seven lowercase English letters],[five lowercase English letters]`.
Dolphin wants to convert the comma-separated string s into a space-separated string.
Write a program to perform the conversion for him.
Constraints
* The length of s is 19.
* The sixth and fourteenth characters in s are `,`.
* The other characters in s are lowercase English letters.
Input
The input is given from Standard Input in the following format:
s
Output
Print the string after the conversion.
Examples
Input
happy,newyear,enjoy
Output
happy newyear enjoy
Input
haiku,atcoder,tasks
Output
haiku atcoder tasks
Input
abcde,fghihgf,edcba
Output
abcde fghihgf edcba | instruction | 0 | 95,956 | 18 | 191,912 |
"Correct Solution:
```
S = input().split(',')
print(*S,sep=' ')
``` | output | 1 | 95,956 | 18 | 191,913 |
Provide a correct Python 3 solution for this coding contest problem.
As a New Year's gift, Dolphin received a string s of length 19.
The string s has the following format: `[five lowercase English letters],[seven lowercase English letters],[five lowercase English letters]`.
Dolphin wants to convert the comma-separated string s into a space-separated string.
Write a program to perform the conversion for him.
Constraints
* The length of s is 19.
* The sixth and fourteenth characters in s are `,`.
* The other characters in s are lowercase English letters.
Input
The input is given from Standard Input in the following format:
s
Output
Print the string after the conversion.
Examples
Input
happy,newyear,enjoy
Output
happy newyear enjoy
Input
haiku,atcoder,tasks
Output
haiku atcoder tasks
Input
abcde,fghihgf,edcba
Output
abcde fghihgf edcba | instruction | 0 | 95,957 | 18 | 191,914 |
"Correct Solution:
```
s=input()
print(s[0:5],s[6:13],s[14:19])
``` | output | 1 | 95,957 | 18 | 191,915 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As a New Year's gift, Dolphin received a string s of length 19.
The string s has the following format: `[five lowercase English letters],[seven lowercase English letters],[five lowercase English letters]`.
Dolphin wants to convert the comma-separated string s into a space-separated string.
Write a program to perform the conversion for him.
Constraints
* The length of s is 19.
* The sixth and fourteenth characters in s are `,`.
* The other characters in s are lowercase English letters.
Input
The input is given from Standard Input in the following format:
s
Output
Print the string after the conversion.
Examples
Input
happy,newyear,enjoy
Output
happy newyear enjoy
Input
haiku,atcoder,tasks
Output
haiku atcoder tasks
Input
abcde,fghihgf,edcba
Output
abcde fghihgf edcba
Submitted Solution:
```
s = str(input())
print(s.replace(",", " "))
``` | instruction | 0 | 95,958 | 18 | 191,916 |
Yes | output | 1 | 95,958 | 18 | 191,917 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As a New Year's gift, Dolphin received a string s of length 19.
The string s has the following format: `[five lowercase English letters],[seven lowercase English letters],[five lowercase English letters]`.
Dolphin wants to convert the comma-separated string s into a space-separated string.
Write a program to perform the conversion for him.
Constraints
* The length of s is 19.
* The sixth and fourteenth characters in s are `,`.
* The other characters in s are lowercase English letters.
Input
The input is given from Standard Input in the following format:
s
Output
Print the string after the conversion.
Examples
Input
happy,newyear,enjoy
Output
happy newyear enjoy
Input
haiku,atcoder,tasks
Output
haiku atcoder tasks
Input
abcde,fghihgf,edcba
Output
abcde fghihgf edcba
Submitted Solution:
```
S = input()
print(S[:5], S[6:13], S[14:])
``` | instruction | 0 | 95,959 | 18 | 191,918 |
Yes | output | 1 | 95,959 | 18 | 191,919 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As a New Year's gift, Dolphin received a string s of length 19.
The string s has the following format: `[five lowercase English letters],[seven lowercase English letters],[five lowercase English letters]`.
Dolphin wants to convert the comma-separated string s into a space-separated string.
Write a program to perform the conversion for him.
Constraints
* The length of s is 19.
* The sixth and fourteenth characters in s are `,`.
* The other characters in s are lowercase English letters.
Input
The input is given from Standard Input in the following format:
s
Output
Print the string after the conversion.
Examples
Input
happy,newyear,enjoy
Output
happy newyear enjoy
Input
haiku,atcoder,tasks
Output
haiku atcoder tasks
Input
abcde,fghihgf,edcba
Output
abcde fghihgf edcba
Submitted Solution:
```
s = input().replace(',', ' ', 2)
print(s)
``` | instruction | 0 | 95,960 | 18 | 191,920 |
Yes | output | 1 | 95,960 | 18 | 191,921 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As a New Year's gift, Dolphin received a string s of length 19.
The string s has the following format: `[five lowercase English letters],[seven lowercase English letters],[five lowercase English letters]`.
Dolphin wants to convert the comma-separated string s into a space-separated string.
Write a program to perform the conversion for him.
Constraints
* The length of s is 19.
* The sixth and fourteenth characters in s are `,`.
* The other characters in s are lowercase English letters.
Input
The input is given from Standard Input in the following format:
s
Output
Print the string after the conversion.
Examples
Input
happy,newyear,enjoy
Output
happy newyear enjoy
Input
haiku,atcoder,tasks
Output
haiku atcoder tasks
Input
abcde,fghihgf,edcba
Output
abcde fghihgf edcba
Submitted Solution:
```
a = input()
A = a.replace(","," ")
print(A)
``` | instruction | 0 | 95,961 | 18 | 191,922 |
Yes | output | 1 | 95,961 | 18 | 191,923 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As a New Year's gift, Dolphin received a string s of length 19.
The string s has the following format: `[five lowercase English letters],[seven lowercase English letters],[five lowercase English letters]`.
Dolphin wants to convert the comma-separated string s into a space-separated string.
Write a program to perform the conversion for him.
Constraints
* The length of s is 19.
* The sixth and fourteenth characters in s are `,`.
* The other characters in s are lowercase English letters.
Input
The input is given from Standard Input in the following format:
s
Output
Print the string after the conversion.
Examples
Input
happy,newyear,enjoy
Output
happy newyear enjoy
Input
haiku,atcoder,tasks
Output
haiku atcoder tasks
Input
abcde,fghihgf,edcba
Output
abcde fghihgf edcba
Submitted Solution:
```
s = input()
print(s.replace(' ', ','))
``` | instruction | 0 | 95,962 | 18 | 191,924 |
No | output | 1 | 95,962 | 18 | 191,925 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As a New Year's gift, Dolphin received a string s of length 19.
The string s has the following format: `[five lowercase English letters],[seven lowercase English letters],[five lowercase English letters]`.
Dolphin wants to convert the comma-separated string s into a space-separated string.
Write a program to perform the conversion for him.
Constraints
* The length of s is 19.
* The sixth and fourteenth characters in s are `,`.
* The other characters in s are lowercase English letters.
Input
The input is given from Standard Input in the following format:
s
Output
Print the string after the conversion.
Examples
Input
happy,newyear,enjoy
Output
happy newyear enjoy
Input
haiku,atcoder,tasks
Output
haiku atcoder tasks
Input
abcde,fghihgf,edcba
Output
abcde fghihgf edcba
Submitted Solution:
```
[a, b] = map(int, input().split())
if a*3==b:
print(1)
elif b%3==0:
print(b*3+1)
else:
print(b*3)
``` | instruction | 0 | 95,963 | 18 | 191,926 |
No | output | 1 | 95,963 | 18 | 191,927 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As a New Year's gift, Dolphin received a string s of length 19.
The string s has the following format: `[five lowercase English letters],[seven lowercase English letters],[five lowercase English letters]`.
Dolphin wants to convert the comma-separated string s into a space-separated string.
Write a program to perform the conversion for him.
Constraints
* The length of s is 19.
* The sixth and fourteenth characters in s are `,`.
* The other characters in s are lowercase English letters.
Input
The input is given from Standard Input in the following format:
s
Output
Print the string after the conversion.
Examples
Input
happy,newyear,enjoy
Output
happy newyear enjoy
Input
haiku,atcoder,tasks
Output
haiku atcoder tasks
Input
abcde,fghihgf,edcba
Output
abcde fghihgf edcba
Submitted Solution:
```
def check(x, y, K, S):
if x + y > S:
return False
for z in range(K+1):
if x + y + z == S:
return True
return False
K, S = list(map(int, input('').split()))
count = 0
for x in range(K+1):
for y in range(K+1):
if check(x, y, K, S):
count += 1
print(count)
``` | instruction | 0 | 95,964 | 18 | 191,928 |
No | output | 1 | 95,964 | 18 | 191,929 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As a New Year's gift, Dolphin received a string s of length 19.
The string s has the following format: `[five lowercase English letters],[seven lowercase English letters],[five lowercase English letters]`.
Dolphin wants to convert the comma-separated string s into a space-separated string.
Write a program to perform the conversion for him.
Constraints
* The length of s is 19.
* The sixth and fourteenth characters in s are `,`.
* The other characters in s are lowercase English letters.
Input
The input is given from Standard Input in the following format:
s
Output
Print the string after the conversion.
Examples
Input
happy,newyear,enjoy
Output
happy newyear enjoy
Input
haiku,atcoder,tasks
Output
haiku atcoder tasks
Input
abcde,fghihgf,edcba
Output
abcde fghihgf edcba
Submitted Solution:
```
a = input()
a[5] = " "
a[13] = " "
print(a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8]+a[9]+a[10]+a[11]+a[12]+a[13]+a[14]+a[15]+a[16]+a[17]+a[18])
``` | instruction | 0 | 95,965 | 18 | 191,930 |
No | output | 1 | 95,965 | 18 | 191,931 |
Provide a correct Python 3 solution for this coding contest problem.
For a dictionary $M$ that stores elements formed by a pair of a string key and an integer value, perform a sequence of the following operations. Note that each key in $M$ must be unique.
* insert($key$, $x$): Insert an element formed by a pair of $key$ and $x$ to $M$. If there is an element with $key$, replace the corresponding value with $x$.
* get($key$): Print the value with the specified $key$.
Constraints
* $1 \leq q \leq 200,000$
* $1 \leq x \leq 1,000,000,000$
* $1 \leq $ length of $key$ $ \leq 20$
* $key$ consits of lower-case letter
* For a get operation, the element with the specified key exists in $M$.
Input
The input is given in the following format.
$q$
$query_1$
$query_2$
:
$query_q$
Each query $query_i$ is given by
0 $key$ $x$
or
1 $key$
where the first digits 0, 1 and 2 represent insert and get operations respectively.
Output
For each get operation, print an integer in a line.
Example
Input
7
0 blue 4
0 red 1
0 white 5
1 red
1 blue
0 black 8
1 black
Output
1
4
8 | instruction | 0 | 96,065 | 18 | 192,130 |
"Correct Solution:
```
#空の辞書作成と標準入力
di = {}
for _ in range(int(input())):
line = input().split()
#リストの0番目が0なら辞書に追加する1なら出力する
if line[0] == "0":di[line[1]] = line[2]
else:print(di[line[1]])
``` | output | 1 | 96,065 | 18 | 192,131 |
Provide tags and a correct Python 3 solution for this coding contest problem.
HQ9+ is a joke programming language which has only four one-character instructions:
* "H" prints "Hello, World!",
* "Q" prints the source code of the program itself,
* "9" prints the lyrics of "99 Bottles of Beer" song,
* "+" increments the value stored in the internal accumulator.
Instructions "H" and "Q" are case-sensitive and must be uppercase. The characters of the program which are not instructions are ignored.
You are given a program written in HQ9+. You have to figure out whether executing this program will produce any output.
Input
The input will consist of a single line p which will give a program in HQ9+. String p will contain between 1 and 100 characters, inclusive. ASCII-code of each character of p will be between 33 (exclamation mark) and 126 (tilde), inclusive.
Output
Output "YES", if executing the program will produce any output, and "NO" otherwise.
Examples
Input
Hi!
Output
YES
Input
Codeforces
Output
NO
Note
In the first case the program contains only one instruction — "H", which prints "Hello, World!".
In the second case none of the program characters are language instructions. | instruction | 0 | 96,261 | 18 | 192,522 |
Tags: implementation
Correct Solution:
```
s = input()
for i in s:
if i in ['H','Q','9']:
print("YES")
break
else:
print("NO")
``` | output | 1 | 96,261 | 18 | 192,523 |
Provide tags and a correct Python 3 solution for this coding contest problem.
HQ9+ is a joke programming language which has only four one-character instructions:
* "H" prints "Hello, World!",
* "Q" prints the source code of the program itself,
* "9" prints the lyrics of "99 Bottles of Beer" song,
* "+" increments the value stored in the internal accumulator.
Instructions "H" and "Q" are case-sensitive and must be uppercase. The characters of the program which are not instructions are ignored.
You are given a program written in HQ9+. You have to figure out whether executing this program will produce any output.
Input
The input will consist of a single line p which will give a program in HQ9+. String p will contain between 1 and 100 characters, inclusive. ASCII-code of each character of p will be between 33 (exclamation mark) and 126 (tilde), inclusive.
Output
Output "YES", if executing the program will produce any output, and "NO" otherwise.
Examples
Input
Hi!
Output
YES
Input
Codeforces
Output
NO
Note
In the first case the program contains only one instruction — "H", which prints "Hello, World!".
In the second case none of the program characters are language instructions. | instruction | 0 | 96,263 | 18 | 192,526 |
Tags: implementation
Correct Solution:
```
s=input()
if any(i in "HQ9" for i in s):
print('YES')
else:
print('NO')
``` | output | 1 | 96,263 | 18 | 192,527 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.