## Search found 214 matches

Tue Jun 21, 2005 9:48 am
Forum: Volume 103 (10300-10399)
Topic: 10397 - Connect the Campus
Replies: 75
Views: 26413
Could someone give any ideas of why that problem surprisingly happens to be so hard although it is a standard MST problem ? Other threads about this problem 10397 are: http://online-judge.uva.es/board/viewtopic.php?t=1686 and http://online-judge.uva.es/board/viewtopic.php?t=2957 Is the test data po...
Thu Jun 16, 2005 10:08 am
Forum: Off topic (General chit-chat)
Topic: I win !!
Replies: 361
Views: 124873
CodeMaker wrote: but still there is no closed form for this game. it is theoritically an infinite serise oops! i mean thread.
Actually there is a way to win this game. I wouldn't do it though...

Ciao!!!

Claudio
Tue Jun 14, 2005 10:40 am
Forum: Volume 3 (300-399)
Topic: 336 - A Node Too Far
Replies: 121
Views: 41384
Hello all, 1. Is Claudio's output from an ACC program ? I guess so. Surely, the fastest one ATM ;) I tend to think ( I am quite sure ) Claudio does the same in his program and it seems mf does the opposite ( does not define new vertices in such cases ). At least that explains perfectly the differen...
Tue Jun 14, 2005 9:33 am
Forum: Volume 102 (10200-10299)
Topic: 10276 - Hanoi Tower Troubles Again!
Replies: 9
Views: 6694
Sedefcho wrote:You can not rewrite the formula in that way, Claudio.
That's because the division Yatsen gives in his formula
is an integer division.
You're right, too careless of me...

Ciao!!!

Claudio
Fri Jun 10, 2005 9:14 am
Forum: Volume 108 (10800-10899)
Topic: 10812 - Beat the Spread!
Replies: 35
Views: 18378

### Re: 10812 So easy... =(

gateKeeper wrote:

Code: Select all

``````if(first<=sec || (first+sec)%2 || (first-sec)%2 || x<0 || y<0)
{
printf("impossible\n");
continue;
}
``````

Ciao!!!

Claudio
Tue Jun 07, 2005 4:20 pm
Forum: C++
Topic: A very simple program about "cin", What's the matt
Replies: 3
Views: 1925

### Re: A very simple program about "cin", What's the

Yile wrote:I do use the cin.clear()! But why still the cin doesn't work.
Why?????
Clearing cin simply resets the error flag but doesn't remove the offending char from the input stream. You have to cin.ignore(...) to go past it and resume reading...

Ciao!!!
Thu May 26, 2005 3:08 pm
Forum: C
Topic: Dynamic Allocation for 2 dimensional Array
Replies: 6
Views: 2614
while( (scanf(...)=2) ...) the assignment operator returns true always, AFAIR, the compiler doen't catch this and you go nuts over one damn stupid bug!OTOH, put 2 in the LHS, and do the test, here 2, a numeric literal can never be a lvalue(an address, that is, for most cases)and the compiler cribs....
Thu May 26, 2005 2:44 pm
Forum: Volume 108 (10800-10899)
Topic: 10852 - Less Prime
Replies: 24
Views: 14269
I dont know, but I'll assume we use different algorithms and for badly formed input we'll throw up different stuff, so there's not much chance that the judge solution can match them.Can you post your code...if you want to us have a look? Basically I take the half of the input number and search the ...
Thu May 26, 2005 1:53 pm
Forum: Volume 108 (10800-10899)
Topic: 10852 - Less Prime
Replies: 24
Views: 14269
sumankar wrote:Oh really!I never put any such special check though.Guess I was plain lucky.
My solution could behave badly for n=0,1,2 so I put an assert for n>99 and got a SIGABRT.
Simply removing the assert got AC although I didn't check if my solution was correct for such low values...

Ciao!!!

Claudio
Thu May 26, 2005 12:30 pm
Forum: Volume 108 (10800-10899)
Topic: 10852 - Less Prime
Replies: 24
Views: 14269
Tamagodzi wrote:I dont think that the data set has inputs below 100

just take care of inputs like 106

output must be greater than 53
I think it has...

Ciao!!!

Claudio
Thu May 26, 2005 11:16 am
Forum: Volume 108 (10800-10899)
Topic: 10852 - Less Prime
Replies: 24
Views: 14269

### Re: 10852: Less Prime

Antonio Ocampo wrote:Hi fellows, could someone give me the output for this inputs ??
Look out for input values under 100.

Ciao!!!

Claudio
Fri May 20, 2005 12:57 pm
Forum: Volume 4 (400-499)
Topic: 484 - The Department of Redundancy Department
Replies: 103
Views: 9231
an array sized twice the biggest number in input This is what I meant by input being nice. There's no mentioning of a limit to the input numbers in the problem description. I wouldn't want to allocate that array if the biggest number is say, 2^30. I can only assume by your post this wasn't the case...
Fri May 20, 2005 11:07 am
Forum: Volume 4 (400-499)
Topic: 484 - The Department of Redundancy Department
Replies: 103
Views: 9231
This problem can be solved in O(n log n). Or faster if input is nice, but we have no reason to believe input is nice. Hmmm, I think this problem is easily solved in O(n). You need a queue and an array sized twice the biggest number in input. This is the pseudo code of this easy solution loop if EOF...
Tue May 17, 2005 2:18 pm
Forum: Volume 4 (400-499)
Topic: 484 - The Department of Redundancy Department
Replies: 103
Views: 9231
Of course they also do a lot of fair optimizing and of course they are good programmers. Maybe you know something I don't, but I think their submission stats speak for themselves. If they wanted to optimize their code they could do it on their own machines (I'm certain they are more than capable of...
Mon May 16, 2005 2:32 pm
Forum: Volume 4 (400-499)
Topic: 484 - The Department of Redundancy Department
Replies: 103
Views: 9231
First of all you should note that both "Scott E August" and "Ivor L66bas" have more than 100 submissions for every solved problem. What they do is they "probe" the judge input. When you know what input there will be, it's much easier to write a program that will get a quick AC. If you ask me this i...