## Search found 39 matches

Sun Dec 12, 2004 2:01 pm
Forum: Volume 107 (10700-10799)
Topic: 10791 - Minimum Sum LCM
Replies: 46
Views: 22340
I think you misunderstand the problem. The problem description reads:
a set of AT LEAST two positive integers
Sun Dec 12, 2004 1:51 pm
Forum: Volume 107 (10700-10799)
Topic: 10793 - The Orc Attack
Replies: 35
Views: 19695
Your floyd-warshall is incorrect. The 'intermediate' node should be in the outer loop.
Sun Sep 19, 2004 6:29 pm
Forum: Volume 107 (10700-10799)
Topic: 10707 - 2D-Nim
Replies: 15
Views: 20905
I have a short solution in C++ in which i heavily use the STL. I use the following 'tricks': I store a group in a vector<pair<int,int> >. This makes normalizing a group very easy. All you have to do is sorting the vector (using a stl function) and then subtract the first element from every point. It...
Thu Sep 02, 2004 9:03 pm
Forum: Volume 107 (10700-10799)
Topic: 10705 - The Fun Number System
Replies: 14
Views: 4152
Do you guys all handle this correctly? Input: 2 64 nppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp -9223372036854775808 64 nppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp 9223372036854775807 Output: 1000000000000000000000000000000000000000000000000000000000000000 01...
Mon Aug 30, 2004 11:39 am
Forum: Volume 106 (10600-10699)
Topic: 10656 - Maximum Sum (II)
Replies: 52
Views: 16328
Two mistakes. First, you print a space after each number, and after the last number, you shouldn't. Second, in the method 'allZero' you loop from 0 to MD where you should loop from 0 to N. Sample input to show your mistakes: 2 3 4 1 0 Your output (spaces replaced by _): 3_4_ <blank line> Should be: ...
Wed Aug 25, 2004 10:02 am
Forum: Volume 106 (10600-10699)
Topic: 10600 - ACM Contest and Blackout
Replies: 34
Views: 13405
A really small mistake. It also took a while before I saw it. Look at this lines:
[cpp]for (i = 0; i < n; i++)
used = 0;[/cpp]
(should be i<m of course)
Mon Aug 23, 2004 2:26 pm
Forum: Volume 106 (10600-10699)
Topic: 10683 - The decadary watch
Replies: 35
Views: 12899
#include<stdio.h> #include<math.h> int main() { for(int i=0;i<100;++i) { double val=sqrt(double(i))*sqrt(double(i)); if(i!=(int)val) printf("%3d: %24.20lf %3d %3d\n",i,val,(int)val,(int)(val+1e-10)); } } Obviously (int)val should be the same as i, but sometimes it isn't. If you use (int)(val+1e-10)...
Mon Aug 23, 2004 9:21 am
Forum: Volume 106 (10600-10699)
Topic: 10683 - The decadary watch
Replies: 35
Views: 12899
First, you can avoid all floating point problems by using integers, instead of floating point numbers (sum*125/108 works and 125*sum still fits in 32 bit signed integer) Second, if you use floating point numbers, use double instead of float. (float has only a precision of about 7 decimals, which is ...
Tue Aug 17, 2004 10:06 pm
Forum: Volume 106 (10600-10699)
Topic: 10686 - SQF Problems
Replies: 21
Views: 11876
I also keep getting WA (after numerous tries). It gives the right output on the examples given on this page. I think the mistake is in the input reading, but it could also be a minor dumb mistake :) (I'm good at that)Here is the relevant part of my code: [cpp]typedef struct Cat { char name[50]; int ...