Search found 49 matches

by shihabrc
Fri Jul 21, 2006 11:54 pm
Forum: Volume 109 (10900-10999)
Topic: 10978 - Let's Play Magic!
Replies: 3
Views: 3305

10978 - Let's Play Magic!

Though its a quite easy simulation prob, I'm getting WA 4 this. Can any1 hlp ma(I/O,suggestions, anything). #include<stdio.h> #include<string> #include<string.h> using namespace std; #define MAX 52 int pos[MAX+1]; string card[MAX+1]; string placed[MAX+1]; bool flag[MAX+1]; void main() { int N,i,j,k,...
by shihabrc
Thu Jul 20, 2006 8:14 pm
Forum: Volume 110 (11000-11099)
Topic: 11015 - 05-2 Rendezvous
Replies: 48
Views: 17007

Thanx 4 ur hlp. Got AC now.

I really forgot 2 remove my ID frm the code. :oops:
by shihabrc
Wed Jul 19, 2006 8:57 pm
Forum: Volume 110 (11000-11099)
Topic: 11015 - 05-2 Rendezvous
Replies: 48
Views: 17007

11015 - 05-2 Rendezvous

Though its a straigh forward Floyd Warshall problem, I'm getting WA with it. I've run FW and then searched the house from where maximum houses are reacheable and then chosen the ont with the minimal distance. But getting WA. Can some1 hlp plz.I'm giving the code.

Code: Select all


removed after AC

by shihabrc
Fri Jul 14, 2006 9:20 pm
Forum: Volume 103 (10300-10399)
Topic: 10301 - Rings and Glue
Replies: 50
Views: 16357

10301 Glued with WA

Hi all, I've tried 2 solve this prob with DFS. But getting WA. I've considered 2 circles overlap if dist. between centres >=sum of rad && <=difference of rad. And I've printed "0 rings". instead of"0 ring". Can some1 hlp plz. I'm givin the code below. #include<stdio.h> #include<math.h> #include<vect...
by shihabrc
Fri Jun 23, 2006 5:30 pm
Forum: Volume 100 (10000-10099)
Topic: 10003 - Cutting Sticks
Replies: 59
Views: 24518

Thanx a lt. I took too much redaundant states. Now, i've changed my soln. and got AC. Thanx again.

-Shihab
by shihabrc
Thu Jun 22, 2006 8:57 pm
Forum: Volume 100 (10000-10099)
Topic: 10003 - Cutting Sticks
Replies: 59
Views: 24518

10003 TLE

I've solved this problems with a simillar approach to matrix chain multiplication. i think its complexity is O(L^2*n) where L is the length of the stick and n is the number of cut points. Since n is small this should run in time. But, i'm gettin TLE. Can someone help me plz //removed after AC Plz hl...
by shihabrc
Mon Jun 05, 2006 8:39 pm
Forum: Volume 4 (400-499)
Topic: 496 - Simply Subsets
Replies: 48
Views: 9311

496 WA!!

I'm getting WA 4 this prob. I can't figure out the cause. Can somebody hlp me plz. #include<stdio.h> #include<set> #include<stdlib.h> using namespace std; void main(){ int sizea,sizeb,common; set<int> A,B; char seta[2000],setb[2000],*p; bool asubset,bsubset,disjoint,equal; while(gets(seta)!=NULL){ g...
by shihabrc
Sun Jun 04, 2006 7:34 pm
Forum: Volume 1 (100-199)
Topic: 147 - Dollars
Replies: 233
Views: 21723

147. Strange.

While solving the problem i converted every coin and amount to multiple of 5c(by multiplying with 20). But i was getting WA. To my surprise when I changed the conversion code(as i found in one of the posts) from, int money=(int) (amount*20) to int money=(int) (amount*20+0.5) I got AC. can anyone exp...
by shihabrc
Sat Apr 29, 2006 5:38 pm
Forum: Volume 104 (10400-10499)
Topic: 10496 - Collecting Beepers
Replies: 19
Views: 10069

10496. WA!!!!

I've used BFS to solve this prob. What i've done is: 1. Find the location nearest to the starting location.(USING BFS and the starting location as source) 2. Use this location as source and find the location nearest to this. (I've used the flag array to ensure that a location is not used as source m...
by shihabrc
Sat Apr 29, 2006 4:32 pm
Forum: Volume 105 (10500-10599)
Topic: 10508 - Word Morphing
Replies: 35
Views: 12152

Ya, I got OLE in the first 2 submissions. But, today when i made a 3rd submission (with the same code) I got WA. After changing some array size I finally got AC. But , it took too much memory. I saw that a lot of ppl hav solved it with very low memory spent. How can I optimize the space complexity. ...
by shihabrc
Fri Apr 28, 2006 10:22 pm
Forum: Volume 105 (10500-10599)
Topic: 10508 - Word Morphing
Replies: 35
Views: 12152

10508. Word morphing. ---Getting Output Limit Exceeded

Hi all, I've tried to solve this problem by: 1.computing the distance of the words frm the 1st word. 2. Sort(ascending) the words on the basis of the distances and output them all. But, i'm getting OLE. I don't know why. Can someone help me with some suggetions. And is anything wrong in my approach....
by shihabrc
Fri Apr 21, 2006 10:24 am
Forum: Volume 104 (10400-10499)
Topic: 10436 - Cheapest way
Replies: 18
Views: 6366

10436. --Though quite easy, but gettin RTE

Hi all, I've tried 2 solve this prob using bellman-ford. And also tested it with several inputs. But the OJ is giving RTE. Can some1 help me? I'm giving the code. #include<cstdio> #include<stack> #include<cstring> using namespace std; #define INF 9999999 typedef struct Node{ char name[50]; } Node; t...
by shihabrc
Wed Jan 25, 2006 3:48 pm
Forum: Volume 104 (10400-10499)
Topic: 10449 - Traffic
Replies: 58
Views: 21969

10449-----WA!!!

I've used bellman-ford to solve this prob. I've also checked for neg-weight cycles. But i'm gettin WA. Plz. somebody hlp; #include<stdio.h> #include<math.h> #define INF 99999999 typedef struct Edge{ int u,v,w; } Edge; Edge edge[20000]; int cost[210]; int v,E; int d[210]; int n_c[210]; void main(void...
by shihabrc
Sun Jan 22, 2006 2:57 am
Forum: Volume 109 (10900-10999)
Topic: 10977 - Enchanted Forest
Replies: 42
Views: 17748

Thanx a lt. Got AC. :D
by shihabrc
Wed Jan 18, 2006 9:17 pm
Forum: Volume 108 (10800-10899)
Topic: 10816 - Travel in Desert
Replies: 49
Views: 22481

10816 Travelling in the desert----- WA hlp plz

Hi all, I've been tryin 2 solve this one with Kruskal(considering temparature as weight) and bellman(considering distance). Is this procedure correct? I'm gettin WA for this. Plz somebody hlp. (Sugg., I/Os ... anything) #include<stdio.h> #include<stdlib.h> #define INF 999999 typedef struct Edge{ int...

Go to advanced search