Search found 13 matches

by Faisal_Bd
Thu Sep 29, 2005 9:55 am
Forum: Volume 102 (10200-10299)
Topic: 10200 - Prime Time
Replies: 202
Views: 60981

How can I remember the results of isPrime()? for n = 10000, I have to check whether n*n + n + 41 is a prime number. So far I know, I can't declare so big array :

Code: Select all

bool array_name[100010041];
or

Code: Select all

char array_name[100010041];
Would you please give me a bit explanation?
by Faisal_Bd
Thu Sep 29, 2005 9:49 am
Forum: Volume 102 (10200-10299)
Topic: 10200 - Prime Time
Replies: 202
Views: 60981

10200

I tried my best but could not get this problem AC within the time limit, let alone with a good timing... Please just have a look on my code and tell me how I can get this problem AC with a good timing. #include <stdio.h> #define MAX 10100 int primes[1250]; int nPrimes; void generatePrimes(void) { in...
by Faisal_Bd
Thu Sep 29, 2005 7:47 am
Forum: Volume 7 (700-799)
Topic: 796 - Critical Links
Replies: 54
Views: 22461

Ops! got AC! It was again a silly mistake - initialization! initialized some variables and problem solved.. :D
by Faisal_Bd
Wed Sep 28, 2005 3:36 pm
Forum: Volume 3 (300-399)
Topic: 315 - Network
Replies: 68
Views: 21320

Dear Jalal, your solution is wrong! The problem description is absolutely right. It is a problem of finding articulation point. For your input, the output is 0. Oh !!!!! got AC doing just one change! I did mistake in taking input. It's so silly mistake! shame! Given N, if N number of lines follow, t...
by Faisal_Bd
Wed Sep 28, 2005 12:50 pm
Forum: Volume 3 (300-399)
Topic: 315 - Network
Replies: 68
Views: 21320

I also considered disconnected graph. But I didn't consider the "ambiguous case" mentioned above. Now I am trying to fix (??) it accordingly. Thanks for your help, dear Jalal!
by Faisal_Bd
Wed Sep 28, 2005 12:23 pm
Forum: Volume 3 (300-399)
Topic: 315 - Network
Replies: 68
Views: 21320

The officials from TLC realized that in such a case it can happen that besides the fact that the place with the failure is unreachable, this can also cause that some other places cannot connect to each other. In such a case we will say the place (where the failure occured) is critical. Now the offi...
by Faisal_Bd
Wed Sep 28, 2005 11:28 am
Forum: Volume 3 (300-399)
Topic: 315 - Network
Replies: 68
Views: 21320

Dear Jalal,
Is that output correct? I think the correct output is 0. What is your output by the accepted solution?
by Faisal_Bd
Sat Sep 24, 2005 12:38 pm
Forum: Volume 7 (700-799)
Topic: 796 - Critical Links
Replies: 54
Views: 22461

796

I have tried this problem but go WA. Can anybody please help me with some critical input and output?
by Faisal_Bd
Sat Sep 24, 2005 12:33 pm
Forum: Volume 3 (300-399)
Topic: 315 - Network
Replies: 68
Views: 21320

315 - Network

Can anybody please help me me with some input and output? I have tried this problem but have got WA. It's a problem of finding articulation point, isn't it? Is there any tricky test case?
by Faisal_Bd
Sat Feb 19, 2005 4:23 pm
Forum: Volume 100 (10000-10099)
Topic: 10090 - Marbles
Replies: 43
Views: 22212

10090 Marbles -- what's the algorithm for minimization??

I tried to solve this problem using Extended Euclid Algorithm. But got TLE. I think I could not optimize the solution properly. Can anybody share his algorithm as to how he minimizes the cost after getting a solution by Extended Euclid Algorithm?
by Faisal_Bd
Sat Feb 19, 2005 4:18 pm
Forum: Volume 101 (10100-10199)
Topic: 10142 - Australian Voting
Replies: 82
Views: 30213

10142 Australian Voting - ambiguous problem description

Could anybody give me a little details on this quite ambiguous problem?
by Faisal_Bd
Sat Sep 04, 2004 10:39 am
Forum: Volume 105 (10500-10599)
Topic: 10592 - Freedom Fighter
Replies: 17
Views: 9607

Thanks a lot, Raiyan Kamal. I managed to handle the error and fixed the code and got AC :) . The answers for your test cases follow: Sector #1: contain 1 freedom fighter group(s) & 0 enemy group(s) Sector #2: contain 0 freedom fighter group(s) & 1 enemy group(s) Total 0 group(s) are in fighting posi...
by Faisal_Bd
Wed Sep 01, 2004 10:26 am
Forum: Volume 105 (10500-10599)
Topic: 10592 - Freedom Fighter
Replies: 17
Views: 9607

10592(Freedom Fighter): WA

When I got WA for the first time in this problem, I visited the previous discussions on this one. Some tricky input-output were given there and my solution code was right for them. But I still can't understand what wrong is with my code. I couldn't find out the bug in my code though I tried couple o...

Go to advanced search