Search found 286 matches

by mamun
Fri Mar 23, 2007 12:37 pm
Forum: Volume 103 (10300-10399)
Topic: 10340 - All in All
Replies: 129
Views: 48078

For above input your code produces

Code: Select all

Yes
Yes
though the output should be

Code: Select all

Yes
No
Your arrays aren't global, you've declared them inside main().
by mamun
Fri Mar 23, 2007 11:30 am
Forum: Volume 103 (10300-10399)
Topic: 10340 - All in All
Replies: 129
Views: 48078

Try this input

Code: Select all

abc axbycz
abc xyz
You might get run-time error. Declare the char arrays as static or global.
by mamun
Wed Nov 22, 2006 11:23 pm
Forum: Volume 3 (300-399)
Topic: 350 - Pseudo-Random Numbers
Replies: 56
Views: 22823

Yes, since 0 has already appeared we terminate the chain, not including the last 0 since it's already there. So the cycle contains only one number.
by mamun
Tue Sep 26, 2006 8:10 pm
Forum: Volume 110 (11000-11099)
Topic: 11095 - Tabriz City
Replies: 14
Views: 7467

So it's the streets that must ensure that at least one end has a center. Yes, my previous assumption would have missed streets (4 6) and some more. Thank you Hisoka.
by mamun
Tue Sep 26, 2006 1:36 pm
Forum: Volume 110 (11000-11099)
Topic: 11095 - Tabriz City
Replies: 14
Views: 7467

Probably I haven't understood the problem clearly. Aren't we supposed to find the minimum number of information centers needed to form so that all the junctions have a center either at it or adjacent to it? If so, for the graph posted by arsalan_mousavian 6 centers should be enough, I think. Don't 1...
by mamun
Fri Sep 15, 2006 2:19 pm
Forum: Volume 110 (11000-11099)
Topic: 11076 - Add Again
Replies: 34
Views: 20554

You might like to try the inputs given in earlier posts.
by mamun
Sat Sep 09, 2006 2:33 pm
Forum: Volume 110 (11000-11099)
Topic: 11032 - Function Overloading
Replies: 43
Views: 21799

Programmer wrote:Hello.
Can someone who get AC tell me answer of this test.
1
1 10000000
Thanks.
Case 1: 977787
by mamun
Sun Sep 03, 2006 3:52 pm
Forum: Volume 110 (11000-11099)
Topic: 11076 - Add Again
Replies: 34
Views: 20554

You may try this inputs

Code: Select all

4
1 1 0 0
3
0 0 0
by mamun
Sun Sep 03, 2006 11:33 am
Forum: Volume 3 (300-399)
Topic: 328 - The Finite State Text Processing Machine
Replies: 14
Views: 6247

There might be something wrong with your input. Anyway I get the same output as yours.
by mamun
Sat Sep 02, 2006 5:35 pm
Forum: Volume 110 (11000-11099)
Topic: 11080 - Place the Guards
Replies: 40
Views: 16945

Input

Code: Select all

3
5 2
0 1
2 3
5 3
0 1
2 3
1 3
4 3
2 0
2 1
2 3
Output

Code: Select all

3
3
1
by mamun
Sat Sep 02, 2006 9:02 am
Forum: C++
Topic: Compile error with comparer function
Replies: 6
Views: 3805

Thank you so much Krzysztof Duleba. You're damn expert in C++.
by mamun
Sat Sep 02, 2006 8:13 am
Forum: C++
Topic: Compile error with comparer function
Replies: 6
Views: 3805

Thank you Krzysztof Duleba. I've rewritten sq_distance() as

Code: Select all

inline int sq_distance(const point &p1,const point &p2)
But if I try to pass the arguments by const references to cross_product() as well then I come with new compile errors which seems to be related to the operator-().
by mamun
Sat Sep 02, 2006 7:27 am
Forum: C++
Topic: Compile error with comparer function
Replies: 6
Views: 3805

Thanks. :) Changing bool comp(point &a,point &b) bool eqal(point &a,point &b) inline int sq_distance(point &p1,point &p2) inline int cross_product(point &p0,point &p1,point &p2) to bool comp(const point &a,const point &b) bool eqal(const point &a,const...
by mamun
Fri Sep 01, 2006 11:32 pm
Forum: C++
Topic: Compile error with comparer function
Replies: 6
Views: 3805

Compile error with comparer function

My following code is getting compile error. Can anyone help me in this reagard? #include <cstdio> #include <vector> #include <algorithm> using namespace std; #define SIZE 100000 struct point{ int x,y; point(){} point(int _x,int _y):x(_x),y(_y){} point operator-(point &p){point tmp(x-p.x,y-p.y);r...
by mamun
Thu Aug 17, 2006 9:10 am
Forum: Volume 4 (400-499)
Topic: 443 - Humble Numbers
Replies: 82
Views: 17223

jainal uddin wrote:hello try to make another algorithm to find out humble number.
Are you answering yourself!? :o

Go to advanced search