Search found 83 matches

by david
Fri Aug 13, 2004 3:59 am
Forum: Volume 104 (10400-10499)
Topic: 10446 - The Marriage Interview :-)
Replies: 17
Views: 9490

What compiler are you using? I guess it is caused by the printf code not working properly with long long's. When I run my accepted program under Linux and compiled with gcc I get the correct output (34359738369 for 32 32), but when I run it under Windows with dev-cpp (using gcc 3.3.1) it displays 1,...
by david
Wed Aug 11, 2004 4:36 pm
Forum: Volume 100 (10000-10099)
Topic: 10098 - Generating Fast
Replies: 62
Views: 13589

Many thanks for that. I found my mistake --fixing it amounted to writing a <= in place of a <. As for quicksort... :D you're right, but then again using it merely helps you with an unimportant part of the problem (as opposed to directly solving it) Of course in a contest I wouldn't hesitate to use n...
by david
Wed Aug 11, 2004 1:10 pm
Forum: Volume 100 (10000-10099)
Topic: 10098 - Generating Fast
Replies: 62
Views: 13589

I know I could use the STL, but the problem explicitly asks you for an algorithm to enumerate all permutations, not just use someone else's algorithm, which would render the problem trivial. My approach to find the next permutation (sigperm function) consists of finding the maximum decreasing sequen...
by david
Wed Aug 11, 2004 1:11 am
Forum: Volume 100 (10000-10099)
Topic: 10098 - Generating Fast
Replies: 62
Views: 13589

10098, wrong answer

I can't understand why this code is rejected (WA). Can anyone help me find what the problem is (if any)? Can anyone supply tricky input cases?
Thanks.

Code: Select all

(removed)
by david
Tue Apr 06, 2004 6:31 pm
Forum: Volume 100 (10000-10099)
Topic: 10012 - How Big Is It?
Replies: 26
Views: 10969

Your solution, 7.58, is based on putting the big 2.0 circle, then the small one and then the big one again. The problem is that the two big circles overlap in such a layout.
by david
Sun Sep 28, 2003 5:42 pm
Forum: Volume 100 (10000-10099)
Topic: 10090 - Marbles
Replies: 43
Views: 22031

I don't think there is "tricky input" here; the only problem with my code above was that I wrote if (y % n2 != 0) m++, when n1 should replace n2 (the problems of cut & paste!) It took me several days to realize this.. Check out your code for this kind of silly mistakes.
by david
Mon Apr 21, 2003 10:55 pm
Forum: Volume 100 (10000-10099)
Topic: 10093 - An Easy Problem!
Replies: 52
Views: 14664

well i mistook the name; the last post should be addressed to Professor_Of_Love.
by david
Mon Apr 21, 2003 10:53 pm
Forum: Volume 100 (10000-10099)
Topic: 10093 - An Easy Problem!
Replies: 52
Views: 14664

Hi razibcse. If I understand well your code, the only thing you try to do is ensure that no digit is used bigger or equal than the base, isn't it? That has little to do with the problem as you have to find a suitable base such that R is divisible by (n - 1). For instance, for R = 5464, your answer, ...

Go to advanced search