Search found 78 matches

by Sanny
Thu Feb 17, 2005 6:57 pm
Forum: Volume 108 (10800-10899)
Topic: 10810 - Ultra-QuickSort
Replies: 36
Views: 20362

Your data type is not correct. You need long long int in this problem. See the past posts.

Regards
Sanny
by Sanny
Tue Feb 15, 2005 12:12 am
Forum: Volume 101 (10100-10199)
Topic: 10195 - The Knights Of The Round Table
Replies: 59
Views: 15562

If any of the sides are zero, the area should be zero.
by Sanny
Tue Feb 15, 2005 12:07 am
Forum: Volume 107 (10700-10799)
Topic: 10773 - Back to Intermediate Math
Replies: 41
Views: 16662

if(v == 0 || u == 0 || u <= v) printf("Case %d: can't determine\n",i);
I think v=0 is valid.
by Sanny
Mon Feb 14, 2005 11:55 pm
Forum: Volume 1 (100-199)
Topic: 147 - Dollars
Replies: 233
Views: 20056

You don't need to calculate the result every time. Just calculate once and store them in a global array.

Regards
Sanny
by Sanny
Mon Feb 14, 2005 10:41 pm
Forum: Volume 108 (10800-10899)
Topic: 10816 - Travel in Desert
Replies: 49
Views: 22017

Just solved this problem. And after solving this I must thank the problemsetter for this good and tricky problem. I used two Bellman Ford this time. First to find the minimum temperature and second to find the minimum distance.
by Sanny
Sun Feb 13, 2005 11:07 pm
Forum: Volume 108 (10800-10899)
Topic: 10816 - Travel in Desert
Replies: 49
Views: 22017

10816 - Travel in Desert

Hi all,
Can you tell me what are the tricky cases in this problem. I thought it was a pretty straightforward shortest path problem. I used Floyd Warshall and got 7 WAs during the contest :evil: . I also saw that many people got WA many times in this problem.

Regards

Sanny
by Sanny
Thu Dec 16, 2004 12:48 am
Forum: Volume 107 (10700-10799)
Topic: 10799 - OOPS! They did it Again...
Replies: 6
Views: 5656

Try these- Input: 1 2 2 1 5 2 1 5 3 1 5 4 1 5 5 1 1000 1000 1 1000 999 1 18 6 1 21 6 1 25 6 3 18 6 3 25 6 3 21 6 0 0 0 Output: Case 1: 0 Case 2: 4 Case 3: 4 Case 4: 0 Case 5: 1 Case 6: 0 Case 7: 2 Case 8: 8 Case 9: 12 Case 10: 20 Case 11: 6 Case 12: 16 Case 13: 9 You can also check your scanf() & pr...
by Sanny
Wed Dec 15, 2004 3:19 am
Forum: Volume 107 (10700-10799)
Topic: 10799 - OOPS! They did it Again...
Replies: 6
Views: 5656

Yet again my AC code gives the same output. Try these -

Input:
1 20000000 2
1 20000000 3
1 20000000 4
0 0 0
Output:
Case 1: 99999990000000
Case 2: 99999990000000
Case 3: 33333323333334
by Sanny
Tue Dec 14, 2004 10:49 pm
Forum: Volume 107 (10700-10799)
Topic: 10799 - OOPS! They did it Again...
Replies: 6
Views: 5656

My AC code gives the same output. Btw, have u printed the caseno?
by Sanny
Fri Nov 12, 2004 1:36 am
Forum: Volume 4 (400-499)
Topic: 474 - Heads / Tails Probability
Replies: 50
Views: 10461

My AC program gives the following output ->

Code: Select all

2^-11 = 4.883e-4
2^-12 = 2.441e-4
2^-13 = 1.221e-4
2^-23 = 1.192e-7
2^-24 = 5.960e-8
2^-25 = 2.980e-8
2^-7 = 7.813e-3
2^-6 = 1.563e-2
2^-47 = 7.105e-15
2^-48 = 3.553e-15
2^-49 = 1.776e-15
2^-1000000 = 1.010e-301030
Hope it helps.
by Sanny
Thu Nov 11, 2004 12:01 am
Forum: Volume 4 (400-499)
Topic: 474 - Heads / Tails Probability
Replies: 50
Views: 10461

Hi,
There can be some problem in ur printf().
printf("2^-%ld = %1.3fe-%d\n",n,a[n].x,a[n].y);
The actual data types for a[n].x and a[n].y were long double and long int respectively. But u used %f and %d in the printf().
by Sanny
Fri Jul 30, 2004 1:35 am
Forum: Volume 102 (10200-10299)
Topic: 10282 - Babelfish
Replies: 48
Views: 19109

10282

Hello, I've encountered a funny incident which I can not explain. See the two codes of problem no 10282: This got accepted : [cpp] #include<stdio.h> #include<string.h> #include<stdlib.h> #define size 100005 struct dictionary { char foreign[12]; char eng[12]; }dict[size],*ptr; int sort_f(const dictio...
by Sanny
Tue Jul 20, 2004 11:54 pm
Forum: Volume 106 (10600-10699)
Topic: 10669 - Three powers
Replies: 14
Views: 5739

Hi,
If you write the subsets for first few values of n, you can see that for n=3 to n=4 3 is common. Again, for n=5 to n=8 9 is common. For n=9 to n=16 27 is common. I think you can utilize this fact.
by Sanny
Sat Jul 17, 2004 3:30 pm
Forum: Volume 105 (10500-10599)
Topic: 10533 - Digit Primes
Replies: 108
Views: 30999

Hi,
Besides the efficiency of ur prime testing function, there are other things u should look at.
As the number of test cases is 500000, u must use dynamic programming here.
And u better use the sieve method to generate all the primes.
by Sanny
Sat Jul 17, 2004 3:10 pm
Forum: Volume 106 (10600-10699)
Topic: 10669 - Three powers
Replies: 14
Views: 5739

Hi, In this problem u have a set of numbers containing three's powers. S = { 1,3,9,27,81,..........}. Now if u construct different subsets of this set and sort them ascending by the sum of their elements then u get { } { 1 } { 3 } { 1,3 } { 9 } { 1,9 } { 3, 9 } { 1, 3, 9 } { 27 } ......................

Go to advanced search