Search found 80 matches

by Quantris
Wed May 11, 2005 4:51 am
Forum: Volume 1 (100-199)
Topic: 147 - Dollars
Replies: 233
Views: 24243

try %lld for long long

(%I64d for MS compiler, but don't submit it like that)
by Quantris
Wed May 11, 2005 4:38 am
Forum: Volume 1 (100-199)
Topic: 116 - Unidirectional TSP
Replies: 226
Views: 39294

I think when it says "lexicographically" they mean by comparing the first elements, then the second ones if the first ones were equal, and so on - but the pairwise-element comparison is numerical and not based on the actual characters. At least, that's how I interpreted it. It would seem to be a sil...
by Quantris
Mon Apr 25, 2005 9:51 pm
Forum: Volume 1 (100-199)
Topic: 143 - Orchard Trees
Replies: 90
Views: 13847

143 - Orchard Trees

I know there are already a couple of posts regarding this, my program gives the correct output for the input I could find. However I've gotten *tons* of WA's on this problem, I increased my precision to a very high degree and tested with all sorts of boundary cases, so I begin to wonder if the judge...
by Quantris
Tue Oct 19, 2004 4:59 am
Forum: Volume 107 (10700-10799)
Topic: 10738 - Riemann vs Mertens
Replies: 16
Views: 4637

Indeed, I'm quite interested in how you solved it with such a fast time. I guess you found a pattern I overlooked. (Of course, one major thing to speed up my program which I'm too lazy to do at the moment is to not test all the even numbers, or even leave out multiples of three - well not exactly th...
by Quantris
Wed Oct 06, 2004 1:07 am
Forum: Volume 107 (10700-10799)
Topic: 10727 - Practice
Replies: 10
Views: 3475

ok, thanks. I think I figured out what else was wrong with my program, so hopefully I can fix it.
by Quantris
Tue Oct 05, 2004 6:47 pm
Forum: Volume 107 (10700-10799)
Topic: 10727 - Practice
Replies: 10
Views: 3475

What's the output for the case:
2
1 0
2 1

..my program runs off to -infinity for a, and i'm not sure where to stop it.
by Quantris
Sat Aug 21, 2004 7:19 am
Forum: Volume 2 (200-299)
Topic: 229 - Scanner
Replies: 11
Views: 5832

howard, what exactly do you mean?

how are you checking for ambiguous cases (more than one solution)?
by Quantris
Mon Aug 02, 2004 10:02 am
Forum: Volume 2 (200-299)
Topic: 285 - Crosswords
Replies: 16
Views: 9416

actually, my WA program *does* say "incorrect solution" for that one!

Thanks for trying to help though, I appreciate it.

EDIT: BTW, my program says "correct solution" when the input is:

Code: Select all

alas 2 1 r
#
5
1
alas$ 
by Quantris
Sun Aug 01, 2004 9:16 am
Forum: Volume 2 (200-299)
Topic: 285 - Crosswords
Replies: 16
Views: 9416

I'm pretty sure I did that properly - i verified whether the given width/height were indeed the minimums required (as stated in the problem), and if not, reported an incorrect solution. Is that the correct interpretation?
by Quantris
Thu Jul 15, 2004 1:48 am
Forum: Volume 5 (500-599)
Topic: 545 - Heads
Replies: 67
Views: 44706

It gives the right values on my computer; I also tried it on several (linux) boxes in ECE. guess I'm just unlucky then.

ok, I'll just make those special cases.
by Quantris
Tue Jul 13, 2004 4:55 am
Forum: Volume 5 (500-599)
Topic: 545 - Heads
Replies: 67
Views: 44706

545 WA

Not sure why I'm getting WA - is it an input format thing? (I know this is a slow way to do it). [cpp] #include <cstdio> using namespace std; int main() { int n, c; scanf("%d", &c); for (int i = 0; i < c; ++i) { if (i) putc('\n', stdout); scanf(" "); int line = getc(stdin); ungetc(line, stdin); whil...
by Quantris
Sun Jun 27, 2004 6:23 am
Forum: Volume 103 (10300-10399)
Topic: 10346 - Peter's Smokes
Replies: 46
Views: 16915

Couldn't read the document, but this question is sort of a chestnut... The formula I used is (kn-1)/(k-1), which is really the same as the n+... version. The simple explanation is: If we have n cigarettes, we have k*n butts (imagine breaking them each up into k butts at the start). Take 1 butt out, ...
by Quantris
Tue Jun 22, 2004 5:35 pm
Forum: Volume 1 (100-199)
Topic: 120 - Stacks of Flapjacks
Replies: 118
Views: 14793

actually I meant in the input...
by Quantris
Mon Jun 14, 2004 4:57 am
Forum: Volume 2 (200-299)
Topic: 285 - Crosswords
Replies: 16
Views: 9416

I've got the same problem

it's working for all the inputs I can think of, any tricky inputs or interpretation of the problem that we should know about?
by Quantris
Sun Jun 06, 2004 9:17 am
Forum: C
Topic: if and while
Replies: 5
Views: 2700

but isn't sqrt(j) evaluated more often with the if construct, since there is only one num division per iteration of the for loop, but with the while loop it only loops through the for loop once for each i...

anyway, you should definitely store sqrt(j) since it is constant.

Go to advanced search