10222 - Decode the Mad man

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

Moderator: Board moderators

Qbens
New poster
Posts: 5
Joined: Fri Apr 23, 2004 11:37 pm
Location: Poland
Contact:

Post by Qbens »

3. Change

Code: Select all

case '`':
      return 'l';
for

Code: Select all

case '\'':
      return 'l';
I didn't noticed it at firs time ;]
idaydream
New poster
Posts: 1
Joined: Sat Dec 04, 2004 11:45 am

Post by idaydream »

I am not sure why you are getting PE but somethings are wrong in your code.

Code: Select all

kb['\\']='['; 

kb['\\']=';'; 
you defined same thing twice and you are missing the space ' ' char.
_______________________________________________________
Give me a place to stand and I will move the earth - Archimedes
Antonio Ocampo
Experienced poster
Posts: 131
Joined: Sat Jul 17, 2004 4:09 am
Location: Lima, Per

Post by Antonio Ocampo »

Somethings are wrong in your code. For example, for the sample input the output must be "how are you" and your output is "how are Iou" without end of line :o

You are missing the uppercase letters and the end of line.

By the way, I don't know why your code got P.E. instead of WA
Antonio Ocampo
Experienced poster
Posts: 131
Joined: Sat Jul 17, 2004 4:09 am
Location: Lima, Per

Post by Antonio Ocampo »

Somethings are wrong in your code. For example, for the sample input the output must be "how are you" and your output is "how are Iou" without end of line :o

You are missing the uppercase letters and the end of line.

By the way, I don't know why your code got P.E. instead of WA
User avatar
Ali Arman Tamal
Learning poster
Posts: 76
Joined: Sat Jan 15, 2005 5:04 pm
Location: Dhaka
Contact:

10222

Post by Ali Arman Tamal »

Hello everyone !! :)

I've seen a couple of posts about 10222 and some of them are pretty misguiding !! :roll:

I've got AC at a single submission :wink: , and allow me to remove all confusion:


1. There is no input like 'q' or 'z' for which you will have to rotate and take ']' or '/'.
There will be no merginal input. The leftmost possible input is 2, e , d , c and just replace them with `(tlide), q , a, z . You don't have to consider any other character from left.


2. Your output will not contain any UPPERCASE character.


See the judge input:

k[r dyt I[o


Output:

how are you


As you can see, the judge input contains a charcter 'I' which is replaced by 'y' NOT 'Y'.
So, all you have to do is - if you encounter any UPPERCASE character just consider them lowercase and replace them as usual.


3. There is no <SHIFT> operation. You don't have to replace * with ^ . I doubt there is any input like this, but just don't consider any <SHIFT> and you will get AC in no time.


Hope this helps you !! :D


THANK YOU VERY MUCH !!!
mohsincsedu
Learning poster
Posts: 63
Joined: Tue Sep 20, 2005 12:31 am
Location: Dhaka
Contact:

10222

Post by mohsincsedu »

May be it's a easy problem!!!
But i got WA :oops:
What's the problem :cry:

Code: Select all

#include<stdio.h>
#include<ctype.h>


int main()
{
	char kb[400];
	kb['e'] = 'q';kb['r'] = 'w';kb['t'] = 'e';kb['y'] = 'r';kb['u'] = 't';kb['i'] = 'y';kb['o'] = 'u';kb['p'] = 'i';kb['['] = 'o';kb[']'] = 'p';kb['\\'] = '[';
	kb['d'] = 'a';kb['f'] = 's';kb['g'] = 'd';kb['h'] = 'f';kb['j'] = 'g';kb['k'] = 'h';kb['l'] = 'j';kb[';'] = 'k';kb['\''] = 'l';kb['\n'] = ';';
	kb['c'] = 'z';kb['v'] = 'x';kb['b'] = 'c';kb['n'] = 'v';kb['m'] = 'b';kb[','] = 'n';kb['.'] = 'm';kb['/'] = ',';
	kb['2'] = '`';kb['3'] = '1';kb['4'] = '2';kb['5'] = '3';kb['6'] = '4';kb['7'] = '5';kb['8'] = '6';kb['9'] = '7';kb['0'] = '8';kb['-'] = '9';kb['='] = '0';kb['\\'] = '-';
	char input[3000];
	int i = 0;
	char ch;
	gets(input);
	while(input[i])
	{
		if(isalpha(input[i]))
		{
			ch = tolower(input[i]);
		}
		else
			ch = input[i];
		putchar(kb[ch]);
		i++;
	}
	printf("\n");

	return 0;
}



Plz help me!!!!!!!!!!
mohsincsedu
Learning poster
Posts: 63
Joined: Tue Sep 20, 2005 12:31 am
Location: Dhaka
Contact:

Post by mohsincsedu »

I got Acc!!! :D
  • :)
  • Thanks
TripShock
New poster
Posts: 14
Joined: Tue Jun 20, 2006 9:33 am

10222

Post by TripShock »

Can anyone find any error in this code? It compiles fine in gcc but the oj flags compile error: parse error b4 character 0222

AC
Last edited by TripShock on Sun Dec 24, 2006 10:25 pm, edited 1 time in total.
Spykaj
New poster
Posts: 47
Joined: Sun May 21, 2006 12:13 pm

Post by Spykaj »

This code get accepted :P
TripShock
New poster
Posts: 14
Joined: Tue Jun 20, 2006 9:33 am

!!!

Post by TripShock »

strange! the first time i tried it gave compile error! thnx for your time nyways!
f.a.reza
New poster
Posts: 5
Joined: Wed Oct 08, 2008 10:13 am

Re: 10222 - Decode the Mad Man

Post by f.a.reza »

what's the wrong with my code?
constantly getting wa.....

Code: Select all

#include<stdio.h>
int main()
{
char n;
 while(scanf("%c",&n)==1)
 {
 if(n=='e'||n=='E')printf("q");
else if(n=='r'||n=='R')printf("w");
else if(n=='t'||n=='T')printf("e");
else if(n=='y'||n=='Y')printf("r");
else if(n=='u'||n=='U')printf("t");
else if(n=='i'||n=='I')printf("y");
else if(n=='o'||n=='O')printf("u");
else if(n=='p'||n=='P')printf("i");
else if(n=='['||n=='{')printf("o");
else if(n==']'||n=='}')printf("p");
else if(n=='d'||n=='D')printf("a");
else if(n=='f'||n=='F')printf("s");
else if(n=='g'||n=='G')printf("d");
else if(n=='h'||n=='H')printf("f");
else if(n=='j'||n=='J')printf("g");
else if(n=='k'||n=='K')printf("h");
else if(n=='l'||n=='L')printf("j");
else if(n==';')printf("k");
else if(n==39)printf("l");
else if(n=='c'||n=='C')printf("z");
else if(n=='v'||n=='V')printf("x");
else if(n=='b'||n=='B')printf("c");
else if(n=='n'||n=='N')printf("v");
else if(n=='m'||n=='M')printf("b");
else if(n==',')printf("n");
else if(n=='.')printf("m");
else if(n=='Z'||n=='z')printf("/");
else if(n=='x'||n=='X')printf(".");
else if(n=='a'||n=='A')printf(";");
else if(n=='S'||n=='s')printf("'");
else if(n=='q'||n=='Q')printf("(");
else if(n=='W'||n=='w')printf(")");


else if(n==' ')printf(" ");



 }

return 0;
}
vahid sanei
Learning poster
Posts: 84
Joined: Fri Jan 09, 2009 4:37 pm
Location: IRAN

Re: 10222 - Decode the Mad Man

Post by vahid sanei »

you can use while(getline(cin,s)) , where "s" is a string .
inputs aren`t "q ,a, z, w, s ,x"
:wink:
Impossible says I`m possible
LucasSchm
New poster
Posts: 17
Joined: Mon May 18, 2009 10:00 pm

Re: 10222 - Decode the Mad Man

Post by LucasSchm »

Can someone tell me why i get PE with this code:

Code: Select all

The last space... Now i got AC.
Thanks
nhrahi
New poster
Posts: 6
Joined: Tue Aug 25, 2009 7:38 pm

Re: 10222 - Decode the Mad Man

Post by nhrahi »

"2, e , d , c and just replace them with `(tlide), q , a, z . You don't have to consider any other character from left."

hey,everyone. This question seems to confuse everybody.So,thanx to Ali Arman bhai who has removed all the questions.I just want to make a small addition that we dont need to have any digits here.So,`1234567890-= all this will not be considered input.
Happy problem solving.
Thanx.
noor_aub
New poster
Posts: 26
Joined: Sat Aug 22, 2009 12:16 pm

Re: 10222 - Decode the Mad Man

Post by noor_aub »

If input in 1234567890-= then what will be output

Should I print a newline.
Post Reply

Return to “Volume 102 (10200-10299)”