submission_id string | problem_id string | status string | code string | input string | output string | problem_description string |
|---|---|---|---|---|---|---|
s267713089 | p00029 | Wrong Answer | # -*- coding: utf-8 -*-
ls = []
dic = {}# {'your' : [appeared,len]}
ls = raw_input().split()
for k in range(len(ls)):
if ls[k] not in dic.keys():
dic[ls[k]] = []
dic[ls[k]].append(1)
dic[ls[k]].append(len(ls[k]))
else:
dic[ls[k]][0] += 1
a=max(dic) # value[0]
b=max(dic.items(), key=lambda x: x[1][1])[0]
print "%s %s" % (a,b) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s145964554 | p00029 | Wrong Answer | ls = raw_input().split()
dic = {}
for word in ls:
dic[word] = dic.get(word,0) + 1
max1 = sorted(dic.items(), key=lambda x:x[1], reverse=True)
max2 = ""
for i in ls:
if len(max2) < i:
max2 = i
print max1[0][0] + " " + max2 | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s623091953 | p00029 | Wrong Answer |
while 1:
try:
ls = raw_input().split()
dic = {}
for word in ls:
dic[word] = dic.get(word,0) + 1
max1 = sorted(dic.items(), key=lambda x:x[1], reverse=True)
max2 = ""
for i in ls:
if len(max2) < i:
max2 = i
print max1[0][0] + " " + max2
except:
exit() | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s209369487 | p00029 | Wrong Answer | import sys
import math
from collections import Counter
l = raw_input().split()
print l
c = Counter()
for i in l:
c[i] += 1
cc = c.most_common(1)
ans = l[0]
for i in range(len(l)):
if len(l[i]) > len(ans):
ans = l[i]
print "{0} {1}".format(cc[0][0], ans) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s766585439 | p00029 | Wrong Answer | S = raw_input().split()
maxi = 0
for s in S:
length = len(s)
if (length > maxi):
maxi = length
maxs = s
S.sort()
i = 0
maxm = 0
mode = 0
while (i < len(S) - 1):
cnt = 1
while True:
if (S[i] == S[i + 1]):
i += 1
cnt += 1
if (i >= len(S) - 1):
break
else:
break
if (cnt > maxm):
maxm = cnt
mode = i
i += 1
print maxs, S[mode] | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s785469795 | p00029 | Wrong Answer | a=str(raw_input()).split(" ")
b=set(a)
c,d=[0,""],""
for i in b:
if len(i)>len(d): d=i
if a.count(i)>c[0]:c[1]=i
print(c[1]+" "+d) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s976501187 | p00029 | Wrong Answer | s=raw_input().split()
maxlen=""
for i in s:
if len(maxlen)<len(i):
maxlen=i
print max(s),maxlen | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s073616476 | p00029 | Wrong Answer | # -*- coding: utf-8 -*-
from collections import defaultdict
d = defaultdict(int)
_input = input()
sentence = [e for e in _input.split()]
l = []
for word in sentence:
d[word] += 1
times = sorted(d.items(), key=lambda item: item[1], reverse=True)
lengths = sorted(d.items(), key=lambda item: len(item[0]), reverse=True)
print(times[0][1], end=' ')
print(lengths[0][0]) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s054781635 | p00029 | Wrong Answer | targ = input().split(' ')
mostfre = {}
ansfre = ""
longest = [0,""]
for t in targ:
if len(t) > longest[0]:
longest[0],longest[1] = len(t),t
mostfre[t] = mostfre.get(t,0) + 1
temp = 0
print(mostfre)
for k,v in mostfre.items():
if v > temp:
temp = v
ansfre = k
print(ansfre + ' ' + longest[1]) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s679181408 | p00029 | Wrong Answer | text = input().split()
print(max(text), max(text, key=len)) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s035940664 | p00029 | Wrong Answer | s=input().split()
dict={}
max=""
max_num=0
max_index=""
for i in s:
if i in dict:
dict[i]+=1
if max_num<dict[i]:
max_index=i
else: dict[i]=0
if len(i)>len(max):
max=i
print(max_index,max) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s672126626 | p00029 | Wrong Answer | import sys
from collections import Counter
if __name__ == '__main__':
# ??????????????\???
# line = 'Thank you for your mail and your lectures'
data = []
for line in sys.stdin:
data = line.strip().lower().split(' ')
print(data)
# ??????????¢??????????
c = Counter(data) # ????????????????¢????
most_frequent_word = c.most_common(1)[0][0]
# ???????????????????????¢???
max_length_word = ''
for w, freq in c.most_common():
if len(w) > len(max_length_word):
max_length_word = w
# ???????????¨???
print('{0} {1}'.format(most_frequent_word, max_length_word)) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s836606843 | p00029 | Wrong Answer | # -*- coding:utf-8 -*-
string = list(str(input()).split(' '))
l = [0]*len(string)
k = 0
for i in range(len(string)):
if len(string[i]) > k:
k = i
for j in range(len(string)):
if string[i] == string[j]:
l[i] += 1
m = l.index(max(l))
print(string[m],string[k],sep = ' ') | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s370176878 | p00029 | Wrong Answer | memo = {}
many, length = '', ''
max_val, max_len = 0, 0
word = input().split()
for _ in word :
if _ in memo :
memo[_] = memo[_] + 1
if max_val < memo[_] :
max_val == memo[_]
many = _
else :
memo[_] = 1
if max_len < len(_) :
max_len = len(_)
length = _
print(many, length) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s722934035 | p00029 | Wrong Answer | s = list(input().split())
maxLen = 0
maxNum = 0
dic = {}
for word in s:
if not (word in dic):
dic[word] = 1
else:
dic[word] += 1
if maxNum < dic[word]:
maxNum = dic[word]
ansNum = word
if maxLen < len(word):
ansLen = word
print(ansNum, ansLen) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s684051997 | p00029 | Wrong Answer | s = list(input().split())
maxLen = 0
maxNum = 0
dic = {}
for word in s:
if not (word in dic):
dic[word] = 1
else:
dic[word] += 1
if maxNum < dic[word]:
maxNum = dic[word]
ansNum = word
if maxLen < len(word):
maxLen = len(word)
ansLen = word
print(ansNum, ansLen)
print(dic) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s075543177 | p00029 | Wrong Answer | import sys
def main():
input_line = []
# with open('test_data') as f:
# for line in f.readline().split():
# input_line.append(line)
for line in sys.stdin.readline().split():
input_line.append(line)
#print(input_line)
if __name__ == '__main__':
main() | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s138085925 | p00029 | Wrong Answer | from collections import Counter
x=input().split()
x_len=[len(i) for i in x ]
counter=Counter(x)
for i in range(len(x)):
if max(x_len)==x_len[i]:
print(max(counter),x[i]) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s484536857 | p00029 | Wrong Answer | dic={}
for word in raw_input().split():
if word not in dic:
dic[word]=0
dic[word]+=1
print max(dic.iterkeys(),key=lambda k:dic[k])
print max(dic.iterkeys(),key= lambda k:len(k)) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s778485495 | p00029 | Wrong Answer | word_d={}
for word in raw_input().split():
word_d[word]=word_d.get(word,0)+1
print max(word_d.iterkeys(), key=lambda i: [i]),max(word_d.iterkeys(),key=lambda i:len(i)) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s731027927 | p00029 | Wrong Answer | dic={}
s=raw_input().lower().split()
for word in s:
try:
dic[word]+=1
except:
dic[word]=1
m=0
l=0
for word, e in dic.items():
if len(word)>l:
l=len(word)
w1=word
if e>m:
m=e
w2=word
print w1, w2 | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s941255770 | p00029 | Wrong Answer | dic={}
s=raw_input().lower().split()
print s
for word in s:
try:
dic[word]+=1
except:
dic[word]=1
m=0
l=0
for word, e in dic.items():
if e>m:
m=e
w1=word
if len(word)>l:
l=len(word)
w2=word
print w1, w2 | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s314084000 | p00029 | Wrong Answer | data = raw_input().strip().split()
stat = {}
for w in data:
if w in stat:
stat[w][0] += 1
else:
stat[w] = [1, len(w)]
count_list = sorted(stat.items(), key=lambda x: x[1][0], reverse=True)
length_list = sorted(stat.items(), key=lambda x: x[1][1], reverse=True)
print count_list[0][0]
print length_list[0][0] | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s986918406 | p00029 | Accepted | from collections import Counter
s = input().split()
po = Counter(s)
s.sort(reverse=True,key=lambda x:len(x))
print(po.most_common()[0][0],s[0])
| Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s319878285 | p00029 | Accepted | # coding: utf-8
# Your code here!
a = raw_input().lower()
a = " "+a+" "
s = a.split()
ss = ""
tmp = ""
n = 0
for i in s:
if len(ss) < len(i):
ss = i
for i in s:
i = " " + i + " "
if a.count(i) > n:
n = a.count(i)
tmp = i.strip()
print tmp, ss
| Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s573857725 | p00029 | Accepted | li = input().split()
m = (li[0], 0)
l = (li[0], len(li[0]))
for s in set(li):
if li.count(s) > m[1]: m = (s, li.count(s))
if l[1] < len(s): l = (s, len(s))
print(m[0], l[0])
| Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s543971938 | p00029 | Accepted | ns=list(map(str,input().split()))
mp={}
for n in ns:
if n in mp:
mp[n] +=1
else:
mp[n]=1
long_word=""
freq_word=""
max_len=0
max_fre=0
for k,v in mp.items():
if max_len<len(k):
max_len=len(k)
long_word=k
if max_fre<v:
max_fre=v
fre_word=k
print(fre_word, long_word)
| Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s086206917 | p00029 | Accepted |
words = raw_input().strip().split(" ")
count = {};
for word in words:
s = count.setdefault(word, 0);
count[word] = s + 1
print max(count.items(), key=lambda x: x[1])[0], max(words, key=lambda x: len(x)) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s161677637 | p00029 | Accepted | s = raw_input().split()
maxLength = 0
word1 = ""
word2 = ""
count = {}
maxCount = 0
for i in range(len(s)):
count[s[i]] = 0
for i in range(len(s)):
count[s[i]] += 1
if(len(s[i]) > maxLength):
maxLength = len(s[i])
word2 = s[i]
for i in range(len(s)):
if(count[s[i]] > maxCount):
maxCount = count[s[i]]
word1 = s[i]
print(word1),
print(word2) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s423754575 | p00029 | Accepted | #!/usr/bin/env python
# -*- coding: utf-8 -*-
a = raw_input()
b = a.split()
c = [ i.lower() for i in b ]
e = {}
h = {}
for d in c:
if d not in e:
h[d] = len(d)
e[d] = 1
else:
e[d] += 1
f = [ (v,k) for k,v in e.items() ]
f.sort()
f.reverse()
maxnum = f[0][0]
for g in f:
if g[0] != maxnum:
break
print g[1],
i = [ (v,k) for k,v in h.items() ]
i.sort()
i.reverse()
maxnum = i[0][0]
for j in i:
if j[0] != maxnum:
break
print j[1], | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s169920017 | p00029 | Accepted | # coding: utf-8
# Here your code !
l = input().split()
len_m = 0
for e in l:
if len_m < len(e):
len_m = len(e)
a1 = e
d = {}
for e in l:
if e not in d:
d.update({
e: 1
})
else:
t = d[e]
d.update({
e: (t+1)
})
print('%s %s' % (max(d.items(), key=lambda x: x[1])[0],a1)) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s431469173 | p00029 | Accepted | import collections
c = collections.Counter(input().split())
longest = ''
for word in c:
if len(longest) < len(word):
longest = word
print(c.most_common(1)[0][0], longest) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s726399015 | p00029 | Accepted |
wordlist = []
wordlist = raw_input().split()
dic = {}
longest = ['',0]
m = 0
for word in wordlist:
# mode
if word not in dic:
dic[word] = 1
else:
dic[word] += 1
# word_length
if m == 0:
longest[0] = word
longest[1] = len(word)
m += 1
else:
if len(word) > longest[1]:
longest[0] = word
longest[1] = len(word)
mode_key = sorted(dic.items(),key = lambda x:x[1],reverse=True)[0][0]
print '%s %s' % (mode_key,longest[0]) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s817575084 | p00029 | Accepted | L=raw_input().split(" ")
count={}
length={}
while len(L)!=0:
word=L.pop(0).lower()
if word in count:
count[word]+=1
else:
count[word]=1
length[word]=len(word)
most=max(count.values())
long=max(length.values())
print [k1 for k1 in count if count[k1]==most].pop(0),
print [k2 for k2 in length if length[k2]==long].pop(0) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s624735456 | p00029 | Accepted |
while 1:
try:
ls = raw_input().split()
dic = {}
for word in ls:
dic[word] = dic.get(word,0) + 1
max1 = sorted(dic.items(), key=lambda x:x[1], reverse=True)
max2 = ""
for i in ls:
if len(max2) < len(i):
max2 = i
print max1[0][0] + " " + max2
except:
exit() | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s760426593 | p00029 | Accepted | s=raw_input().split()
c={}
for l in s:c[l]=c.get(l,0)+1
print sorted(c.items(),key=lambda x:x[1])[-1][0],max(s,key=len) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s831742390 | p00029 | Accepted | string_lis = raw_input().split()
dic = {}
max_len = ''
for string in string_lis:
if not string in dic:
dic[string] = 1
else:
dic[string] = dic[string] + 1
if len(max_len) == 0:
max_len = string
elif len(max_len) < len(string):
max_len = string
max_count = sorted(dic.items(), key=lambda x: x[1], reverse=True)[0][0]
print max_count, max_len | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s600898868 | p00029 | Accepted | import sys
import math
from collections import Counter
l = raw_input().split()
c = Counter()
for i in l:
c[i] += 1
cc = c.most_common(1)
ans = l[0]
for i in range(len(l)):
if len(l[i]) > len(ans):
ans = l[i]
print "{0} {1}".format(cc[0][0], ans) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s488506623 | p00029 | Accepted | words = list(map(str, input().strip().split()))
lenAndWords = [0, '']
modeWords = {}
mode = [0, '']
for s in words:
if len(s) > lenAndWords[0]:
lenAndWords[0] = len(s)
lenAndWords[1] = s
if not s in modeWords:
d = {s:0}
modeWords.update(d)
else:
modeWords[s] += 1
if mode[0] < modeWords[s]:
mode[0] = modeWords[s]
mode[1] = s
print(mode[1], lenAndWords[1]) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s329470463 | p00029 | Accepted | S = raw_input().split()
maxi = 0
for s in S:
length = len(s)
if (length > maxi):
maxi = length
maxs = s
S.sort()
i = 0
maxm = 0
mode = 0
while (i < len(S) - 1):
cnt = 1
while True:
if (S[i] == S[i + 1]):
i += 1
cnt += 1
if (i >= len(S) - 1):
break
else:
break
if (cnt > maxm):
maxm = cnt
mode = i
i += 1
print S[mode], maxs | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s270906239 | p00029 | Accepted | l=map(str,raw_input().split())
cnt={}
w=ans=""
for i in l:
if len(i)>len(w):
w=i
if cnt.has_key(i):
cnt[i]+=1
else:
cnt[i]=1
t=0
for i in cnt:
if cnt[i]>t:
t=cnt[i]
ans=i
print ans,w | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s901297713 | p00029 | Accepted | # -*- coding:utf-8 -*-
def main():
LIST=[]
while True:
try:
val=input().split()
LIST=[]
for v in val:
flag=True
for item in LIST:
if item[0]==v:
index=LIST.index(item)
flag=False
if flag:
LIST.append([v,1])
else:
LIST[index][1]+=1
longest=""
LIST=sorted(LIST,key=lambda x:x[1],reverse=True)
for i in LIST:
longest=i[0] if max(len(longest),len(i[0]))==len(i[0]) else longest
ans=LIST[0][0]
print("{0} {1}".format(ans,longest))
except:
break
if __name__ == '__main__':
main() | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s136888325 | p00029 | Accepted | x=input().split()
longestWord= ""
mostWord=0
currentCount=0
THEmostWord=""
for r in range (len(x)):
if len(x[r])> len(longestWord):
longestWord=x[r]
for j in range (len(x)):
thing= x[j]
currentCount=x.count(thing)
if currentCount > mostWord:
mostWord= currentCount
THEmostWord=thing
print(THEmostWord, longestWord) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s186215806 | p00029 | Accepted | s = input().split()
max_c = 0
max_l = 0
c = ''
l = ''
for i in s:
if s.count(i) > max_c:
max_c = s.count(i)
c = i
if len(i) > max_l:
max_l = len(i)
l = i
print(c+' '+l) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s406419404 | p00029 | Accepted | sentence=input()
list=[]
list=sentence.split()
c=[]
k=0
l=0
for i in range(len(list)):
c.append(0)
m=len(list[i])
if(m>k):
k=len(list[i])
max=list[i]
for i in range(len(list)):
for j in range(len(list)):
if(i!=j and list[i]==list[j]):
c[i]=c[i]+1
for i in range(len(c)):
if(c[i]>l):
l=i
print("%s %s"%(list[l],max)) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s432277754 | p00029 | Accepted | s=input()
a=s.split(" ")
mp={}
freq=""
longest=""
mx=0
for v in a:
#???????????°????????????
if v in mp:
mp[v]+=1
else:
mp[v]=1
if mx<mp[v]:
freq=v
mx=mp[v]
#?????????????????´??°
if len(longest)<len(v):
longest=v
print(freq,longest) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s307672575 | p00029 | Accepted | A=list(map(str,input().split()))
#print(A)
max_length=0
maximum_number_of_letters=""
max_cnt=0
frequent_word=""
for i in A:
if len(i)>max_length:
maximum_number_of_letters=i
max_length=len(i)
if A.count(i)>max_cnt:
frequent_word=i
max_cnt=A.count(i)
print(frequent_word,maximum_number_of_letters) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s540902925 | p00029 | Accepted | a=str(raw_input()).split(" ")
b=set(a)
c,d=[0,""],""
for i in b:
if len(i)>len(d): d=i
if a.count(i)>c[0]:
c[1]=i
c[0]=a.count(i)
print(c[1]+" "+d) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s639263893 | p00029 | Accepted | s = list(input().split())
a = [s.count(i) for i in s]
l = [len(i) for i in s]
print(s[a.index(max(a))], s[l.index(max(l))]) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s452017183 | p00029 | Accepted | s = input().split()
a = [s.count(i) for i in s]
l = [len(i) for i in s]
print(s[a.index(max(a))], s[l.index(max(l))]) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s379018076 | p00029 | Accepted | s = raw_input().split()
maxLength, maxCount = 0, 0
word1, word2, count = "", "", {}
for i in range(len(s)):
count[s[i]] = 0
for i in range(len(s)):
count[s[i]] += 1
if(len(s[i]) > maxLength):
maxLength = len(s[i])
word2 = s[i]
for i in range(len(s)):
if(count[s[i]] > maxCount):
maxCount = count[s[i]]
word1 = s[i]
print word1, word2 | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s501734855 | p00029 | Accepted | # -*- coding: utf-8 -*-
import sys
dic = {}
text = raw_input().split()
max_count = 0
max_length = 0
for i in text:
if i not in dic:
dic[i] = 1
else:
dic[i] += 1
for i in dic:
max_count = max(max_count, dic[i])
max_length = max(max_length, len(i))
for i in dic:
if max_count == dic[i]:
a = i
if max_length == len(i):
b = i
print "%s %s" %(a, b) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s149569007 | p00029 | Accepted | S = input()
W = S.split()
ws = {}
for w in W:
if not w in ws:
ws[w] = [1, len(w)]
else:
ws[w][0] += 1
print(max(ws.items(), key = lambda x: x[1][0])[0], max(ws.items(), key = lambda x: x[1][1])[0]) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s366322162 | p00029 | Accepted | s=raw_input().split()
maxlen=""
maxct=0
for i in s:
if len(maxlen)<len(i):
maxlen=i
if maxct<s.count(i):
maxct=s.count(i)
maxm=i
print maxm,maxlen | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s552771989 | p00029 | Accepted | st = input().split()
a = ""
b = {}
for s in st:
if len(s) > len(a): a = s
b[s] = b.get(s, 0) + 1
ls = sorted(b, key=b.get)[-1]
print(ls, a) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s342216741 | p00029 | Accepted | str = input().split()
mfw = ""
mlw = ""
maxF = 0
maxL = 0
for w in str:
if str.count(w) > maxF:
mfw = w
maxF = str.count(w)
if len(w) > maxL:
mlw = w
maxL = len(w)
print(mfw, mlw) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s066510785 | p00029 | Accepted | from collections import Counter
max_len = None
l = 0
counter = Counter(input().split())
for ci in counter:
if l < len(ci):
max_len = ci
l = len(ci)
print(counter.most_common(1)[0][0], max_len) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s045143891 | p00029 | Accepted | # -*- coding: utf-8 -*-
from collections import defaultdict
d = defaultdict(int)
_input = input()
for word in _input.split():
d[word] += 1
times = sorted(d.items(), key=lambda item: item[1], reverse=True)
lengths = sorted(d.items(), key=lambda item: len(item[0]), reverse=True)
print(times[0][0], end=' ')
print(lengths[0][0]) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s226760407 | p00029 | Accepted | l = input().split()
#print(l.count("your"))
hindo_max = 0
len_max = 0
for word in l:
if hindo_max < l.count(word):
hindo_max = l.count(word)
hindo_word = word
if len_max < len(word):
len_max = len(word)
len_word = word
print(hindo_word, len_word) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s556061271 | p00029 | Accepted | words = input().split(' ')
print(sorted(words, key=words.count)[-1], sorted(words, key=len)[-1]) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s658873792 | p00029 | Accepted | words = input().split()
print(max(words, key=words.count), max(words, key=len)) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s430956677 | p00029 | Accepted | w=input().split()
print(max(w,key=w.count),max(w,key=len)) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s957944925 | p00029 | Accepted | w = raw_input().split()
c, n = [], []
for i in w:
c.append(w.count(i))
n.append(len(i))
print w[c.index(max(c))] + " " + w[n.index(max(n))] | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s846666308 | p00029 | Accepted | targ = input().split(' ')
mostfre = {}
ansfre = ""
longest = [0,""]
for t in targ:
if len(t) > longest[0]:
longest[0],longest[1] = len(t),t
mostfre[t] = mostfre.get(t,0) + 1
temp = 0
for k,v in mostfre.items():
if v > temp:
temp = v
ansfre = k
print(ansfre + ' ' + longest[1]) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s841606831 | p00029 | Accepted | d = {}
m = 0
mw = ''
for w in raw_input().lower().split():
if w in d:
d[w] += 1
else:
d[w] = 1
if len(w) > m:
m = len(w)
mw = w
print max(d.keys(), key=lambda x:d[x]), mw
| Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s375209999 | p00029 | Accepted | text = input().split()
print(max(text, key=text.count), max(text, key=len)) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s227261879 | p00029 | Accepted | ns=list(map(str,input().split()))
mp={}
for n in ns:
if n in mp:
mp[n]=mp[n]+1
else:
mp[n]=1
long_word=''
freq_word=''
max_len=0
max_fre=0
for k,v in mp.items():
if max_len<len(k):
long_word=k
max_len=len(k)
if max_fre<v:
freq_word=k
max_fre=v
print(freq_word,long_word) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s381588251 | p00029 | Accepted | date = list(map(str,input().split()))
Num = 0
Size = 0
for tag in sorted(set(date), key=date.index):
if date.count(tag) > Num:
Num = date.count(tag)
Ooi = tag
if len(tag) > Size:
Size = len(tag)
Msiz = tag
print(Ooi,Msiz)
| Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s290192744 | p00029 | Accepted | s=input().split()
dict={}
max=""
max_num=0
max_index=""
for i in s:
if i in dict:
dict[i]+=1
if max_num<dict[i]:
max_index=i
max_num=dict[i]
else: dict[i]=0
if len(i)>len(max):
max=i
print(max_index,max) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s224035098 | p00029 | Accepted | import sys
from collections import Counter
if __name__ == '__main__':
# ??????????????\???
# line = 'Thank you for your mail and your lectures'
data = []
for line in sys.stdin:
data = line.strip().strip('.').lower().split(' ')
# print(data)
# ??????????¢??????????
c = Counter(data) # ????????????????¢????
most_frequent_word = c.most_common(1)[0][0]
# ???????????????????????¢???
max_length_word = ''
for w, freq in c.most_common():
if len(w) > len(max_length_word):
max_length_word = w
# ???????????¨???
print('{0} {1}'.format(most_frequent_word, max_length_word)) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s853129779 | p00029 | Accepted | text = [s for s in input().split()]
s_text = set(text)
a, b = 0, 0
for s in s_text:
if text.count(s) > a:
a = text.count(s)
x = s
if len(s) > b:
b = len(s)
y = s
print(x, y) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s736586331 | p00029 | Accepted | from collections import defaultdict as dd
a=dd(int)
freq=0
leng=""
seq=""
b=input().split()
for i in b:
a[i]+=1
if freq<a[i]:
freq=a[i]
seq=i
if len(leng)<len(i):
leng=i
print(seq,leng) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s355137848 | p00029 | Accepted | from collections import defaultdict as dd
a=dd(int)
freq=0
leng=""
seq=""
b=input().split()
for i in b:
a[i]+=1
if a[seq]<a[i]:
seq=i
if len(leng)<len(i):
leng=i
print(seq,leng) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s945589309 | p00029 | Accepted | from collections import defaultdict as dd
a=dd(int)
leng=""
seq=""
for i in input().split():
a[i]+=1
if a[seq]<a[i]:
seq=i
if len(leng)<len(i):
leng=i
print(seq,leng) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s363499542 | p00029 | Accepted | string = list(str(input()).split(' '))
l = [0]*len(string)
k = 0
r = 0
for i in range(len(string)):
if len(string[i]) > k:
k = len(string[i])
r = i
for j in range(len(string)):
if string[i] == string[j]:
l[i] += 1
m = l.index(max(l))
print(string[m],string[r],sep = ' ') | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s159029895 | p00029 | Accepted | s=input().split()
print(max(s,key=s.count),max(s,key=len)) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s951572065 | p00029 | Accepted | text = raw_input().rstrip()
words = text.split(" ")
d = {}
longest_word=""
frequency_word=""
max_count=0
for word in words:
if len(longest_word) < len(word):
longest_word = word
if d.has_key(word):
d[word] = d[word]+1
else:
d[word] = 1
if max_count < d[word]:
max_count = d[word]
frequency_word=word
print "{} {}".format(frequency_word, longest_word) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s558085114 | p00029 | Accepted | import sys
dic = {}
txt = sys.stdin.read().strip().split()
for t in txt:
if t in dic:
dic[t] += 1
else:
dic[t] = 1
s = sorted(dic.items(),key=lambda x:x[1],reverse=1)
fre = s[0][0]
t = sorted(dic.items(),key=lambda x:len(x[0]),reverse=1)
longest = t[0][0]
print("%s %s" % (fre,longest)) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s028533389 | p00029 | Accepted | S = list(map(str,input().split()))
frq = ""
mx = ""
for i in S:
if S.count(i) > S.count(frq):
frq = i
if len(i) > len(mx):
mx = i
print(frq,mx) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s441894641 | p00029 | Accepted | line = [i for i in input().split()]
a = 0
b = ""
c = 0
d = ""
for i in range(len(line)):
if i == 0:
a = line.count(line[i])
b = line[i]
c = len(line[i])
d = line[i]
elif line.count(line[i]) > a:
a = line.count(line[i])
b = line[i]
if len(line[i]) > c:
c = len(line[i])
d = line[i]
print(b+" "+d) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s535218358 | p00029 | Accepted | from collections import defaultdict
d = defaultdict(int)
w = ['']*32
for s in input().split():
d[s] += 1
w[len(s)-1] = s
l = sorted(((k, v) for k, v in d.items()), key=lambda x: -x[1])
print(l[0][0], next(s for s in w[::-1] if s)) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s898019371 | p00029 | Accepted | from collections import Counter
instr = input().split()
ctr = Counter(instr)
print(ctr.most_common(1)[0][0], end =" ")
ans = ""
for word in instr:
if len(word)>len(ans): ans = word
print(ans) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s713730663 | p00029 | Accepted | # -*- coding: utf-8 -*-
import sys
import os
import datetime
d = {}
words = input().split()
longest_word = ''
for word in words:
if len(word) > len(longest_word):
longest_word = word
if word not in d:
d[word] = 1
else:
d[word] += 1
max_value = max(d.values())
for key in d.keys():
if d[key] == max_value:
print(key, longest_word) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s834989708 | p00029 | Accepted | from collections import Counter
l = input().split()
print(Counter(l).most_common(1)[0][0], sorted(l, key=len)[-1]) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s549151591 | p00029 | Accepted | words = input().split()
word2count={}
maxlength = 0
maxlengthword=None
for word in words:
word2count[word] = word2count.get(word, 0) + 1
if maxlength < len(word):
maxlength = len(word)
maxlengthword = word
print(sorted(word2count.items(), key=lambda x: -1*x[1])[0][0],maxlengthword) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s019669607 | p00029 | Accepted | x=input().split()
longestWord= ""
mostWord=0
currentCount=0
THEmostWord=""
for r in range (len(x)):
if len(x[r])> len(longestWord):
longestWord=x[r]
for j in range (len(x)):
currentCount=x.count(x[j])
if currentCount > mostWord:
mostWord= currentCount
THEmostWord=x[j]
print(THEmostWord, longestWord) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s072194779 | p00029 | Accepted | from collections import Counter
a = input().split()
long = ""
for w in a:
if len(w) > len(long):
long = w
counter = Counter(a)
for word, cnt in counter.most_common():
print(word, long)
break | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s544000708 | p00029 | Accepted | s = list(input().split())
maxLen = 0
maxNum = 0
dic = {}
for word in s:
if not (word in dic):
dic[word] = 1
else:
dic[word] += 1
if maxNum < dic[word]:
maxNum = dic[word]
ansNum = word
if maxLen < len(word):
maxLen = len(word)
ansLen = word
print(ansNum, ansLen) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s563746695 | p00029 | Accepted | def main():
s = input().split()
ss = sorted(set(s), key = s.index)
cnt = []
ans = []
for x in ss:
c = 0
for y in s:
if x == y:
c += 1
else:
pass
else:
cnt.append(c)
cntcnt = sorted(cnt, reverse = True)
hoge = cntcnt.count(cntcnt[0])
for x in range(hoge):
ans.append(ss[cnt.index(cntcnt[x])])
lenc = []
for x in range(len(ss)):
lenc.append(len(ss[x]))
lenclenc = sorted(lenc, reverse = True)
fuga = lenclenc.count(lenclenc[0])
for x in range(fuga):
ans.append(ss[lenc.index(lenclenc[x])])
for x in range(len(ans)):
if x != len(ans) - 1:
print(ans[x], end = " ")
else:
print(ans[x])
if __name__ == "__main__":
main() | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s938282675 | p00029 | Accepted | # Aizu Problem 0029: English Sentence
#
import sys, math, os
# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
sys.stdin = open("sample-input.txt", "rt")
L_max = 0
counts = {}
for word in input().split():
if len(word) > L_max:
L_max = len(word)
long_word = word
counts[word] = counts.get(word, 0) + 1
for a in sorted([a for a in counts if counts[a] == max(counts.values())]):
print(a, long_word) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s019834932 | p00029 | Accepted | from collections import Counter
text = input().split()
tmp = ""
for t in text:
if len(t) > len(tmp):
tmp = t
print(Counter(text).most_common()[0][0], tmp) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s115964187 | p00029 | Accepted | a=raw_input().split()
dawa=''
d={}
for w in a:
if len(w)>len(dawa): dawa=w
d[a.count(w)]=w
m=max(d.keys())
akeh=d.get(m)
print '%s %s' % (akeh,dawa) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s196376001 | p00029 | Accepted | dic = {}
max = 0
maxword = 0
word = input().strip().split(" ")
i = 1
while i <= len(word):
if word[i-1] in dic:
dic[word[i-1]] += 1
else:
dic[word[i-1]] = 1
i += 1
for k,v in sorted(dic.items()):
if v > max:
max = v
words = k
for k in dic:
if len(k) > maxword:
maxword = len(k)
maxwords = k
print(words + " " + maxwords) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s280060077 | p00029 | Accepted | # 0029
words = input().split()
print(max(words, key=words.count), max(words, key=len)) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s141318959 | p00029 | Accepted | from collections import Counter
def main():
inp = input().strip().split(' ')
k = Counter()
maxlen = 0
maxlenword = ''
for z in inp:
k[z] += 1
if len(z) > maxlen:
maxlenword = z
maxlen = len(z)
maxi = k.most_common(1)[0][0]
print(maxi, maxlenword)
if __name__ == '__main__':
main() | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s614893838 | p00029 | Accepted | s = input().split()
print(max(s, key=lambda x: s.count(x)), max(s, key=lambda x:len(x))) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s395716754 | p00029 | Accepted | if __name__ == '__main__':
a = input().split()
countWords = []
lenWords =[]
for x in a:
countWords.append(a.count(x))
lenWords.append(len(x))
print(a[[i for i,x in enumerate(countWords) if x == max(countWords)][0]],a[[i for i,x in enumerate(lenWords) if x == max(lenWords)][0]]) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s969837247 | p00029 | Accepted | sentence = input().split()
longest = sentence[0]
dictionary = {}
for word in sentence:
if word in dictionary:
dictionary[word] += 1
else:
dictionary[word] = 0
if len(word) > len(longest):
longest = word
mode_value = 0
mode_key = 0
for word in dictionary:
if mode_value < dictionary[word]:
mode_value = dictionary[word]
mode_key = word
print(mode_key, longest) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s218343394 | p00029 | Accepted | d = {}
l = ''
s = input()
for i in s.split():
if not i in d:
d[i] = 0
else:
d[i] += 1
if len(str(l)) < len(str(i)):
l = i
print(sorted(d.items(), key=lambda x: x[1])[-1][0], l) | Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
s152398161 | p00029 | Accepted | line = input().split()
setl = set(line)
data = list(setl)
value = [0] * len(setl)
dic = {}
i = maxlen = 0
maxstr = ""
for s in setl:
if len(s) > maxlen:
maxlen = len(s)
maxstr = s
dic.update({s: i})
i += 1
for l in line:
value[dic[l]] += 1
m = max(value)
for i in range(len(data)):
if value[i] == m:
print(data[i], maxstr)
break
| Thank you for your mail and your lectures
| your lectures
|
<H1>English Sentence</H1>
<p>
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
</p>
<p>
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
</p>
<H2>Input</H2>
<p>
A text is given in a line. You can assume the following conditions:
</p>
<ul>
<li>The number of letters in the text is less than or equal to 1000.</li>
<li> The number of letters in a word is less than or equal to 32.</li>
<li> There is only one word which is arise most frequently in given text.</li>
<li> There is only one word which has the maximum number of letters in given text.</li>
</ul>
<H2>Output</H2>
<p>
The two words separated by a space.
</p>
<H2>Sample Input</H2>
<pre>
Thank you for your mail and your lectures
</pre>
<H2>Output for the Sample Input</H2>
<pre>
your lectures
</pre>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.