10761 - Broken Keyboard

All about problems in Volume 107. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

User avatar
_.B._
Experienced poster
Posts: 160
Joined: Sat Feb 07, 2004 7:50 pm
Location: Venezuela
Contact:

This I/O.

Post by _.B._ » Mon Jan 03, 2005 4:15 am

Greetings!
Had WA until I read these posts and tried this Input (and got this Output):

Input:

Code: Select all

eN
E
n

;
END
abcdefgHIJKLMNOPqrstUvwxY
asd
wgewer egr erg q34t e4 t434w g 3423234
END
abcdefgHIJKLMNOPqrstUvwxY
0123456789

=!"#$%&/()

END
finish
Output:

Code: Select all

+----------+----------------+-----------------------------+
| Keyboard | # of printable | Additionally, the following |
|          |      lines     |  letter keys can be broken  |
+----------+----------------+-----------------------------+
|     1    |        2       | abcdfghijklmopqrstuvwxyz    |
+----------+----------------+-----------------------------+
|     2    |        0       | z                           |
+----------+----------------+-----------------------------+
|     3    |        4       | z                           |
+----------+----------------+-----------------------------+
Keep posting!

P.S.: Got Restricted Function once :oops: I thought this time I had to use the keyboard.dat.
_.

w k
Learning poster
Posts: 74
Joined: Wed Apr 14, 2004 11:14 pm

Post by w k » Mon Jan 03, 2005 9:14 pm

Hi _.B._ !

My output is as same as Yours. I've no idea where's the problem. :cry:

Wojciech

Destination Goa
Experienced poster
Posts: 123
Joined: Thu Feb 10, 2005 4:46 am

Post by Destination Goa » Fri Feb 18, 2005 8:59 pm

I don't see where you check that the key is already broken for additional broken keys. But I think you do it somewhere if you passed sample input/output.
To be the best you must become the best!

w k
Learning poster
Posts: 74
Joined: Wed Apr 14, 2004 11:14 pm

Post by w k » Sat Feb 26, 2005 11:55 pm

Hi,

Might it be possible that - by accident - judge input data contain in the line with word "finish" additional space or another white character at the end (or beginning)? In such case my program could work wrong. Does anybody know it?

Wojciech

User avatar
Krzysztof Duleba
Guru
Posts: 584
Joined: Thu Jun 19, 2003 3:48 am
Location: Sanok, Poland
Contact:

Post by Krzysztof Duleba » Sun Feb 27, 2005 1:15 am

No, there are no additional characters (my code would fail in such case).

w k
Learning poster
Posts: 74
Joined: Wed Apr 14, 2004 11:14 pm

Post by w k » Sun Feb 27, 2005 1:56 pm

Hi,

Now I got it! :lol:

My mistake was that I recognized the lines like:

"EN D" or "E ND"

as same as "END" - what was obviously wrong.

Thanks to all who helped!

Wojciech

sakhassan
Experienced poster
Posts: 105
Joined: Sat Mar 11, 2006 9:42 am
Location: cse,DU

Post by sakhassan » Fri Nov 10, 2006 4:55 pm

Can anybuddy help me to understand
why
for input

but
one
must
not
give
up

the output is

# of printable line = 3 ????????
Thanks in advance

Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan » Fri Nov 10, 2006 7:22 pm

Read the description of the input part again. I dont want to spoil it. I am sure that you can find it.
Ami ekhono shopno dekhi...
HomePage

sakhassan
Experienced poster
Posts: 105
Joined: Sat Mar 11, 2006 9:42 am
Location: cse,DU

Post by sakhassan » Fri Nov 10, 2006 8:26 pm

Goccha !!!!!!!!!!!!! Thanks J@N .... my mistake ... i overlook it :D

User avatar
dust_cover
New poster
Posts: 23
Joined: Tue Sep 12, 2006 9:46 pm

10761--WA help plz

Post by dust_cover » Mon Nov 20, 2006 9:16 pm

Hi,
can someone give me some test cases for 10761? I have checked the previous cases in the board but cannot find my bug.

--thnx in advance!
i wanna give it a try....

Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan » Mon Nov 20, 2006 9:28 pm

Try the cases...

Input:

Code: Select all

Xyz
This problem should be easy, but you have to be 
patient
END
life
is 
sometimes
tough
but there must be a way
END
but
one 
must 
not 
give 
up
and he should keep going
END
END
END
abcdefghijklmnopqrstuvwxyz
no line can be possible
END
finish
Output:

Code: Select all

+----------+----------------+-----------------------------+
| Keyboard | # of printable | Additionally, the following |
|          |      lines     |  letter keys can be broken  |
+----------+----------------+-----------------------------+
|     1    |        2       | bcfghjklmoqrsuvw            |
+----------+----------------+-----------------------------+
|     2    |        1       | abcdjkmnpqrsvwxyz           |
+----------+----------------+-----------------------------+
|     3    |        3       | acfhjklmpqrswxyz            |
+----------+----------------+-----------------------------+
|     4    |        0       | abcfghijklmopqrstuvwxyz     |
+----------+----------------+-----------------------------+
|     5    |        0       |                             |
+----------+----------------+-----------------------------+
Hope these help.
Ami ekhono shopno dekhi...
HomePage

User avatar
dust_cover
New poster
Posts: 23
Joined: Tue Sep 12, 2006 9:46 pm

10761

Post by dust_cover » Tue Nov 21, 2006 8:31 am

hi,
thnx for the cases.

Code: Select all

Xyz
This problem should be easy, but you have to be
patient
END
life
is
sometimes
tough
but there must be a way
END
but
one
must
not
give
up
and he should keep going
END
[color=red][b]END
END[/b][/color]
abcdefghijklmnopqrstuvwxyz
no line can be possible
END
finish
But is it possible that the line itself can contain the word "END"? If yes, then how could you know the end of the test case? Do you need to count the lateset END for end of that case?

---thnx in advance!
i wanna give it a try....

sakhassan
Experienced poster
Posts: 105
Joined: Sat Mar 11, 2006 9:42 am
Location: cse,DU

Post by sakhassan » Tue Nov 21, 2006 12:24 pm

the "END " r interpreted as follows in the example....
1st end as the end of 1 input
2nd end as the broken keys
3rd end as the end of the next input
between 2nd and 3rd 'end' theres no other line except 'end' which need to be processed .....
Time that gone is gone forever ...

DD
Experienced poster
Posts: 145
Joined: Thu Aug 14, 2003 8:42 am
Location: Mountain View, California
Contact:

Re: 10761 - Broken Keyboard

Post by DD » Wed Mar 16, 2011 10:43 pm

I got some W.As because that I assume all characters at the first line of input are letters. In fact, it may not be all letters! :evil:
If you got W.A. and still don't know why, remember to check that.
Have you ever...
  • Wanted to work at best companies?
  • Struggled with interview problems that could be solved in 15 minutes?
  • Wished you could study real-world problems?
If so, you need to read Elements of Programming Interviews.

Shahidul.CSE
Experienced poster
Posts: 148
Joined: Sun Jul 13, 2014 4:32 am
Location: Rangpur, Bangladesh

Re: 10761 - Broken Keyboard

Post by Shahidul.CSE » Tue Dec 02, 2014 5:43 pm

I am getting WA. Whats wrong in my code?

Code: Select all

Code now accepted !
Last edited by Shahidul.CSE on Wed Dec 03, 2014 6:00 am, edited 1 time in total.
Md. Shahidul Islam
Dept. of CSE at Begum Rokeya University, Rangpur, Bangladesh
UVa id: http://uhunt.felix-halim.net/id/438420
My facebook account,
Email me: shahidul.cse.brur@gmail.com

Post Reply

Return to “Volume 107 (10700-10799)”