10019 - Funny Encryption Method
Moderator: Board moderators
-
- A great helper
- Posts: 383
- Joined: Mon Oct 18, 2004 8:25 am
- Location: Bangladesh
- Contact:
Usually it is ctrl+D, but it doesn't have to work. So you keep typing happily, newlines and all and end it with ctrl+D.
What OP is probably asking is "How do I do this standard I/O thingy?"
Redirection - make an input file (call it , for example, "in"). If your program is "app", then you just do:
Or if you want to print output to a file (call it "out"):
That way you can compare results directly (and if you have diff installed, it is much easier then going through the outputs line-by-line and it catches whitespace difference, too)
I hope that is what he wanted to know :)
What OP is probably asking is "How do I do this standard I/O thingy?"
Redirection - make an input file (call it , for example, "in"). If your program is "app", then you just do:
Code: Select all
app < in
Code: Select all
app < in > out
I hope that is what he wanted to know :)
Thank you, Darko!
One more question, please.
"Funny Encryption method"- please, explain, how they got hexadecimal representation of 265, and it's binary ?
I think 265==16*16+9, which is A09 in hexadecimal, then we substitute: A=1010, 9=1001, how we got 5 ?
Thank you.
One more question, please.
"Funny Encryption method"- please, explain, how they got hexadecimal representation of 265, and it's binary ?
I think 265==16*16+9, which is A09 in hexadecimal, then we substitute: A=1010, 9=1001, how we got 5 ?
Thank you.
Last edited by serur on Sat Nov 11, 2006 3:21 pm, edited 1 time in total.
-
- A great helper
- Posts: 383
- Joined: Mon Oct 18, 2004 8:25 am
- Location: Bangladesh
- Contact:
-
- A great helper
- Posts: 383
- Joined: Mon Oct 18, 2004 8:25 am
- Location: Bangladesh
- Contact:
In second case you have to consider 265 as hexadecimal number,
as the problem description says (so dont convert dec to hex)
now 2=0010, 6=0110,5=0101
b2=5, OK?
Why did you not post it here,
http://online-judge.uva.es/board/viewforum.php?f=9
as the problem description says (so dont convert dec to hex)
now 2=0010, 6=0110,5=0101
b2=5, OK?
Why did you not post it here,
http://online-judge.uva.es/board/viewforum.php?f=9
-
- Learning poster
- Posts: 54
- Joined: Mon Jan 02, 2006 3:06 am
- Location: Dhaka,Bangladesh
- Contact:
10019sumbuddy help me!!!
perhaps i am thinking in a wrong way...for the 2nd part of this problem i am doing it by, converting each digit to the corresponding binary no. and count the no. of 1s, as per as i know this is also another way to convert a decimal no to hex and then binary (
)
i got WA for the code below....

i got WA for the code below....

Last edited by kolpobilashi on Wed Jun 21, 2006 4:48 am, edited 1 time in total.
Sanjana
-
- A great helper
- Posts: 383
- Joined: Mon Oct 18, 2004 8:25 am
- Location: Bangladesh
- Contact:
-
- Learning poster
- Posts: 54
- Joined: Mon Jan 02, 2006 3:06 am
- Location: Dhaka,Bangladesh
- Contact:
-
- A great helper
- Posts: 383
- Joined: Mon Oct 18, 2004 8:25 am
- Location: Bangladesh
- Contact:
10019--- compile error
hello people. here is my code for the problem funny encryption.
i get CE . can anybody help me out.
i just count the number of 1 in the binary representation directly..........
here's my code.....
i get CE . can anybody help me out.
i just count the number of 1 in the binary representation directly..........
here's my code.....
Code: Select all
CODE DELETED AFTER AC :-)
10019 Why Compile Error
My code is here :
*************code removed***************
*************code removed***************
Last edited by ranacse05 on Tue Apr 24, 2007 7:48 pm, edited 2 times in total.