10019 - Funny Encryption Method

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

Moderator: Board moderators

User avatar
emotional blind
A great helper
Posts: 383
Joined: Mon Oct 18, 2004 8:25 am
Location: Bangladesh
Contact:

Post by emotional blind » Thu May 04, 2006 8:41 pm

Ok I have edited my post
Thanks for helping me by showing my bad habit.

serur
A great helper
Posts: 251
Joined: Thu Feb 23, 2006 11:30 pm

Post by serur » Thu May 04, 2006 9:44 pm

Hi fellows!

This toipic was very helpful to me, thanks!
But how to imitate end of line/newline/line break in the input?
Last edited by serur on Sat Apr 14, 2012 3:36 pm, edited 1 time in total.

Darko
Guru
Posts: 580
Joined: Fri Nov 11, 2005 9:34 am
Location: Calgary, Canada

Post by Darko » Thu May 04, 2006 9:54 pm

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:

Code: Select all

app < in
Or if you want to print output to a file (call it "out"):

Code: Select all

app < in > 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 :)

serur
A great helper
Posts: 251
Joined: Thu Feb 23, 2006 11:30 pm

Post by serur » Thu May 04, 2006 11:06 pm

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.
Last edited by serur on Sat Nov 11, 2006 3:21 pm, edited 1 time in total.

User avatar
emotional blind
A great helper
Posts: 383
Joined: Mon Oct 18, 2004 8:25 am
Location: Bangladesh
Contact:

Post by emotional blind » Fri May 05, 2006 11:26 am

Funny Encryption method
Problem Number?

serur
A great helper
Posts: 251
Joined: Thu Feb 23, 2006 11:30 pm

Post by serur » Fri May 05, 2006 12:54 pm

Hi emotional blind!

10019 I believe

User avatar
emotional blind
A great helper
Posts: 383
Joined: Mon Oct 18, 2004 8:25 am
Location: Bangladesh
Contact:

Post by emotional blind » Sat May 06, 2006 6:55 pm

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

serur
A great helper
Posts: 251
Joined: Thu Feb 23, 2006 11:30 pm

Post by serur » Sun May 07, 2006 9:07 am

Thank you man!

kolpobilashi
Learning poster
Posts: 54
Joined: Mon Jan 02, 2006 3:06 am
Location: Dhaka,Bangladesh
Contact:

10019sumbuddy help me!!!

Post by kolpobilashi » Tue Jun 20, 2006 8:45 pm

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 ( :roll: )
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

User avatar
emotional blind
A great helper
Posts: 383
Joined: Mon Oct 18, 2004 8:25 am
Location: Bangladesh
Contact:

Post by emotional blind » Tue Jun 20, 2006 11:17 pm

size of rem[10] is too small increase it to 14
the binary of 9999 need greater than 10 digit.

kolpobilashi
Learning poster
Posts: 54
Joined: Mon Jan 02, 2006 3:06 am
Location: Dhaka,Bangladesh
Contact:

Post by kolpobilashi » Wed Jun 21, 2006 4:52 am

thanx a lotttt again Arif bhai..... :D
but when i will be able to fix such silly problems myself!! :(
Sanjana

User avatar
emotional blind
A great helper
Posts: 383
Joined: Mon Oct 18, 2004 8:25 am
Location: Bangladesh
Contact:

Post by emotional blind » Wed Jun 21, 2006 4:09 pm

practice makes a man perfect, you know!

chetan
New poster
Posts: 43
Joined: Sun Sep 24, 2006 2:39 pm

10019--- compile error

Post by chetan » Sun Oct 08, 2006 11:21 am

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.....

Code: Select all


CODE DELETED AFTER AC :-) 

ranacse05
New poster
Posts: 37
Joined: Wed Mar 28, 2007 5:08 pm
Location: Rajshahi
Contact:

10019 Why Compile Error

Post by ranacse05 » Fri Mar 30, 2007 1:32 am

My code is here :
*************code removed***************
Last edited by ranacse05 on Tue Apr 24, 2007 7:48 pm, edited 2 times in total.

nymo
Experienced poster
Posts: 149
Joined: Sun Jun 01, 2003 8:58 am
Location: :)

Post by nymo » Fri Mar 30, 2007 2:04 pm

conio.h is a non standard header. NEVER include this header in files to be submitted in UVa.
If you are uncertain about other functions or headers, try checking their portability first.

NEVER open a new thread when there are already many...
regards,
nymo

Post Reply

Return to “Volume 100 (10000-10099)”