submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s931314067
p00029
Accepted
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()
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s594355240
p00029
Accepted
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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s045517905
p00029
Accepted
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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s733808900
p00029
Accepted
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)])
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s078100774
p00029
Accepted
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)])
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s945542724
p00029
Accepted
s=input().split() print(max(s,key=s.count),max(s,key=len))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s502281892
p00029
Accepted
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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s695168705
p00029
Accepted
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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s143268860
p00029
Accepted
import collections l=input().split() print(sorted(collections.Counter(l).items(),key=lambda x:x[1])[-1][0], sorted(l,key=len)[-1])
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s182984392
p00029
Accepted
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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s923591744
p00029
Accepted
# 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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s022967452
p00029
Accepted
# AOJ 0029 English Sentence # Python3 2018.6.12 bal4u a = list(input().split()) print(max(a, key=a.count), max(a, key=len))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s265722460
p00029
Accepted
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
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s022616777
p00029
Accepted
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))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s097448329
p00029
Accepted
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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s477983102
p00029
Accepted
dic={} for word in raw_input().split(): if word not in dic: dic[word]=0 dic[word]+=1 print max(dic.iterkeys(),key=lambda k:dic[k]), print max(dic.iterkeys(),key= lambda k:len(k))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s901289400
p00029
Accepted
dic={} for word in raw_input().split(): if word not in dic: dic[word]=0 dic[word]+=1 print max(dic.iterkeys(),key=lambda k:dic[k]), print max(dic.iterkeys(),key=lambda k:len(k))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s217647189
p00029
Accepted
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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s044433454
p00029
Accepted
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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s131402779
p00029
Accepted
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]
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s205152587
p00029
Accepted
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])
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s696989323
p00029
Accepted
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))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s415825261
p00029
Accepted
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
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s700151913
p00029
Accepted
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))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s034139603
p00029
Accepted
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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s574102360
p00029
Accepted
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
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s624517022
p00029
Accepted
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]
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s869696780
p00029
Accepted
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]
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s043129404
p00029
Accepted
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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s713788991
p00029
Accepted
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
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s370299155
p00029
Accepted
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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s315976761
p00029
Accepted
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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s915766755
p00029
Accepted
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
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s040586920
p00029
Accepted
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
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s775829446
p00029
Accepted
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
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s884934121
p00029
Accepted
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
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s489250979
p00029
Accepted
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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s364874607
p00029
Accepted
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]
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s097619102
p00029
Accepted
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
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s735917412
p00029
Accepted
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
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s439934075
p00029
Accepted
text = input().split() print(max(text, key = lambda w: text.count(w)), max(text, key = lambda w: len(w)))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s895666231
p00029
Accepted
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
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s558736970
p00029
Accepted
a = list(input().split()) print(max(a,key=a.count),max(a,key=len))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s413571246
p00029
Accepted
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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s247488161
p00029
Accepted
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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s502806172
p00029
Accepted
a = list(input().split()) print(max(a, key=a.count), max(a, key=len))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s401457123
p00029
Accepted
# 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])
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s970879977
p00029
Accepted
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);
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s957965570
p00029
Accepted
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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s711154228
p00029
Accepted
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])
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s231118900
p00029
Accepted
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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s529630518
p00029
Accepted
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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s332680935
p00029
Accepted
s=input().split() print(max(s,key=s.count),max(s,key=len)) #max()はkeyに別の関数を指定してその返り値が最大となる要素を返す
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s873952434
p00029
Accepted
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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s808733844
p00029
Accepted
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])
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s086453612
p00029
Accepted
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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s303206263
p00029
Accepted
ns=list(map(str,input().split())) mp={} for n in ns: if n in mp: mp[n]=mp[n]+1 else: mp[n]=1 long_word='' freq_word='' max_len=0 max_fre=0 for k,v in mp.items(): if max_len<len(k): long_word=k max_len=len(k) if max_fre<v: freq_word=k max_fre=v print(freq_word,long_word)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s899715804
p00029
Accepted
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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s692414029
p00029
Accepted
n=list(input().split()) print(max(n,key=n.count),max(n,key=len))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s213247931
p00029
Accepted
a = input().split() print(max(a,key=a.count),max(a,key=len))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s011652139
p00029
Accepted
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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s448848994
p00029
Accepted
x = list(input().split()) print(max(x,key=x.count), max(x,key=len))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s866856852
p00029
Accepted
a=input().split() print(max(a,key=a.count),max(a,key=len))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s645734369
p00029
Accepted
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))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s910384947
p00029
Accepted
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])
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s250946183
p00029
Accepted
import collections d = input() D = d.split() c = collections.Counter(D) print(c.most_common()[0][0], max(D,key=len))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s971449306
p00029
Accepted
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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s735105144
p00029
Accepted
#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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s964886126
p00029
Accepted
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)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s321356728
p00029
Accepted
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])
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s135636506
p00029
Accepted
# 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])
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s900645990
p00029
Accepted
a = input() a = a.split() ans1 = max(a,key=a.count) ans2 = max(a,key=len) print(ans1,ans2)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s583726266
p00029
Accepted
import collections n=input().split() c=collections.Counter(n) dic={i: len(i) for i in n} print(c.most_common()[0][0],max(dic,key=dic.get))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s512697983
p00029
Accepted
n = input().split() print(max(n, key=n.count),max(n, key=len))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s316885898
p00029
Accepted
l = input().split() s = set(l) a = 0 b = 0 J = '' K = '' for i in s: if l.count(i) > a: a = l.count(i) J = i if len(i) > b: b = len(i) K = i print(J,K)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s378132366
p00029
Accepted
import sys sys.setrecursionlimit(10000000) MOD = 10 ** 9 + 7 INF = 10 ** 15 from collections import deque,defaultdict,Counter def main(): S = input().split() S[0] = S[0].lower() c = Counter(S) often = sorted(list(c.items()),key = lambda x:-x[1])[0][0] longest = sorted(list(c.keys()),key = len)[-1] print(often,longest) if __name__ == '__main__': main()
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s431250811
p00029
Accepted
a= list(input().split()) b={} for w in a: if not(w in b): b[w]=1 else: b[w]+=1 max_word=" " max_num= a[0] for w in b: if len(max_word)< len(w): max_word= w if b[w]> b[max_num]: max_num= w print(max_num,max_word)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s081128077
p00029
Accepted
#標準入力 line = list(input().split()) #max関数を使いkeyを引数に設定し、最瀕の単語と、文字数の長い単語を出力する print(max(line,key = line.count),max(line,key = len))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s190477110
p00029
Accepted
a = list(input().split()) print(max(a, key=a.count), max(a, key=len))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s438200947
p00029
Accepted
from operator import itemgetter sentence = list(input().split()) max_length = 0 max_sentence = "" count = [] for i in range(len(sentence)) : if max_length < len(sentence[i]) : max_length = len(sentence[i]) max_sentence = sentence[i] new_word = False for j in range(len(count)) : if count[j][0] == sentence[i] : new_word = True count[j][1] += 1 break if new_word == False : count.append([sentence[i], 1]) count = sorted(count, key = itemgetter(1), reverse = True) print(count[0][0], max_sentence)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s359218376
p00029
Accepted
text = list(input().split()) count = [] length = [] for i in range(len(text)): count.append(text.count(text[i])) length.append(len(text[i])) c = count.index(max(count)) l = length.index(max(length)) print(text[c],text[l])
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s733981485
p00029
Accepted
word_list = input().split(' ') word_dict = {} longest_word_len = 0 longest_word = '' high_freq_word_num = 0 for word in word_list: if longest_word_len < len(word): longest_word_len = len(word) longest_word = word if word not in word_dict: word_dict[word] = 1 else : word_dict[word] += 1 if high_freq_word_num < word_dict[word]: high_freq_word_num = word_dict[word] for word in word_list: if word_dict[word] == high_freq_word_num: print(word + ' ' + longest_word) break
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s981826099
p00029
Accepted
from collections import Counter import sys readline = sys.stdin.readline write = sys.stdout.write def solve(): s = readline() c = Counter(s.split()) write("%s %s\n" % (max(c, key=lambda x: c[x]), max(c, key=len))) solve()
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s487706441
p00029
Accepted
S = input().split() l = 0 n = 0 L = "a" N = "a" for i in range(len(S)) : if S.count(S[i]) > n : n = S.count(S[i]) N = S[i] for i in range(len(S)) : if len(S[i]) > l : l = len(S[i]) L = S[i] print(N, L)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s663949638
p00029
Accepted
n=list(map(str,input().split())) s=0 t=0 p=[] q=[] for i in range(0,len(n)): d=n.count(n[i]) if d>s: p.append(n[i]) s=d else: pass if len(n[i])>t: q.append(n[i]) t=len(n[i]) p=p[::-1] q=q[::-1] print(p[0],q[0])
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s225612686
p00029
Accepted
dic = dict() maxWords = "" words = list(x for x in input().split()) for w in words: if len(w) > len(maxWords): maxWords = w value = dic.get(w) if not value: dic.setdefault(w,1) else: dic.update({w:value + 1}) dic = dict(sorted(dic.items(), key=lambda x: x[1],reverse=True)) print(list(dic.keys())[0],maxWords)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s391623469
p00029
Accepted
from collections import Counter sentence = input().split() cnt = Counter(sentence) print(cnt.most_common(1)[0][0], max(sentence, key=lambda x: len(x)))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s598103229
p00029
Accepted
from collections import Counter s=input() s=s.lower() s=s.split(" ") long=sorted(s,key=lambda w:len(w),reverse=True) freq=dict(Counter(s)).items() freq=sorted(freq,key=lambda w:w[1],reverse=True) print(freq[0][0],long[0])
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s277436626
p00029
Accepted
# ライブラリのインポート #import re #正規表現 import sys #import heapq #import collections #import math def main(): y = "" for x in sys.stdin: y += x a = list(y.strip("\n").split(" ")) print(max(a, key=a.count), max(a, key=len)) if __name__ == '__main__': main()
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s534837824
p00029
Accepted
dic = {} max_num = 0 max_word = "" for word in input().split(): if word in dic: dic[word] += 1 else: dic[word] = 1 if max_num <= len(word): max_num = len(word) max_word = word print(max(dic, key=dic.get), max_word)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s315313736
p00029
Accepted
s=list(input().split()) num1=1 tmp1=0 for i in range(len(s)): if tmp1>num1: #出現頻度が高い #print("tmp1",tmp1) num1=tmp1 list1=s[i-1] tmp1=0 for m in range(len(s)): if s[i]==s[m]: tmp1+=1 for l in range(len(s)-1): #単語が一番長い if len(s[l])>len(s[l+1]): tmp2=s[l+1] s[l+1]=s[l] s[l]=tmp2 print(list1,s[len(s)-1])
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s434707555
p00029
Accepted
s = input().split() len_id = 0; max_len = 0 cnt_id = 0; max_cnt = 0 for i in range(len(s)): l = len(s[i]) c = s.count(s[i]) if l > max_len: max_len = l len_id = i if c > max_cnt: max_cnt = c cnt_id = i print(s[cnt_id], s[len_id])
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s568750016
p00029
Accepted
text = input().split() l = {} dc = {} for i in text: l[i] = len(i) if i in dc.keys(): dc[i] += 1 else: dc[i] = 0 print(max(dc, key=dc.get), max(l, key=l.get))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s099241671
p00029
Accepted
list = input().split() print(max(list, key=list.count), max(list, key=len))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s621485897
p00029
Accepted
list = input().split() print(max(list, key=list.count), max(list, key=len))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s344826239
p00029
Accepted
# coding=utf-8 ### ### for python program ### import sys import math # math class class mymath: ### pi pi = 3.14159265358979323846264338 ### Prime Number def pnum_eratosthenes(self, n): ptable = [0 for i in range(n+1)] plist = [] for i in range(2, n+1): if ptable[i]==0: plist.append(i) for j in range(i+i, n+1, i): ptable[j] = 1 return plist def pnum_check(self, n): if (n==1): return False elif (n==2): return True else: for x in range(2,n): if(n % x==0): return False return True ### GCD def gcd(self, a, b): if b == 0: return a return self.gcd(b, a%b) ### LCM def lcm(self, a, b): return (a*b)//self.gcd(a,b) ### Mat Multiplication def mul(self, A, B): ans = [] for a in A: c = 0 for j, row in enumerate(a): c += row*B[j] ans.append(c) return ans mymath = mymath() ### output class class output: ### list def list(self, l): l = list(l) #print(" ", end="") for i, num in enumerate(l): print(num, end="") if i != len(l)-1: print(" ", end="") print() output = output() ### input sample #i = input() #N = int(input()) #A, B, C = [x for x in input().split()] #N, K = [int(x) for x in input().split()] #inlist = [int(w) for w in input().split()] #R = float(input()) #A.append(list(map(int,input().split()))) #for line in sys.stdin.readlines(): # x, y = [int(temp) for temp in line.split()] #abc list #abc = [chr(ord('a') + i) for i in range(26)] ### output sample # print("{0} {1} {2:.5f}".format(A//B, A%B, A/B)) # print("{0:.6f} {1:.6f}".format(R*R*math.pi,R*2*math.pi)) # print(" {}".format(i), end="") # def printA(A): # for i, n in enumerate(A): # print(n, end='') # if i != N-1: # print(' ', end='') # print() # リスト内包表記 ifあり # [x-k if x != 0 else x for x in C] # ソート # N = N.sort() # 10000個の素数リスト # P = mymath.pnum_eratosthenes(105000) def is_integer(n): try: float(n) except ValueError: return False else: return float(n).is_integer() def dist(A, B): d = 0 for i in range(len(A)): d += (A[i]-B[i])**2 d = d**(1/2) return d def get_input(): N = [] while True: try: N.append(input()) #N.append(int(input())) #N.append(float(input())) except EOFError: break return N S = [x for x in input().split()] Z = {} for s in S: if s in Z.keys(): Z[s] += 1 else: Z[s] = 1 maxlen = 0 maxlenstr = '' maxnum = 0 maxnumstr = '' for z in Z: if maxlen < len(z): maxlen = len(z) maxlenstr = z if maxnum < Z[z]: maxnum = Z[z] maxnumstr = z print(maxnumstr,maxlenstr,sep=' ')
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s449056104
p00029
Accepted
from collections import Counter if __name__ == '__main__': A = input().split() c = Counter(A) ans = c.most_common(1) print(ans[0][0],max(A,key=len))
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s172077843
p00029
Accepted
s = list(map(str,input().split())) dict = {} for n in s: if n in dict: dict[n] += 1 else: dict[n] = 1 long_word = '' freq_word = '' max_len = 0 max_fre = 0 for k,v in dict.items(): if max_len < len(k): long_word = k max_len = len(k) if max_fre < v: freq_word = k max_fre = v print(freq_word,long_word)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s732599226
p00029
Accepted
from collections import Counter dic_str = {} strings = input().split() dic_str = Counter(strings) key_max = 0 val_max = 0 key_str = '' val_str = '' for k,v in dic_str.items(): if len(k) > key_max: key_max = len(k) key_str = k if v > val_max: val_max = v val_str = k print(val_str, key_str)
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>
s456678108
p00029
Accepted
wordlist = raw_input().split() maxlength = 0 lengthindex = -1 for i in range(0, len(wordlist)): length = len(wordlist[i]) if maxlength < length: maxlength = length lengthindex = i longest = wordlist[lengthindex] wordlist.sort() max = 0 cnt = 0 tmp = '' modeword = '' for i in range(0, len(wordlist)): if wordlist[i] != tmp: tmp = wordlist[i] cnt = 1 else: cnt += 1 if max < cnt: max = cnt modeword = tmp print modeword+' '+longest
Thank you for your mail and your lectures
your lectures
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces. </p> <H2>Input</H2> <p> A text is given in a line. You can assume the following conditions: </p> <ul> <li>The number of letters in the text is less than or equal to 1000.</li> <li> The number of letters in a word is less than or equal to 32.</li> <li> There is only one word which is arise most frequently in given text.</li> <li> There is only one word which has the maximum number of letters in given text.</li> </ul> <H2>Output</H2> <p> The two words separated by a space. </p> <H2>Sample Input</H2> <pre> Thank you for your mail and your lectures </pre> <H2>Output for the Sample Input</H2> <pre> your lectures </pre>