11278 - One-Handed Typist
Moderator: Board moderators
-
- Experienced poster
- Posts: 196
- Joined: Wed May 02, 2007 10:12 pm
- Location: Hungary, Pest county, Halasztelek
- Contact:
11278 - One-Handed Typist
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.
Can somebody give me the correct layout of the old and the new keyboard?
Thanks in advance.
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\"";
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/
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, 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
-
- Experienced poster
- Posts: 196
- Joined: Wed May 02, 2007 10:12 pm
- Location: Hungary, Pest county, Halasztelek
- Contact:
Thanks. Now I got AC.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).
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".
Re: 11278 - One-Handed Typist
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;
}
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;
}
-
- Experienced poster
- Posts: 148
- Joined: Sun Jul 13, 2014 4:32 am
- Location: Rangpur, Bangladesh
Re: 11278 - One-Handed Typist
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
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
Re: 11278 - One-Handed Typist
Input
Acc output
Code: Select all
{
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
-
- Experienced poster
- Posts: 148
- Joined: Sun Jul 13, 2014 4:32 am
- Location: Rangpur, Bangladesh
Re: 11278 - One-Handed Typist
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
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
-
- Experienced poster
- Posts: 148
- Joined: Sun Jul 13, 2014 4:32 am
- Location: Rangpur, Bangladesh
Re: 11278 - One-Handed Typist
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
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
Re: 11278 - One-Handed Typist
"%" is a specifier character for printf, so you can't print "%" directly. (But my Borland5.5 compiler prints it).
Change line
It must be
Or
Change line
Code: Select all
else if(str[i]=='W')
printf("%");
Code: Select all
else if(str[i]=='W')
printf("%%");
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
-
- Experienced poster
- Posts: 148
- Joined: Sun Jul 13, 2014 4:32 am
- Location: Rangpur, Bangladesh
Re: 11278 - One-Handed Typist
Thank you, got accepted !
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
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