Search found 7 matches

Fri Jul 28, 2006 10:10 am
Forum: Volume 110 (11000-11099)
Topic: 11052 - Economic phone calls
Replies: 26
Views: 11259
Can you explain the greedy approach for this problem, #11052?
And what is the correct output for this input?

Code: Select all

``````1
07:21:14:00 1337 -
0
``````
Wed Jul 19, 2006 2:21 pm
Forum: Volume 110 (11000-11099)
Topic: 11001 - Necklace
Replies: 38
Views: 16849

Why WA?

Can someone help me why I get WA for this problem? I've checked all the test case here and my program outputs the correct numbers, but WA! :( In my code, if Vt % (2*V0) is zero I output Vt / (2*V0) as n, and if it is not zero, I check which of n1=Vt/(2*V0) & n2=Vt/(2*V0) produces a bigger length, an...
Sat Oct 29, 2005 8:22 am
Forum: Volume 101 (10100-10199)
Topic: 10130 - SuperSale
Replies: 76
Views: 22110

Thanks!

AC at last!
Thanks for your help. I changed my algo, it was wrong but it didn't show
easily.
May I ask a question? How do you generate random inputs?
Thanks again.
Tue Oct 25, 2005 10:44 pm
Forum: Volume 101 (10100-10199)
Topic: 10130 - SuperSale
Replies: 76
Views: 22110

You're right!

So so sorry! You're right. The code I've posted here outputs 193. :oops: This the code which outputs 237 and gets WA: # include <iostream.h> # include <limits.h> # include <string.h> //# include <fstream.h> char st[31][10001]; void main(){ //ifstream cin("10130.in") ; int po[1000],w[1000],mw[31],mp[...
Mon Oct 24, 2005 6:23 pm
Forum: Volume 101 (10100-10199)
Topic: 10130 - SuperSale
Replies: 76
Views: 22110
Sorry for the delay. :oops: I checked the input you mentioned and my output was 237!!?? Could you please check it again? I always write my codes in this format and never get Compile Error in UVA. Can you tell what the compiler you use is? I use 'MS Visual C++'. Is it possible the difference in the o...
Fri Sep 23, 2005 7:49 am
Forum: Volume 101 (10100-10199)
Topic: 10130 - SuperSale
Replies: 76
Views: 22110

Thanks for paying attention.

I use DP. And I just sort the objects according to their weight for a little optimization and nothing else! This is what I do:
The array
Tue Aug 30, 2005 3:11 pm
Forum: Volume 101 (10100-10199)
Topic: 10130 - SuperSale
Replies: 76
Views: 22110

10130

Coulde someone help me about this problem ,please? I've checked test cases in the board and output correctly, but still get wrong answer. :x This is my code: # include <iostream.h> //# include <fstream.h> void main(){ int op[1000],ow[1000],pw[35],pp[35]; int sw[35][1001]; int len[35]; int i,j,k,t,n,...