ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1134. Cards

PLEASE SIR READ THIS AND HELP ME OUT
Posted by sultan 21 Aug 2002 02:41
thanks u sir for your kind email i have understadn the prob fully by
your kindness but please sir there is a bit confusion here please sir
remove this confusiion by aswering theese questinons and please sir
expalin one of them please please
1) 1 2 2 3
2) 1 2 3 4 3
3) 1 1 0 3 4
Re: PLEASE SIR READ THIS AND HELP ME OUT
Posted by Vladimir Milenov Vasilev 22 Aug 2002 00:04
The first test 1 2 2 3:
The answer is "YES".
For example, first Nick takes the card with numbers 0 and 1(it is
lexicografically the first card) and reas the number 1, after that he
take the card with numbers 1 and 2 (the second card) and reads number
2, after that he takes the card with numbers 2 and 3(the 3-rd card)
and again reads number 2 and on the end he takes the card with
numbers 3 and 4 and reads number 3.
So, he has tooken 4 different cards, and the answer is "YES".

The second test 1 2 3 4 3
The answer again is "YES"
For example:
First Nick takes the card with numbers 0 and 1(the 1-st card) and
reads number 1, after that the card with numbers 1 and 2(the second)
and reads number 2, after that he takes the card with numbers 2 and 3
(the 3-rd card) and reads number 3, after that the card with numbers
4 and 5 (THE FIFTH CARD) and reads number 4 and on the end the card
with numbers 3 and 4(the 4-th card) and reads number 3.
So all the cards are different, and the answer is "YES"
The third test: 1 1 0 3 4:
The answer is "NO"
As Nick has read number 0, that is right the first card(with numbers
0 and 1) as there's no other card with numbers 0 written on it. So
there are exactly 2 cards with number 1 on it:the first(with numbers
0 and 1) and the second (with numbers 1 and 2).As Nick has olready
tooken the first, there could be only one card with number 1 on it
and so only one "1" in the input - so this case is not possible 1 1
0......
the answer is NOT.
Hope this will help :)
Thanks!I have got AC.
Posted by Tony 30 May 2003 20:21
Re: Thanks!I have got AC.
Posted by yydjtc1990 23 Aug 2005 19:45
Thanks also.
I've got ac,too.