<PREV Problem:
NEXT>
Solved by 591 users: ...
UserDateAttemptTimeCMSC
xtender08 aug 2010Perl3600.0655 
Nakilon08 aug 2010Ruby3100.0256 
xtender08 aug 2010Perl3500.0656 
xtender20 apr 2010Perl2900.0657 
xtender08 aug 2010Perl3000.0657 
Nakilon24 apr 2010Ruby2900.0258 
Nakilon20 apr 2010Ruby2500.0259 
Nakilon24 apr 2010Ruby2700.0260 
xtender20 apr 2010Perl2500.0661 
Nakilon20 apr 2010Ruby2400.0264 
bryndin08 may 2011Python700.06117 
s9730230 jan 2010Ruby1600.03118 
Belthazor20 apr 2012Python700.06119 
s9730230 jan 2010Ruby1400.02122 
big-piglet08 mar 2008Ruby100.03125 
s9730230 jan 2010Ruby1300.02126 
evg28112 sep 2008Perl200.16128 
svirg16 jul 2007Python700.19129 
bush04 apr 2006Ruby800.02136 
bush04 apr 2006Ruby700.02139 
lodin05 sep 2006Perl100.06145 
Languages
C++
363
FPC
90
C
56
Java
38
Kylix
17
Python
12
Perl
12
Ruby
9
Lua
1
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 

Correct dictionary

Time limit = 5 seconds

Correct dictionary consists of definitions which use only correctly defined terms or axiomatic terms.

Correct dictionary should not have "cyclic definitions".

Correct dictionary should not have more than one definition of one term.

You are to determine whether input dictionary is correct.

Input First line of input contains the number of definitions D < 1000. Then D lines follow. Each line begins with defined term. Then number Ni < 20 of terms used in it's definition and terms themselves folow. Term length less than 20 letters.

Output Output should contain one line with word "CORRECT" or "NOT CORRECT".

Input#1
2
aaa 3 bbb ccc ddd
bbb 1 ccc
Output#1
CORRECT
Input#2
2
think 2 mind intellect
mind 1 think
Output#2
NOT CORRECT
Input#3
2
aaa 1 a 
aaa 2 c d
Output#3
NOT CORRECT

Author:
Voroztsov Artem
31 May 2003

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


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

SW soft NIX
ID = 18.207.240.35