Search found 78 matches

by Articuno
Mon Dec 29, 2008 8:40 pm
Forum: Volume 102 (10200-10299)
Topic: 10298 - Power Strings
Replies: 31
Views: 13342

Re: 10298 - Power Strings

Can anyone tell me that, is it possible to pass the time limit using brute force in this problem? I tried brute force but got TLE. Or is there any sort of algorithm for this type of problems? Please someone reply.
by Articuno
Sun Dec 28, 2008 11:16 pm
Forum: Volume 115 (11500-11599)
Topic: 11571 - Simple Equations - Extreme!!
Replies: 31
Views: 11072

Re: 11571 Simple Equations - Extreme!!

I solved "Simple Equations" using brute force method. That solution will certainly get TLE for this problem. Can anyone give some hints please?
Thanks in advance.
by Articuno
Sun Dec 28, 2008 8:44 pm
Forum: Volume 115 (11500-11599)
Topic: 11565 - Simple Equations
Replies: 21
Views: 5789

Re: 11565 Simple Equations WA!!!

The reason is described in the first line of the problem descryption. :D
We have three different integers, x, y and z,
by Articuno
Sun Dec 28, 2008 4:52 pm
Forum: Volume 115 (11500-11599)
Topic: 11567 - Moliu Number Generator
Replies: 13
Views: 4016

Re: 11567 Moliu Number Generator WA!!!

Just use long long instead of long :D
by Articuno
Sun Dec 28, 2008 11:29 am
Forum: Volume 115 (11500-11599)
Topic: 11567 - Moliu Number Generator
Replies: 13
Views: 4016

Re: 11567 Moliu Number Generator WA!!!

You dont need every possible way.
One way is enough. Greedy choice.Think about this:

After decrementing 125 we get 124 and 124/2=62, 62 is divisible by 2.
But if we increment 125 we get 126 and 126/2=63, 63 is not divisible by 2.

Do you get my point why 124 comes after 125 instead of 126?
by Articuno
Sun Dec 28, 2008 11:11 am
Forum: Volume 115 (11500-11599)
Topic: 11567 - Moliu Number Generator
Replies: 13
Views: 4016

Re: 11567 Moliu Number Generator WA!!!

I used a straight forward approach.
I am illustrating for 2000. The logic is similar to all other cases.

2000
1000
500
250
125[inc or dec?]
124
62
31[inc or dec?]
32
16
8
4
2
1
0
Now we got the number of steps. Try to find the answer where to inc and where to dec.
Hope it will help.
by Articuno
Sun Dec 28, 2008 10:51 am
Forum: Volume 115 (11500-11599)
Topic: 11567 - Moliu Number Generator
Replies: 13
Views: 4016

Re: 11567 Moliu Number Generator WA!!!

Try these test cases:

Code: Select all

2000000000
2000000001
1999999999
1888888888
2111111111
1000000000
9999999
1001
2000
3333
4
5
0
The output should be:

Code: Select all

40
41
41
41
40
39
32
14
14
16
3
4
0
Hope it will help. :)
by Articuno
Sat Dec 27, 2008 8:33 am
Forum: Volume 100 (10000-10099)
Topic: 10035 - Primary Arithmetic
Replies: 328
Views: 57090

Re: 10035 - Primary Arithmetic

@sazzadcsedu,
When your x is greater than 9, you set carry to 1. But if x<=9 the carry should be set to 0. You forgot that.
Good luck.
by Articuno
Thu Dec 25, 2008 11:20 pm
Forum: Volume 3 (300-399)
Topic: 356 - Square Pegs And Round Holes
Replies: 41
Views: 6383

Re: 356 WA

I thought this is an easy problem but stuck. Can't figure out the way. Can anyone help me with some hints about how to solve this problem?.My geometry is very poor. Please help me.
Thanks in advance.
by Articuno
Wed Dec 24, 2008 6:35 pm
Forum: Volume 106 (10600-10699)
Topic: 10602 - Editor Nottoobad
Replies: 19
Views: 11293

Re: 10602 - Editor Nottobad

AC at last. :)
If anyone getting WA, try the following case:

Code: Select all

1
4
abcd
abxy
abuv
abxy
One possible result is:

Code: Select all

8
abcd
abuv
abxy
abxy
by Articuno
Wed Dec 24, 2008 5:00 pm
Forum: Volume 106 (10600-10699)
Topic: 10602 - Editor Nottoobad
Replies: 19
Views: 11293

Re: 10602 - Editor Nottobad

I am getting WA. Don't know why. Can anyone give me some test cases please?
Thanks in advance.
by Articuno
Wed Dec 24, 2008 11:49 am
Forum: Volume 100 (10000-10099)
Topic: 10000 - Longest Paths
Replies: 160
Views: 36168

Re: 10000 - Longest Path

You can use BFS to find the longest path. I used that and got AC.
by Articuno
Wed Dec 24, 2008 11:40 am
Forum: Volume 104 (10400-10499)
Topic: 10450 - World Cup Noise
Replies: 42
Views: 19963

Re: 10450 - World Cup Noise

Print a newline after each block of output.
by Articuno
Mon Dec 22, 2008 12:37 am
Forum: Volume 104 (10400-10499)
Topic: 10496 - Collecting Beepers
Replies: 19
Views: 10017

Re: 10496 - Collecting Beepers

Thank you mf. I will try to sove it using BFS. Thanks for ur help. :)
by Articuno
Sun Dec 21, 2008 3:15 pm
Forum: Volume 104 (10400-10499)
Topic: 10496 - Collecting Beepers
Replies: 19
Views: 10017

Re: 10496 - Collecting Beepers

Please someone tell me whether this problem can be solved using BFS and greedy. I was trying to do so instead of backtracking. But WA. Can someone give me some critical test cases ? Please someone help me.
Thanks in advance.

Go to advanced search