Search found 209 matches

by asif_rahman0
Mon Apr 02, 2007 8:18 am
Forum: Volume 109 (10900-10999)
Topic: 10977 - Enchanted Forest
Replies: 42
Views: 22503

Use your following processing while you are taking Input . for (i=1;i<=r;i++) for (j=1;j<=c;j++) for (k=0;k<n;k++) if (sqrt(sqr(v[k].x-i)+sqr(v[k].y-j)) <= (double)s[k] ) map[i][j] = blocked; And it is O(r*c*n). For clarity: ..... cin >>n; for (i=1;i<=n;i++) { cin >>p.x>>p.y>>l; //Put here the above...
by asif_rahman0
Wed Mar 14, 2007 10:20 pm
Forum: Volume 5 (500-599)
Topic: 574 - Sum It Up
Replies: 46
Views: 20396

I dont think that you need to use check() function. Just do the solution with the following recusive function. Its just a template. void f(int sum,int index) { if(sum==0){ //put those numbers which makes sum=0!!! return; } for(int k=index;k<n;k++){ //store the num[k] into an array f(sum-num[k],k); /...
by asif_rahman0
Wed Mar 14, 2007 11:24 am
Forum: Volume 101 (10100-10199)
Topic: 10132 - File Fragmentation
Replies: 24
Views: 14585

Hints:
1) Make a relation table.
2) Order have to consider
3) If there is no unique solution, any of the possible solutions!
;)
by asif_rahman0
Sun Mar 11, 2007 11:41 am
Forum: Volume 106 (10600-10699)
Topic: 10667 - Largest Block
Replies: 12
Views: 8463

Please check my I/O!!!
Input:

Code: Select all

7
10
3
2 2 5 5
7 3 9 9
4 6 3 8
20
1
1 1 1 5
10
2
5 1 5 10
1 5 5 5
25
3
1 1 5 5
5 5 10 10
7 7 20 20
25
2
1 1 5 5
5 5 10 10
20
4
5 5 11 11
1 3 1 20
7 8 7 9
6 9 10 9
16
3
1 1 3 3
4 3 10 3
8 3 9 10
Output:

Code: Select all

30
380
50
125
375
180
96
All are correct?
by asif_rahman0
Fri Mar 09, 2007 3:47 pm
Forum: Algorithms
Topic: fill polygon
Replies: 3
Views: 2424

beloni wrote:On gcc and allegro.h
On Turbo C, it will be "graphics.h".

See PM for link.
by asif_rahman0
Thu Mar 08, 2007 9:11 pm
Forum: Algorithms
Topic: fill polygon
Replies: 3
Views: 2424

Re: fill polygon

pintor(x-1,y,color); why did you use it here? Can you tell me? To fill polygon you must first define poly[] arrays, then the following: setfillstyle(...) fillpoly(...) it overflows the stack When this message shows? I made a small paint project 2yrs ago, that time we made similiar Paint's Polygon t...
by asif_rahman0
Thu Mar 01, 2007 10:15 pm
Forum: Volume 7 (700-799)
Topic: 721 - Invitation Cards
Replies: 25
Views: 10640

Just clearcut problem if you use STL. Did you follow this: After reaching the destination stop they return empty to the originating stop First calculate cost1, after that reverse the direction of all edges with O(p^2), then calculate the cost2. Finally result=cost1+cost2 For case #2,(problem's) 4 6 ...
by asif_rahman0
Sun Feb 25, 2007 4:57 pm
Forum: Volume 6 (600-699)
Topic: 673 - Parentheses Balance
Replies: 243
Views: 73687

Try the following input:

Code: Select all

2
([]))
Then see, what will happen?
bye
by asif_rahman0
Sun Jan 21, 2007 7:30 pm
Forum: Volume 111 (11100-11199)
Topic: 11158 - Elegant Permuted Sum
Replies: 23
Views: 17513

emotional,
Would you tell me the GREEDY approach as a hint? :D
by asif_rahman0
Tue Dec 19, 2006 8:02 pm
Forum: Algorithms
Topic: acm regional coimbatore problems a -how to solve
Replies: 14
Views: 8371

First try 524, then i think you will get.

http://acm.uva.es/p/v5/524.html

Can someone tell me why same type of problem comes in another contest?
May be the description of it is different but who solved 524, he/she definitely solve this one.
by asif_rahman0
Sun Dec 03, 2006 7:26 pm
Forum: Volume 4 (400-499)
Topic: 481 - What Goes Up
Replies: 82
Views: 24345

Randomly generate some INPUTs then store OUTPUTs into a file then compare. ok. Its best.
by asif_rahman0
Sun Dec 03, 2006 7:07 pm
Forum: Volume 4 (400-499)
Topic: 481 - What Goes Up
Replies: 82
Views: 24345

Spoiler:
http://www.algorithmist.com/index.php/L ... quence.cpp

So dont cut & paste. ;)
Try to learn something from it.

Hope it helps.

bye
Rabbi
by asif_rahman0
Mon Nov 27, 2006 1:16 pm
Forum: Volume 109 (10900-10999)
Topic: 10986 - Sending email
Replies: 65
Views: 36721

If you post your code then it will be easy for me to figure out your error.
by asif_rahman0
Mon Nov 27, 2006 1:38 am
Forum: Volume 109 (10900-10999)
Topic: 10986 - Sending email
Replies: 65
Views: 36721

Sorry that was typo. :)
by asif_rahman0
Sun Nov 26, 2006 8:26 pm
Forum: Volume 109 (10900-10999)
Topic: 10986 - Sending email
Replies: 65
Views: 36721

No multiple edges. Clear cut dijkstra with Priority Queue. And Input below:(not tricky) 4 6 9 5 0 0 1 4 0 2 2 1 2 1 1 3 5 2 3 8 2 4 10 3 4 2 3 5 6 4 5 3 6 9 0 5 0 1 4 0 2 2 1 2 1 1 3 5 2 3 8 2 4 10 3 4 2 3 5 6 4 5 3 6 9 5 2 0 1 4 0 2 2 1 2 1 1 3 5 2 3 8 2 4 10 3 4 2 3 5 6 4 5 3 6 9 3 0 0 1 4 0 2 2 1...

Go to advanced search