Search found 72 matches

by mak(cse_DU)
Tue Jun 22, 2010 3:26 pm
Forum: Volume 112 (11200-11299)
Topic: 11270 - Tiling Dominoes
Replies: 6
Views: 3537

Re: 11270 - Tiling Dominoes

I pre-calculated all M*N value in a 2D array.
Complexity O(10 * 2^10 * 2^10) .
State F(Row,Mask) .
But my timing 0.044.:(

Some Input/Output for future reference:

Code: Select all

34 2
10 10
8 9
3 3
3 10
4 20
4 25
0 3
9 11
8 12
AC output:

Code: Select all

9227465
258584046368
108435745
0
571
616891945
114079985111
0
0
82741005829
by mak(cse_DU)
Wed Jun 16, 2010 2:41 pm
Forum: Volume 112 (11200-11299)
Topic: 11262 - Weird Fence
Replies: 16
Views: 7449

Re:

I found my bug :-? Misunderstood the problem statement, the word "linear distance", I thought it's Manhattan :o Anyway, some tests for who still get WA 12 2 1 5 0 red 1 2 blue 3 1 -1000 -1000 blue 0 0 blue 1000 1000 red 4 20 -1000 -1000 blue -1000 1000 red 1000 -1000 red 1000 1000 blue 4 2 -1000 -1...
by mak(cse_DU)
Mon May 31, 2010 4:19 pm
Forum: Volume 107 (10700-10799)
Topic: 10745 - Dominant Strings
Replies: 38
Views: 17188

Re: 10745 - Dominant Strings

I was stuck in this problem several hours.
After generating some random inputs, I got the error.
Here it is:
Input:

Code: Select all

a
ab
AC output:

Code: Select all

ab
Also try :

Code: Select all

ab
a
by mak(cse_DU)
Wed May 19, 2010 7:41 pm
Forum: Volume 100 (10000-10099)
Topic: 10090 - Marbles
Replies: 43
Views: 22316

Re: 10090 - Marbles

Pedro wrote:Can anyone tell me why the answer is wrong?

input
133356304
1870 8365
2572 3204

output
3076 33591

If you can say where is my mistake i will be thankful
Try this:

Code: Select all

100
1 2
2 4    
100
2 2
1 4
133356304
1870 8365
2572 3204
0
AC output:

Code: Select all

0 25
0 25
15892 131
by mak(cse_DU)
Sat May 01, 2010 8:13 am
Forum: Volume 104 (10400-10499)
Topic: 10483 - The Sum Equals the Product
Replies: 21
Views: 10948

Re: 10483 - The Sum Equals the Product

Some one who are getting WA after counting 354 outputs in total. Check start and end of your output. 5.25 = 1.50 + 1.75 + 2.00 = 1.50 * 1.75 * 2.00 //1st output 5.40 = 1.50 + 1.50 + 2.40 = 1.50 * 1.50 * 2.40 5.46 = 1.40 + 1.56 + 2.50 = 1.40 * 1.56 * 2.50 5.49 = 1.25 + 1.80 + 2.44 = 1.25 * 1.80 * 2.4...
by mak(cse_DU)
Fri Apr 30, 2010 4:00 pm
Forum: Volume 104 (10400-10499)
Topic: 10426 - Knights' Nightmare
Replies: 17
Views: 7776

Re: 10426: something odd WA/PE

[c] printf("Minimum time required is %u minute%s.\n", min_meet, (min_meet == 1 || min_meet == 0)?"":"s"); [/c] this is equivalent to : [c]printf("Minimum time required is %u minute",min_meet); if(min_meet>1) printf("s"); printf(".\n"); [/c] Never confused. The AC output format is: printf("Minimum t...
by mak(cse_DU)
Mon Apr 26, 2010 6:57 pm
Forum: Volume 4 (400-499)
Topic: 452 - Project Scheduling
Replies: 23
Views: 9889

Re: 452, Why WA

For this problem, I assume that there will not be any circle in the given graph and there will atleast be one node which will not have any preceding node (I call it starting node). I run DFS() from all the starting nodes and update the costs of the tasks/nodes connected to it. Where is my mistake. ...
by mak(cse_DU)
Sat Apr 24, 2010 6:42 pm
Forum: Volume 104 (10400-10499)
Topic: 10447 - Sum-up the Primes (II)
Replies: 10
Views: 5242

Re: 10447: sum up the primes (II)

makbet wrote:Okay, I optimized it a little, and
now I get wrong anwser.
Help!!!!!!!
Please give me the optimization.
My complexity:
Memory: 62*800*12*2
Time: 62*800*12*2*4 //maximum frequency 4.
by mak(cse_DU)
Tue Apr 20, 2010 4:44 pm
Forum: Volume 106 (10600-10699)
Topic: 10605 - Mines For Diamonds
Replies: 22
Views: 7623

Re: 10605

i just got ac. i noticed that each diamond must connect to another diamond or the wall. i wonder how you guys solved this problem,and whether my algo was right? :roll: You are right "Ziliang". I solved is using DP(TSP). It will help some one: 1 5 11 ########### #.........# #..**.....# #.........# #...
by mak(cse_DU)
Sun Apr 18, 2010 4:49 pm
Forum: Volume 104 (10400-10499)
Topic: 10491 - Cows and Cars
Replies: 17
Views: 8385

Re: 10491 - Cows and Cars

!!!!!!!!!!!!!!!!!!
With adding eps=1e-8 gave me WA.
With discarding this eps I got AC.
Surprise.
by mak(cse_DU)
Sat Apr 17, 2010 2:01 pm
Forum: Volume 104 (10400-10499)
Topic: 10449 - Traffic
Replies: 58
Views: 21781

Re:

I still got WA .... Could anyone tell me what's maybe wrong or give me some additional test cases ? I become right results for sample input and for Adrian tests ... Regards Dominik I just solve it using modified BFS( surely using queue( not priority_queue)). try this input: 6 6 7 8 9 10 100 6 1 2 2...
by mak(cse_DU)
Sat Apr 17, 2010 9:05 am
Forum: Volume 102 (10200-10299)
Topic: 10243 - Fire! Fire!! Fire!!!
Replies: 12
Views: 6426

Re:

The case of an isolated gallery cannot happen without violating the problem specification. It says that n(i) >= 1. So an isolated point would have n(i) = 0. Apparently this case is in the input but it does violate the problem statement. Yes the critical case is: 1 0 output should be: 1 Noticeable s...
by mak(cse_DU)
Fri Apr 16, 2010 7:16 pm
Forum: Volume 114 (11400-11499)
Topic: 11419 - SAM I AM
Replies: 21
Views: 10615

Re: 11419 - Sam I Am

WooW.
It is a nice minimum vertex cover problem for bipartite graph.
Thanks Jan vaia.
by mak(cse_DU)
Fri Jan 01, 2010 6:07 pm
Forum: Volume 5 (500-599)
Topic: 507 - Jill Rides Again
Replies: 92
Views: 30033

Re: 507 - Jill rides again

Thanx Mak I got AC in 0.124 secs but I see many people getting AC in 0.000 sec! What optimization could be done here? No Need to optimize it farther. You time is Ok enough. If you still interested then: 1. scanf() instead of cin and printf instead of cout. 2. reduce branch instruction if possible. ...
by mak(cse_DU)
Thu Dec 24, 2009 7:16 pm
Forum: Volume 5 (500-599)
Topic: 507 - Jill Rides Again
Replies: 92
Views: 30033

Re: 507 - Jill rides again

shankhs wrote:Help
check the below input:

Code: Select all

    1
    11
      1
      1
      1
      -100
      2
      2
      -100
      1
      1
    1
Correct output:

Code: Select all

    The nicest part of route 1 is between stops 5 and 7
Your's giving:

Code: Select all

    The nicest part of route 1 is between stops 5 and 4

Go to advanced search