s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
int64
0
100
memory
stringlengths
4
6
code_size
int64
15
14.7k
code
stringlengths
15
14.7k
problem_id
stringlengths
6
6
problem_description
stringlengths
358
9.83k
input
stringlengths
2
4.87k
output
stringclasses
807 values
__index_level_0__
int64
1.1k
1.22M
s028533389
p00029
u964040941
1489761842
Python
Python3
py
Accepted
20
7428
169
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)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,502
s441894641
p00029
u897625141
1489841905
Python
Python3
py
Accepted
30
7436
371
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)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,503
s535218358
p00029
u518711553
1491501774
Python
Python3
py
Accepted
20
7608
238
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))
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,504
s898019371
p00029
u901080241
1491633349
Python
Python3
py
Accepted
30
7624
197
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)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,505
s713730663
p00029
u462831976
1492768024
Python
Python3
py
Accepted
30
7788
382
# -*- 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)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,506
s834989708
p00029
u905313459
1496474738
Python
Python3
py
Accepted
30
7784
114
from collections import Counter l = input().split() print(Counter(l).most_common(1)[0][0], sorted(l, key=len)[-1])
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,507
s549151591
p00029
u519227872
1497275162
Python
Python3
py
Accepted
30
7428
307
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)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,508
s019669607
p00029
u395334793
1499413587
Python
Python3
py
Accepted
30
7340
339
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)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,509
s072194779
p00029
u821624310
1502850927
Python
Python3
py
Accepted
30
7668
210
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
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,510
s544000708
p00029
u584777171
1503362452
Python
Python3
py
Accepted
30
7360
326
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)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,511
s563746695
p00029
u855694108
1504229035
Python
Python3
py
Accepted
20
7484
840
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()
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,512
s938282675
p00029
u957021183
1504849458
Python
Python3
py
Accepted
30
7600
449
# 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)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,513
s019834932
p00029
u546285759
1506237458
Python
Python3
py
Accepted
30
7708
166
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)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,514
s115964187
p00029
u011621222
1507911085
Python
Python
py
Accepted
10
6352
150
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)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,515
s196376001
p00029
u625523186
1508757378
Python
Python3
py
Accepted
30
7384
388
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)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,516
s280060077
p00029
u845643816
1509261735
Python
Python3
py
Accepted
20
7332
86
# 0029 words = input().split() print(max(words, key=words.count), max(words, key=len))
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,517
s141318959
p00029
u011621222
1509744051
Python
Python3
py
Accepted
30
7724
360
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()
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,518
s614893838
p00029
u947762778
1510028324
Python
Python3
py
Accepted
30
7408
88
s = input().split() print(max(s, key=lambda x: s.count(x)), max(s, key=lambda x:len(x)))
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,519
s395716754
p00029
u917432951
1511921277
Python
Python3
py
Accepted
20
5564
314
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]])
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,520
s969837247
p00029
u236679854
1512600142
Python
Python3
py
Accepted
20
5560
415
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)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,521
s749540633
p00029
u299798926
1513759065
Python
Python3
py
Accepted
20
5544
79
words = input().split() print(max(words, key=words.count), max(words, key=len))
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,522
s218343394
p00029
u585035894
1514629008
Python
Python3
py
Accepted
20
5560
213
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)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,523
s152398161
p00029
u028347703
1514782184
Python
Python3
py
Accepted
20
5556
356
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
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,524
s931314067
p00029
u600263347
1515460077
Python
Python3
py
Accepted
30
5968
275
from collections import Counter def main(): str = Counter(input().split(" ")) long_str = "" for word in str: if len(long_str) < len(word): long_str = word print(str.most_common(1)[0][0] , long_str) if __name__ == '__main__': main()
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,525
s594355240
p00029
u024715419
1516342804
Python
Python3
py
Accepted
20
5560
367
s = input().split() len_max = 0 freq_max = 0 w_len = "" w_freq = "" dict_freq = {} for i,w in enumerate(s): if w in dict_freq: dict_freq[w] += 1 else: dict_freq[w] = 1 if len(w) > len_max: w_len = w len_max = len(w) if dict_freq[w] > freq_max: w_freq = w freq_max = dict_freq[w] print(w_freq, w_len)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,526
s045517905
p00029
u043254318
1517179010
Python
Python3
py
Accepted
20
5560
388
S = input().split() words = [] for i in range(len(S)): words.append(S[i]) words.sort() cnt = 0 maxcnt = 0 ans1 = "" ans2 = words[0] for i in range(1, len(words)): if words[i] == words[i-1]: cnt += 1 else: cnt = 0 if maxcnt < cnt: ans1 = words[i] maxcnt = cnt if len(ans2) < len(words[i]): ans2 = words[i] print(ans1,ans2)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,527
s733808900
p00029
u150984829
1517601750
Python
Python3
py
Accepted
20
5564
183
a=input().strip().split() d,e={},{} for w in a:d.setdefault(w,0);d[w]+=1 for w in d: if d[w]==max(d.values()):print(w,end='') e.setdefault(len(w),[]).append(w) print('',*e[max(e)])
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,528
s078100774
p00029
u150984829
1517601865
Python
Python3
py
Accepted
20
5556
175
a=input().split() d,e={},{} for w in a:d.setdefault(w,0);d[w]+=1 for w in d: if d[w]==max(d.values()):print(w,end='') e.setdefault(len(w),[]).append(w) print('',*e[max(e)])
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,529
s945542724
p00029
u150984829
1517602071
Python
Python3
py
Accepted
20
5540
59
s=input().split() print(max(s,key=s.count),max(s,key=len))
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,530
s502281892
p00029
u744114948
1521169783
Python
Python3
py
Accepted
20
5560
202
word_l = input().split() dic = {} for w in word_l: try: dic[w] += 1 except: dic[w] = 1 l_w = max(word_l, key=len) p_w = max(dic.items(), key=lambda x:x[1]) print(p_w[0], l_w)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,531
s695168705
p00029
u553148578
1523856037
Python
Python3
py
Accepted
40
6944
194
import statistics sentLong = '' sent = list(map(str,input().split(' '))) for i in range(len(sent)): if len(sentLong) < len(sent[i]): sentLong = sent[i] print(statistics.mode(sent), sentLong)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,532
s143268860
p00029
u136916346
1527397622
Python
Python3
py
Accepted
30
5952
138
import collections l=input().split() print(sorted(collections.Counter(l).items(),key=lambda x:x[1])[-1][0], sorted(l,key=len)[-1])
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,533
s182984392
p00029
u352394527
1527452390
Python
Python3
py
Accepted
30
5972
237
from collections import Counter lst = input().split() dic = Counter(lst) most_common = dic.most_common(1)[0][0] length = max([len(s) for s in lst]) for s in lst: if len(s) == length: longest = s print(most_common, longest)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,534
s923591744
p00029
u847467233
1528801424
Python
Python3
py
Accepted
30
5968
310
# AOJ 0029 English Sentence # Python3 2018.6.12 bal4u import collections from operator import itemgetter a = list(input().split()) maxlen = 0 for i in a: if len(i) > maxlen: maxlen = len(i) ans_max_len = i dict = collections.Counter(a) print(max(dict.most_common(), key=itemgetter(1))[0], ans_max_len)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,535
s022967452
p00029
u847467233
1528801860
Python
Python3
py
Accepted
20
5540
125
# AOJ 0029 English Sentence # Python3 2018.6.12 bal4u a = list(input().split()) print(max(a, key=a.count), max(a, key=len))
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,536
s265722460
p00029
u575065019
1345578945
Python
Python
py
Accepted
10
4216
231
text = raw_input().split() Max = 1 for i in text: if len(i) > Max: Maxstr = i Max = len(i) Max = 1 for i in text: t = text.count(i) if t > Max: Maxcount = i Max = t print Maxcount,Maxstr
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,537
s022616777
p00029
u724947062
1347279092
Python
Python
py
Accepted
10
5396
240
import sys sentence = sys.stdin.readline().strip() words = sentence.split() tmp = set() for word in words: count = words.count(word) tmp.add((word, count)) print max(list(tmp), key=lambda x:x[1])[0],max(words, key=lambda x:len(x))
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,538
s097448329
p00029
u290605490
1355234097
Python
Python
py
Accepted
10
4220
275
sent=raw_input() words=sent.split() max_f,freq_w=0,"" max_len,len_w=0,"" for word in words: if max_f<words.count(word): freq_w=word max_f=words.count(word) if max_len<len(word): len_w=word max_len=len(word) print "%s %s"%(freq_w,len_w)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,539
s477983102
p00029
u647766105
1355753217
Python
Python
py
Accepted
20
5736
194
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))
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,540
s901289400
p00029
u647766105
1355753337
Python
Python
py
Accepted
20
5736
193
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))
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,541
s217647189
p00029
u419407022
1356273269
Python
Python
py
Accepted
20
4216
196
words = raw_input().split() dict = {} for word in words: try: dict[word] += 1 except: dict[word] = 1 print max(dict.items(),key=lambda x:x[1])[0], print max(words, key=len)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,542
s044433454
p00029
u504990413
1357264178
Python
Python
py
Accepted
10
4236
396
def count(sent): kind = list(set(sent)) ki_cou = [] for ki in kind: ki_cou.append(sent.count(ki)) return kind[ki_cou.index(max(ki_cou))] def length(sent): kind = list(set(sent)) ki_len = [] for ki in kind: ki_len.append(len(ki)) return kind[ki_len.index(max(ki_len))] sent = map(str, raw_input().split(' ')) print count(sent),length(sent)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,543
s131402779
p00029
u865312527
1359450095
Python
Python
py
Accepted
10
4224
252
words={} for word in raw_input().rstrip().split(): words.setdefault(word, 0) words[word]+=1 wl=sorted(words.items(),key=lambda x : x[1],reverse=True) print wl[0][0], wl=sorted(words.items(),key=lambda x : len(x[0]),reverse=True) print wl[0][0]
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,544
s205152587
p00029
u782850731
1362273683
Python
Python
py
Accepted
10
4636
325
from __future__ import (absolute_import, division, print_function, unicode_literals) from sys import stdin from collections import Counter counter = Counter() for line in stdin: for s in line.split(): counter[s] += 1 print(counter.most_common()[0][0], sorted(counter.keys(), key=len)[-1])
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,545
s696989323
p00029
u782850731
1362274128
Python
Python
py
Accepted
10
4636
311
from __future__ import (absolute_import, division, print_function, unicode_literals) from sys import stdin from collections import Counter counter = Counter() for line in stdin: for s in line.split(): counter[s] += 1 print(counter.most_common()[0][0], max(counter, key=len))
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,546
s415825261
p00029
u147801965
1364369131
Python
Python
py
Accepted
10
4232
236
a = raw_input().split() ans = {} for i in a: if i not in ans: ans[i] = 1 else: ans[i] += 1 tt,gg,q,w=0,0,"","" for i in ans: if ans[i] > tt: tt = ans[i] w = i if len(i) > gg: gg = len(i) q = i print w,q
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,547
s700151913
p00029
u310759044
1365335412
Python
Python
py
Accepted
10
4220
177
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: word_d[i]),max(word_d.iterkeys(),key=lambda i:len(i))
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,548
s034139603
p00029
u542421762
1368266660
Python
Python
py
Accepted
10
4252
573
import sys def mode(hash): m = max(hash.values()) for k in hash.keys(): if hash[k] == m: return k def longest(hash): h = {} for k in hash.keys(): h[k] = len(k) m = max(h.values()) l = '' for k in h.keys(): if h[k] == m: l = k break return l h = {} #input_file = open(sys.argv[1], 'r') for line in sys.stdin: terms = line.rstrip('\r\n').split(' ') for t in terms: if t in h: h[t] += 1 else: h[t] = 1 print mode(h), longest(h)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,549
s574102360
p00029
u912237403
1378121698
Python
Python
py
Accepted
20
4224
254
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 e>m: m=e w1=word if len(word)>l: l=len(word) w2=word print w1, w2
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,550
s624517022
p00029
u813384600
1380544649
Python
Python
py
Accepted
20
4612
194
from collections import Counter s = raw_input().split() c = sorted(Counter(s).items(), key=lambda x:x[1], reverse = True) r = sorted(s, key=lambda x:len(x), reverse = True) print c[0][0], r[0]
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,551
s869696780
p00029
u523886269
1381562456
Python
Python
py
Accepted
10
4228
337
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] + " " + length_list[0][0]
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,552
s043129404
p00029
u093607836
1382289646
Python
Python
py
Accepted
10
4216
244
dic = {} for s in raw_input().split(): dic[s] = dic.get(s, 0) + 1 val = dic.items() most = sorted(val, key=lambda i:i[1], reverse=True)[0][0] length = sorted(val, key=lambda i:len(i[0]), reverse=True)[0][0] print '{0} {1}'.format(most, length)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,553
s713788991
p00029
u093607836
1382292876
Python
Python
py
Accepted
10
4216
226
dic = {} for s in raw_input().split(): dic[s] = dic.get(s, 0) + 1 val = dic.items() most = sorted(val, key=lambda i:i[1], reverse=True)[0][0] length = sorted(val, key=lambda i:len(i[0]), reverse=True)[0][0] print most, length
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,554
s370299155
p00029
u023846178
1387293530
Python
Python
py
Accepted
10
4204
188
words = raw_input().split() chk = dict() for w in words: if w in chk: chk[w] += 1 else: chk[w] = 0 print max(chk.items(), key=lambda x:x[1])[0], max(words, key=len)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,555
s315976761
p00029
u023846178
1387294765
Python
Python
py
Accepted
10
4204
138
words = raw_input().split() d = dict() for w in words: d[w] = d.get(w,0)+1 print max(d.keys(), key=lambda i:d[i]), max(words, key=len)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,556
s915766755
p00029
u633068244
1393396337
Python
Python
py
Accepted
10
4220
307
mlen = 0 mexst = 0 word = map(str, raw_input().split()) setword = list(set(word)) for i in range(len(word)): if len(word[i]) > mlen: mlen = len(word[i]) mlenw = word[i] for i in setword: if word.count(i) > mexst: mexst = word.count(i) mexstw = i print mexstw, mlenw
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,557
s040586920
p00029
u912237403
1394317496
Python
Python
py
Accepted
20
4200
155
s = raw_input().lower().split() c1 = 0 c2 = 0 for w in set(s): c=s.count(w) if c>c1: c1,w1 = c,w c=len(w) if c>c2: c2,w2 = c,w print w1, w2
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,558
s775829446
p00029
u912237403
1394318713
Python
Python
py
Accepted
20
4212
243
def f(A): x = A.values() c = x.index(max(x)) return A.keys()[c] s = raw_input().lower().split() A={} B={} for w in s: if A.has_key(w): A[w] += 1 else: A[w] = 1 B[w] = len(w) w1 = f(A) w2 = f(B) print w1, w2
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,559
s884934121
p00029
u912237403
1394318970
Python
Python
py
Accepted
10
4204
147
s = raw_input().split() c1 = 0 c2 = 0 for w in set(s): c=s.count(w) if c>c1: c1,w1 = c,w c=len(w) if c>c2: c2,w2 = c,w print w1, w2
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,560
s489250979
p00029
u193025715
1395414183
Python
Python
py
Accepted
10
4204
193
s = raw_input().split() tmp_l = 0 tmp_s = 0 for i in s: if len(i) > tmp_l: tmp_l = len(i) ans2 = i if s.count(i) > tmp_s: tmp_s = s.count(i) ans1 = i print "{} {}".format(ans1, ans2)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,561
s364874607
p00029
u491763171
1396403223
Python
Python
py
Accepted
10
4596
236
from collections import Counter c = Counter() strings = raw_input().lower().split() for s in strings: c[s] += 1 print sorted(c.items(), key=lambda a: a[1], reverse=True)[0][0], print sorted(c, key=lambda a: len(a), reverse=True)[0]
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,562
s097619102
p00029
u246033265
1396621511
Python
Python
py
Accepted
20
4212
173
a = raw_input().split() dic = {} mx = '' for s in a: dic[s] = dic.get(s, 0) + 1 if len(s) > len(mx): mx = s print max(dic.items(), key=lambda p: p[1])[0], mx
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,563
s735917412
p00029
u378480414
1397108671
Python
Python
py
Accepted
10
4220
287
count={} for s in raw_input().rstrip().split(): if not count.has_key(s): count[s]=[len(s),0] count[s][1]+=1 long,mode=max([x[0] for x in count.values()]),max([x[1] for x in count.values()]) for k,v in count.items(): if v[0]==long: long=k if v[1]==mode: mode=k print mode,long
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,564
s439934075
p00029
u436634575
1401170275
Python
Python3
py
Accepted
30
6724
105
text = input().split() print(max(text, key = lambda w: text.count(w)), max(text, key = lambda w: len(w)))
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,565
s895666231
p00029
u858885710
1403796856
Python
Python
py
Accepted
10
4216
283
s = raw_input().split() d = {} w = None mf = 0 m = None ml = 0 for ww in s: if( len(ww) > ml ): m = ww ml = len(ww) try: d[ww] += 1 if( d[ww] > mf ): mf = d[ww] w = ww except KeyError: d[ww] = 1 print w, m
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,566
s558736970
p00029
u118506623
1597762874
Python
Python3
py
Accepted
20
5536
67
a = list(input().split()) print(max(a,key=a.count),max(a,key=len))
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,567
s413571246
p00029
u350481745
1597762291
Python
Python3
py
Accepted
20
5552
167
n=list(input().split()) x=0 y=0 a='' b='' for i in (n): if x<n.count(i): x=n.count(i) a=i if y<len(i): y=len(i) b=i print(a,b)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,568
s247488161
p00029
u371026526
1597761594
Python
Python3
py
Accepted
30
5968
190
from collections import Counter word = list(input().split()) count = Counter(word) x,y = 0,0 for i in word: if x<len(i): x=len(i) y=i print(count.most_common()[0][0],y)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,569
s502806172
p00029
u444626963
1597760948
Python
Python3
py
Accepted
20
5536
70
a = list(input().split()) print(max(a, key=a.count), max(a, key=len))
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,570
s401457123
p00029
u931484744
1597736700
Python
Python3
py
Accepted
30
5972
404
# coding: utf-8 # Your code here! import collections s = input() counter = collections.Counter(s.split()) d = counter.most_common() maxm = 0 maxn = 0 for i in range(len(d)): if d[i][1] > maxm: maxm = d[i][1] if len(d[i][0]) > maxn: maxn = len(d[i][0]) for i in range(len(d)): if d[i][1] == maxm: print(d[i][0], end = "") if len(d[i][0]) == maxn: print("", d[i][0])
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,571
s970879977
p00029
u322947441
1597735752
Python
Python3
py
Accepted
50
6944
174
import statistics m = list(map(str,input().split())); mode = statistics.mode(m) a = ""; for i in range(0,len(m)): if len(a) < len(m[i]): a = m[i]; print(mode,a);
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,572
s957965570
p00029
u470391435
1597734348
Python
Python3
py
Accepted
20
5556
177
a = input() a = a.split(' ') b=[] e=[] for i in range(len(a)): b.append(len(a[i])) f=a.count(a[i]) e.append(f) c=a[b.index(max(b))] g=a[e.index(max(e))] print(g,c)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,573
s711154228
p00029
u257570657
1597681328
Python
Python3
py
Accepted
30
5964
193
import collections a=list(map(str,input().split())) c = collections.Counter(a) d=0 for i in range(len(a)): b=len(a[i]) if d<b: d=b e=i print(c.most_common()[0][0],a[e])
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,574
s231118900
p00029
u988962397
1597679686
Python
Python3
py
Accepted
20
5560
425
s=input().split() moji=[] count=[] mojisuu="" for i in range(len(s)): n=0 if(len(mojisuu)<len(s[i])): mojisuu=s[i] for j in range(len(moji)): if(moji[j]==s[i]): count[j]+=1 n+=1 break if(n==0): moji.append(s[i]) count.append(1) max_count=max(count) max_index=count.index(max_count) shutugen=moji[max_index] print(shutugen, mojisuu)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,575
s529630518
p00029
u838993229
1597651596
Python
Python3
py
Accepted
20
5560
265
x = input().split() l = "" m = 0 Count = 0 mostword = "" for i in range(len(x)): if len(x[i]) > len(l): l = x[i] for j in range(len(x)): a = x[j] Count = x.count(a) if Count > m: m = Count mostword = a print(mostword, l)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,576
s332680935
p00029
u397004753
1597555843
Python
Python3
py
Accepted
20
5540
151
s=input().split() print(max(s,key=s.count),max(s,key=len)) #max()はkeyに別の関数を指定してその返り値が最大となる要素を返す
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,577
s873952434
p00029
u826807985
1597288764
Python
Python3
py
Accepted
20
5548
184
n=input().split() mx = 0 mx2 = 0 for i in n: if mx < len(i): mx = len(i) mxm = i elif mx2 < n.count(i): mx2 = n.count(i) mxh = i print(mxh,mxm)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,578
s808733844
p00029
u221550784
1596726650
Python
Python3
py
Accepted
20
5560
167
x=input() A=x.split() S=[] L=[] for i in A: s=A.count(i) S.append(s) l=len(i) L.append(l) M=max(S) m=max(L) Y=S.index(M) y=L.index(m) print(A[Y],A[y])
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,579
s457832542
p00029
u392970366
1596666283
Python
Python3
py
Accepted
20
5540
59
s=input().split() print(max(s,key=s.count),max(s,key=len))
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,580
s086453612
p00029
u251716708
1596608230
Python
Python3
py
Accepted
20
5560
217
n = input().split() a=0 b=0 l="x" m="x" for i in range(len(n)): if n.count(n[i])>a: a=n.count(n[i]) l=n[i] for i in range(len(n)): if len(n[i])>b: b=len(n[i]) m=n[i] print(l,m)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,581
s303206263
p00029
u677563181
1596606256
Python
Python3
py
Accepted
20
5556
288
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)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,582
s298806978
p00029
u309196579
1596594827
Python
Python3
py
Accepted
20
5540
59
s=input().split() print(max(s,key=s.count),max(s,key=len))
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,583
s899715804
p00029
u711365732
1596519146
Python
Python3
py
Accepted
20
5964
189
import collections x = input().split() c = collections.Counter(x) max = 0 for i in range(len(x)): a = len(x[i]) if a>max: max = a M = x[i] print(c.most_common()[0][0], M)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,584
s640033142
p00029
u633358233
1596501167
Python
Python3
py
Accepted
20
5560
167
x=input() A=x.split() S=[] L=[] for i in A: s=A.count(i) S.append(s) l=len(i) L.append(l) M=max(S) m=max(L) Y=S.index(M) y=L.index(m) print(A[Y],A[y])
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,585
s692414029
p00029
u926092389
1596362451
Python
Python3
py
Accepted
20
5544
65
n=list(input().split()) print(max(n,key=n.count),max(n,key=len))
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,586
s213247931
p00029
u290304811
1596202755
Python
Python3
py
Accepted
20
5536
63
a = input().split() print(max(a,key=a.count),max(a,key=len))
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,587
s011652139
p00029
u525366883
1596170326
Python
Python3
py
Accepted
20
5556
280
word = sorted(input().split()) length = len(word) cnt = 0 cc = "" w = "" wc = 0 for i in word: if cnt < len(i): cnt = len(i) cc = i for i in range(length): if word.count(word[i]) > wc: wc = word.count(word[i]) w = word[i] print(w, cc)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,588
s448848994
p00029
u057249340
1595894796
Python
Python3
py
Accepted
20
5540
69
x = list(input().split()) print(max(x,key=x.count), max(x,key=len))
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,589
s866856852
p00029
u555228137
1595887800
Python
Python3
py
Accepted
20
5544
59
a=input().split() print(max(a,key=a.count),max(a,key=len))
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,590
s645734369
p00029
u037263780
1595870769
Python
Python3
py
Accepted
20
5564
272
s=list(map(str,input().split())) m={} l={} for i in range(len(s)): t=s[i].lower() if t in m: m[t]+=1 else: m.setdefault(t,1) if t in l: pass else: l.setdefault(t,len(t)) print(max(m,key=m.get),max(l,key=l.get))
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,591
s910384947
p00029
u630948380
1595861045
Python
Python3
py
Accepted
20
5556
236
L=[] M=[] A=list(map(str,input().split())) B=len(A) for i in range(B): C=A.count(A[i]) L.append(C) D=max(L) E=L.index(D) print(A[E],end=" ") for j in range(B): F=len(A[j]) M.append(F) G=max(M) H=M.index(G) print(A[H])
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,592
s980439259
p00029
u586171604
1595828184
Python
Python3
py
Accepted
20
5544
59
s=input().split() print(max(s,key=s.count),max(s,key=len))
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,593
s250946183
p00029
u795882061
1595693169
Python
Python3
py
Accepted
20
5956
120
import collections d = input() D = d.split() c = collections.Counter(D) print(c.most_common()[0][0], max(D,key=len))
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,594
s971449306
p00029
u187074069
1595309281
Python
Python3
py
Accepted
20
5552
262
sentence = list(input().split()) maxcount = 0 maxlen = 0 cs = '' ls = '' for i in sentence: if maxcount < sentence.count(i): maxcount = sentence.count(i) cs = i if maxlen < len(i): maxlen = len(i) ls = i print(cs, ls)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,595
s735105144
p00029
u192469946
1595299242
Python
Python3
py
Accepted
30
5968
226
#0029 import collections l =[] word = input() words = word.split(' ') c = collections.Counter(words) C = c.most_common(1) for i in words: l.append(len(i)) for i in words: if max(l) == len(i): print(C[0][0],i)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,596
s964886126
p00029
u128671689
1594727053
Python
Python3
py
Accepted
20
5556
259
A=list(input().split()) L=len(A) MAX1=0 MAX2=0 for i in range(L): s=A.count(A[i]) if s>MAX1: MAX1=s x=A[i] else: pass l=len(A[i]) if l>MAX2: MAX2=l y=A[i] else: pass print(x,y)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,597
s321356728
p00029
u862272701
1594647691
Python
Python3
py
Accepted
30
5968
233
import collections s = str(input()) S = [] A = [] l = s.split(' ') S.extend(l) c = collections.Counter(S) L = len(S) for i in range(L): a = S[i] A.append(a) A.sort(key=len,reverse=True) print(c.most_common()[0][0], A[0])
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,598
s307134038
p00029
u647921435
1594272261
Python
Python3
py
Accepted
20
5556
167
x=input() A=x.split() S=[] L=[] for i in A: s=A.count(i) S.append(s) l=len(i) L.append(l) M=max(S) m=max(L) Y=S.index(M) y=L.index(m) print(A[Y],A[y])
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,599
s135636506
p00029
u395654950
1594012078
Python
Python3
py
Accepted
20
5968
447
# coding: utf-8 # Your code here! import collections s = input() counter = collections.Counter(s.split()) d = counter.most_common() #print(d) maxm = 0 maxn = 0 for i in range(len(d)): if d[i][1] > maxm: maxm = d[i][1] if len(d[i][0]) > maxn: maxn = len(d[i][0]) #print(maxm, maxn) for i in range(len(d)): if d[i][1] == maxm: print(d[i][0], end = "") if len(d[i][0]) == maxn: print("", d[i][0])
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,600
s900645990
p00029
u994684803
1592301900
Python
Python3
py
Accepted
20
5548
95
a = input() a = a.split() ans1 = max(a,key=a.count) ans2 = max(a,key=len) print(ans1,ans2)
p00029
<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>
Thank you for your mail and your lectures
your lectures
8,601