Search found 21 matches

by ivan.cu
Mon Sep 04, 2006 5:01 am
Forum: Volume 110 (11000-11099)
Topic: 11080 - Place the Guards
Replies: 40
Views: 18297

Thank!!

Thank, i can see now that greedy no solve it.
by ivan.cu
Mon Sep 04, 2006 12:50 am
Forum: Volume 110 (11000-11099)
Topic: 11080 - Place the Guards
Replies: 40
Views: 18297

Re: Some test cases!

Help please!!!

Some one can give me test cases such not work for the following greedy algorithm:


1. Select not visit node whit max degree (N), put guard on it and count.
2. Visit all adjacent junctions and street.
3. Decrease degree for junctions adjacent to all junctions adjacent to N.
4. go to ...
by ivan.cu
Sun Sep 03, 2006 10:27 am
Forum: Volume 110 (11000-11099)
Topic: 11080 - Place the Guards
Replies: 40
Views: 18297

Some test cases!

Some one can give me test cases such not work for the greedy algorithm:


1. Select not visit node whit max degree (N), put guard on it and count.
2. Visit all adjacent junctions and street.
3. Decrease degree for junctions adjacent to all junctions adjacent to N.
4. go to 1 if remain junctions ...
by ivan.cu
Sun Aug 27, 2006 9:43 am
Forum: Volume 110 (11000-11099)
Topic: 11027 - Palindromic Permutation
Replies: 18
Views: 14348

i got AC

I found the mistake, it's at the canGenarate method, the correct is:

long long canGenerate(){
long long den = 1;
long long num = 0;
for(int i = 0; i < cant_oc; i++){
num += ocurr[real_oc[i]] / 2;
[color=red]den *= fact( ocurr[real_oc[i]] / 2 );[/color]
}

return fact(num) / den;
}


Thank ...
by ivan.cu
Sun Aug 27, 2006 5:24 am
Forum: Volume 110 (11000-11099)
Topic: 11027 - Palindromic Permutation
Replies: 18
Views: 14348

The WA persist

Now is correct for the sample above, but the WA persist.

Code: Select all

Code was remove, got AC. Thank to all for help received.
Thank Martin. You found some another sample(s)?
by ivan.cu
Sun Aug 27, 2006 2:49 am
Forum: Volume 110 (11000-11099)
Topic: 11027 - Palindromic Permutation
Replies: 18
Views: 14348

Help with my WA!!

Some one can see where is my error, here is my code. I got WA and i can't found some WA sample input.

Code: Select all

See below..
Thank, in advanced.

ivan[/code]
by ivan.cu
Mon Aug 21, 2006 4:21 pm
Forum: Volume 110 (11000-11099)
Topic: 11004 - Changing Roadmap
Replies: 9
Views: 4076

I got AC

I assume that the equation need different sing for generate a roads for negative builder, that is obviously wrong, it need same sing.

Thank.
by ivan.cu
Mon Aug 21, 2006 3:35 am
Forum: Volume 110 (11000-11099)
Topic: 11004 - Changing Roadmap
Replies: 9
Views: 4076

Why i got WA?

My algorithm not work.

For every PP (x, y):
I count the equations such that Ai*x+Bi*y+Ci < 0, be this count neg .
Increment the general result in neg *( neg - 1) / 2 and be pos = N - neg increment too in pos *( pos - 1) / 2.

That is now correct and don't occurs duplicate important places.

ivan
by ivan.cu
Fri Aug 18, 2006 11:35 pm
Forum: Volume 110 (11000-11099)
Topic: 11070 - The Good Old Times
Replies: 42
Views: 21191

I got AC!!

After ages i got AC, the problem is floating point error, first in my Java program and next in C++ program for use float instead of double. for read double use the format "%lf" in function scanf or sscanf.

Thank to all for your help.
by ivan.cu
Fri Aug 18, 2006 5:55 pm
Forum: Volume 110 (11000-11099)
Topic: 11070 - The Good Old Times
Replies: 42
Views: 21191

Re: I'm exhaust whit this problem!!

I suspect that the mistake is in floating point error whit Java, i try anything and nothing, i'm feeling bad for this, may be i make a terrible error and i cannot se it.
Well, try to rewrite it to c/c++ and you'll see if java is the issue.

I try again, now in C++ and my WA persist. Please, some ...
by ivan.cu
Tue Aug 15, 2006 1:04 am
Forum: Volume 110 (11000-11099)
Topic: 11060 - Beverages
Replies: 96
Views: 56510

I see. Please, have you some method for read input more quick. I try to use BufferedReader and i got RF.
by ivan.cu
Tue Aug 15, 2006 12:27 am
Forum: Volume 110 (11000-11099)
Topic: 11060 - Beverages
Replies: 96
Views: 56510

Thank Darko!!

After ages AC!!!

But i really don't understand this, can you explain to me what problem have:

Code: Select all

g.addEdge(Consola.readWord(), Consola.readWord());
it is exactly:

Code: Select all

String ss = Consola.readWord();
String dd = Consola.readWord();
g.addEdge(ss, dd);
or not?
by ivan.cu
Tue Aug 15, 2006 12:19 am
Forum: Volume 110 (11000-11099)
Topic: 11070 - The Good Old Times
Replies: 42
Views: 21191

I'm exhaust whit this problem!!

I suspect that the mistake is in floating point error whit Java, i try anything and nothing, i'm feeling bad for this, may be i make a terrible error and i cannot se it.
by ivan.cu
Mon Aug 14, 2006 3:39 pm
Forum: Volume 110 (11000-11099)
Topic: 11070 - The Good Old Times
Replies: 42
Views: 21191

The WA persist

Thank, what is the AC output for:

Code: Select all

-1000/-3+-1000/-3+-1000/-3-1000/-3+-1000/-3+-1000/-3
-1000/-3+-1000/-3+-1000/-3-1000/-3+-1000/-3
-1000/-3+-1000/-3+-1000/-3-1000/-3
-1000/-3+-1000/-3+-1000/-3
-1000/-3+-1000/-3
-1000/-3
by ivan.cu
Mon Aug 14, 2006 2:55 pm
Forum: Volume 110 (11000-11099)
Topic: 11060 - Beverages
Replies: 96
Views: 56510

Ok, thank. I neither can found the mistake. I really don't understand what is wrong.

Go to advanced search