11278 - One-Handed Typist

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

Moderator: Board moderators

Post Reply
Robert Gerbicz
Experienced poster
Posts: 196
Joined: Wed May 02, 2007 10:12 pm
Location: Hungary, Pest county, Halasztelek
Contact:

11278 - One-Handed Typist

Post by Robert Gerbicz »

This is a very easy rated problem using my rating, however they give only a dirty picture and on it some of the letters are unvisible, I've tried also the pdf file and done magnification but I've got only WA. I don't know why they haven't provided as a text file the old and the new layout. This means 2 wrong problems on the contest because without it the next problem is also wrong. Congratulations to the problemsetter(s).

Can somebody give me the correct layout of the old and the new keyboard?
Thanks in advance.
greve
New poster
Posts: 27
Joined: Tue May 29, 2007 8:52 pm
Contact:

Post by greve »

These are the strings I have in my AC code (I just do a linear search in each string for every character in the input).

char *l=
"`1234567890-=\
qwertyuiop[]\\\
asdfghjkl;'\
zxcvbnm,./";
char *r=
"`123qjlmfp/[]\
456.orsuyb;=\\\
789aehtdck-\
0zx,inwvg'";
char *L=
"~!@#$%^&*()_+\
QWERTYUIOP{}|\
ASDFGHJKL:\"\
ZXCVBNM<>?";
char *R=
"~!@#QJLMFP?{}\
$%^>ORSUYB:+|\
&*(AEHTDCK_\
)ZX<INWVG\"";
For help with problems, visit http://www.uvatoolkit.com/
Darko
Guru
Posts: 580
Joined: Fri Nov 11, 2005 9:34 am
Location: Calgary, Canada

Post by Darko »

I appologize to everyone because of the quality of those images. I extracted them from the original pdf files, so it got messy, but I thought they were readable. Apparently not.

Robert, after you sent me that email, I asked them to post the link to the original pdf files, which they did. It is easy to miss, because that page does not get refreshed automatically.

The problem with A and B was mainly because the new system somehow added a blank line to all input files. Which only mattered for A and B. And for a bunch of old problems - I was told they finally found the bug, at least something good came out of it.

Again, it was all my fault, nothing to do with the problem setter. Well if he was not a Mac person I could've used his original files...

Darko
Robert Gerbicz
Experienced poster
Posts: 196
Joined: Wed May 02, 2007 10:12 pm
Location: Hungary, Pest county, Halasztelek
Contact:

Post by Robert Gerbicz »

greve wrote:These are the strings I have in my AC code (I just do a linear search in each string for every character in the input).
Thanks. Now I got AC.
But WA for the next similar (easy) problem: "KEYBOARD COMPARISON", correct output for the sample input tests, I'm using here small eps to avoid precision problems ( because the answer can be an integer ).

Ps. Forget me, I've solved "keyboard comparison".
Rafsan
New poster
Posts: 1
Joined: Thu Oct 28, 2010 2:04 pm

Re: 11278 - One-Handed Typist

Post by Rafsan »

why WA


Here's my code

#include<iostream.h>
#include<stdio.h>
int main()
{
int i, j, m=39, n=34, p=32;
char a[]={"`1234567890-=\qwertyuiop[]asdfghjkl;'zxcvbnm,./"};
char c[]={"`123qjlmfp/[]456.orsuyb;=\789aehtdck-0zx,inwvg'"};
char b[]={"~!@#$%^&*()_+|QWERTYUIOP{}ASDFGHJKL:ZXCVBNM<>"};
char d[]={"~!@#QJLMFP?{}$%^>ORSUYB:+|&*(AEHTDCK)ZX<INWVG"};
char s[100];
while(gets(s))
{
for(i=0; s!='\0'; i++)
{
if(s==95)
cout<<(char)n;
else if(s==34)
cout<<"?";
else if(s==32)
cout<<(char)p;
else{
for(j=0; j<46; j++)
if(s==a[j])
cout<<c[j];
for(j=0; j<46; j++)
if(s==b[j])
cout<<d[j];
}
}
cout<<"\n";
}
return 0;
}
shuvokr
Learning poster
Posts: 66
Joined: Tue Oct 02, 2012 8:16 pm
Location: Bangladesh

Re: 11278 - One-Handed Typist WA

Post by shuvokr »

Code: Select all

                                                                   Accepted

Code: Select all

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

Re: 11278 - One-Handed Typist

Post by Shahidul.CSE »

Code: Select all

Removed after accepted !
Last edited by Shahidul.CSE on Mon Aug 18, 2014 4:24 pm, 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
lighted
Guru
Posts: 587
Joined: Wed Jun 11, 2014 9:56 pm
Location: Kyrgyzstan, Bishkek

Re: 11278 - One-Handed Typist

Post by lighted »

Input

Code: Select all

{
Acc output

Code: Select all

:
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman
Shahidul.CSE
Experienced poster
Posts: 148
Joined: Sun Jul 13, 2014 4:32 am
Location: Rangpur, Bangladesh

Re: 11278 - One-Handed Typist

Post by Shahidul.CSE »

Thank you, lighted! it is a silly mistake!
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
Shahidul.CSE
Experienced poster
Posts: 148
Joined: Sun Jul 13, 2014 4:32 am
Location: Rangpur, Bangladesh

Re: 11278 - One-Handed Typist

Post by Shahidul.CSE »

Code: Select all

Removed after accepted !
Last edited by Shahidul.CSE on Mon Aug 18, 2014 4:23 pm, 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
lighted
Guru
Posts: 587
Joined: Wed Jun 11, 2014 9:56 pm
Location: Kyrgyzstan, Bishkek

Re: 11278 - One-Handed Typist

Post by lighted »

"%" is a specifier character for printf, so you can't print "%" directly. (But my Borland5.5 compiler prints it). :)
Change line

Code: Select all

else if(str[i]=='W')
             printf("%");
It must be

Code: Select all

else if(str[i]=='W')
             printf("%%");
Or

Code: Select all

else if(str[i]=='W')
             putchar('%');
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman
Shahidul.CSE
Experienced poster
Posts: 148
Joined: Sun Jul 13, 2014 4:32 am
Location: Rangpur, Bangladesh

Re: 11278 - One-Handed Typist

Post by Shahidul.CSE »

Thank you, got accepted ! :D :D
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 112 (11200-11299)”