## Search found 120 matches

Mon Jan 29, 2007 10:51 am
Forum: C++
Topic: 2D string array for STL sort
Replies: 3
Views: 2704
hello maximum time i solve this type of problem by this way #include <stdio.h> #include <algorithm> #include <string> #include <vector> using namespace std; struct Node { vector <string> S; }; vector <Node> V; bool cmp(Node A, Node B) { int i; for (i = 0; i < A.S.size() && i < B.S.size(); i++) { if ...
Sun Jan 28, 2007 9:40 am
Forum: Volume 109 (10900-10999)
Topic: 10944 - Nuts for nuts..
Replies: 35
Views: 15027
Thankx EmotionalBlind
i have got it..

MAP
Wed Jan 17, 2007 10:57 pm
Forum: Volume 109 (10900-10999)
Topic: 10944 - Nuts for nuts..
Replies: 35
Views: 15027
I have solved this problem by this way but a single if condition has confused me... ................................... This problem takes only 1.76 seconds but when i have changed a if conditions format then it takes 6.52 seconds why can any body explain me ... ................................. if ...
Mon Sep 18, 2006 3:40 pm
Forum: Volume 100 (10000-10099)
Topic: 10080 - Gopher II
Replies: 31
Views: 15714
Hi Vahag I have changed ur code only this part and u got AC :D for(i=0;i<n;i++) for(j=0;j<m;j++) { double l = len(gpos[i],hpos[j]); if( l < s || (l - s) < 1e-7) { G[i+1][n+j+1] = 1; } } for(i=1;i<=n;i++) G[0][i] = 1; for(j=n+1;j<=n+m;j++) G[j][n+m+1] = 1; Thankx Mohiul Alam Prince
Sun Sep 03, 2006 7:31 pm
Forum: Volume 110 (11000-11099)
Topic: 11080 - Place the Guards
Replies: 40
Views: 11139
Try this Input
Input

Code: Select all

``````1
5 1
3 4
``````
Output

Code: Select all

``````4
``````
Thanks
MAP
Tue Jun 06, 2006 11:50 am
Forum: Volume 110 (11000-11099)
Topic: 11045 - My T-shirt suits me
Replies: 18
Views: 10190
Hi

I Have also solved this problem with Back Tracking approch. But if the Problem range is higher then my Back Tracking approch will not work.
Then maximum flow have to be considered.

Thanks
Mohiul Alam Prince
Tue Jan 31, 2006 6:49 am
Forum: Volume 109 (10900-10999)
Topic: 10930 - A-Sequence
Replies: 102
Views: 31518
Hi rube

have you tried this input ?

Input
3 1 2 4
5 1 2 4 8 45

Thanks
MAP
Tue Jan 31, 2006 6:34 am
Forum: Volume 5 (500-599)
Topic: 568 - Just the Facts
Replies: 39
Views: 16477
Hi athlon19831

Have you checked your sample input and output.

Code: Select all

``````sum=1;
for(i=n;i>0;i--)
{
sum*=i;
}
``````
your this part is totally wrong. (when you multiply the value at that time it exceed the integer range) Try to solve this problem in another approch.

Thanks
MAP.
Mon Jan 23, 2006 7:18 am
Forum: Volume 104 (10400-10499)
Topic: 10464 - Big Big Real Numbers
Replies: 10
Views: 4244
thank for your reply Here is my code #include <iostream> #include <string> #include <ctype.h> #include <algorithm> #include <string.h> #include <stdio.h> using namespace std; int mark = 0; string addition(string a, string b) { int i; string s; reverse(a.begin(), a.end()); reverse(b.begin(), b.end())...
Tue Nov 22, 2005 2:06 pm
Forum: Volume 8 (800-899)
Topic: 880 - Cantor Fractions
Replies: 24
Views: 17146
Hi I think the input limit is not more than (2^31 - 1). i have derive a short cut form of this problem. this is my function. function(int N) { int res; res = ceil(((-1 + sqrt(1 + 4.0 * 2.0 * N))/(double)2.0)); int ans = ((((res * res) + res) /(double) 2.0)); printf("%d/%d\n", (ans - N) + 1,res); } I...
Tue Nov 22, 2005 1:49 pm
Forum: Off topic (General chit-chat)
Topic: What kinds of problems do you solve most ?
Replies: 25
Views: 75834
Hi

i try to solve all kinda of problems (if it is possible for me).
but recursion is my favourite part of problem solving.
but consider ad hoc problems to be boring.

Regards,
MAP
Sun Oct 23, 2005 3:46 pm
Forum: Volume 100 (10000-10099)
Topic: 10060 - A hole to catch a man
Replies: 22
Views: 6046
Sohel

My solution has other problems i have fixed this problem and got
AC.

MAP.
Sun Oct 16, 2005 9:43 am
Forum: Volume 100 (10000-10099)
Topic: 10060 - A hole to catch a man
Replies: 22
Views: 6046

### 10060 A Hole to Catch a Man WA

Hi I am getting wa in this problem but don't know why. I have trying to solve this problem by this equation (x1y2 + x2y3 + x3y4 + ............. + xny1) - (y1x2 + y2x3 + y3x4 +.......... ynx1) can any body help me. Here is my code #include <stdio.h> #include <string.h> #include <math.h> #define pi ac...
Wed Aug 24, 2005 11:56 am
Forum: Volume 102 (10200-10299)
Topic: 10279 - Mine Sweeper
Replies: 102
Views: 27892
Hi salman Try this input Input 1 8 ...**..* ......*. ....*... ........ ........ .....*.. ...**.*. .....*.. xxxxxxxx xxxx.... xxxx.... xxxxx... xxxxx... xxxxx... xxx..... xxxxx... Output 001**22* 0013..*. 0001*... 00011... 00001... 00123*.. 001**.*. 00123*.. for this input your output is Output 00111...
Wed Aug 24, 2005 11:41 am
Forum: Volume 101 (10100-10199)
Topic: 10107 - What is the Median?
Replies: 74
Views: 18345
HI Salman