11278 - One-Handed Typist

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

Moderator: Board moderators

11278 - One-Handed Typist

Postby Robert Gerbicz » Sat Sep 15, 2007 9:28 pm

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.
Robert Gerbicz
Experienced poster
 
Posts: 196
Joined: Wed May 02, 2007 10:12 pm
Location: Hungary, Pest county, Halasztelek

Postby greve » Sat Sep 15, 2007 9:46 pm

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/
greve
New poster
 
Posts: 27
Joined: Tue May 29, 2007 8:52 pm

Postby Darko » Sat Sep 15, 2007 10:03 pm

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
Darko
Guru
 
Posts: 572
Joined: Fri Nov 11, 2005 9:34 am
Location: Calgary, Canada

Postby Robert Gerbicz » Sat Sep 15, 2007 11:39 pm

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".
Robert Gerbicz
Experienced poster
 
Posts: 196
Joined: Wed May 02, 2007 10:12 pm
Location: Hungary, Pest county, Halasztelek

Re: 11278 - One-Handed Typist

Postby Rafsan » Mon Nov 01, 2010 9:40 am

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[i]!='\0'; i++)
{
if(s[i]==95)
cout<<(char)n;
else if(s[i]==34)
cout<<"?";
else if(s[i]==32)
cout<<(char)p;
else{
for(j=0; j<46; j++)
if(s[i]==a[j])
cout<<c[j];
for(j=0; j<46; j++)
if(s[i]==b[j])
cout<<d[j];
}
}
cout<<"\n";
}
return 0;
}
Rafsan
New poster
 
Posts: 1
Joined: Thu Oct 28, 2010 2:04 pm

Re: 11278 - One-Handed Typist WA

Postby shuvokr » Tue Mar 26, 2013 7:42 pm

Code: Select all
                                                                   Accepted
shuvokr
New poster
 
Posts: 28
Joined: Tue Oct 02, 2012 8:16 pm


Return to Volume CXII

Who is online

Users browsing this forum: No registered users and 1 guest