<PREV Problem:
NEXT>
Solved by 131 users: ...
UserDateAttemptTimeCMSC
sb3ar28 feb 2008Ruby1303.5768 
sb3ar07 jan 2008Ruby1103.5273 
asp03 jun 2008Ruby303.6996 
david_it2117 apr 2008Ruby103.63102 
Kuznetsov_S10 jan 2008Ruby603.99135 
var04 dec 2007Ruby305.40142 
svg04 mar 2009Ruby205.95181 
m12sl04 nov 2008Python1007.63193 
m12sl04 nov 2008Python907.47204 
abortmozga.ru27 jul 2009C++501.38206 
nishant04 dec 2007Java101.87216 
MasterYoda01 mar 2009C++1201.56220 
abortmozga.ru27 jul 2009C++301.17226 
Languages
C++
95
Java
17
Kylix
6
Ruby
6
FPC
6
Python
1
C
1
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 

Anti-plagiarism

Time limit = 2 second(s)

Your are given set of documents. Each document is set of words.

You should find two documents having maximum number of words in their intersection (duplicates should be removed).

Input The first line contains number of documents N, 2 ≤ N ≤ 100. Then N lines follow. Each line contain words delimited by while space. A word could repeat several times in one document. Number of words in one document is less than 501. Word length is up to 100 letters. But average word length is 5 — 10 letters.

Output The first line should contain max intersection size. Next line — two documents identifiers (output any correct pair). Document identifier corresponds to line number in input. The first document has id equal to 0.

Input#1
3
aa bb cc cc
dd bb aa dd gg cc dd
dd dd dd cc gg
Output#1
3
0 1

Author:
Artem Voroztsov, Personal MIPT contest, 7 October 2007
4 December 2007

<PREV | Problem set | Search related messages | NEXT>


© acm.mipt DevGroup
The page was generated in 210ms

SW soft NIX
ID = 3.214.224.224