Search found 27 matches

by asmaamagdi
Mon Sep 29, 2008 1:19 am
Forum: Volume 115 (11500-11599)
Topic: 11504 - Dominos
Replies: 55
Views: 31850

Re: 11504 - Dominos

I was using union-find algorithm at the contest. But I got several WA's. I think my program failed in handling reversible connection (i.e. 1->2 and 2->1).


i use union-find algorithm , and i got WA too . i think this algorithm is correct , but why i got wrong ?

That's because union-find is for ...
by asmaamagdi
Tue Aug 05, 2008 9:26 am
Forum: Volume 114 (11400-11499)
Topic: 11474 - Dying Tree
Replies: 7
Views: 5016

Re: 11474 - Dying Tree

You should set edge to 0. Your code fails when the first tree (only) can talk to a doctor.
by asmaamagdi
Tue Apr 15, 2008 8:09 pm
Forum: Volume 103 (10300-10399)
Topic: 10397 - Connect the Campus
Replies: 75
Views: 38487

Re: 10397 Connect the Campus, WA????

How?? What you have changed in the code?
used the union find algorithm.
by asmaamagdi
Tue Mar 25, 2008 3:01 am
Forum: Volume 103 (10300-10399)
Topic: 10397 - Connect the Campus
Replies: 75
Views: 38487

Thank u guys for ur help. I was giving up this problem but I got it ACed finally :D
by asmaamagdi
Mon Mar 10, 2008 4:23 am
Forum: Volume 112 (11200-11299)
Topic: 11267 - The Hire-a-Coder Business Model
Replies: 7
Views: 4280

but sometimes you can take more egdes not only those needed to form spanning tree
I couldn't get what u mean
by asmaamagdi
Sun Mar 09, 2008 10:03 am
Forum: Volume 110 (11000-11099)
Topic: 11067 - Little Red Riding Hood
Replies: 23
Views: 10971

yup right. stupid mistake :oops:
Thnx very much, got it Aced now :D
by asmaamagdi
Sun Mar 09, 2008 4:20 am
Forum: Volume 110 (11000-11099)
Topic: 11067 - Little Red Riding Hood
Replies: 23
Views: 10971

What's wrong with this:

Code: Select all

AC
it gave me WA
by asmaamagdi
Mon Mar 03, 2008 1:04 pm
Forum: Volume 113 (11300-11399)
Topic: 11388 - GCD LCM
Replies: 18
Views: 13966

Thnx andmej for the proof. I've been so stupid sorry :$

& I read jvimal post again and got it :D

Thnx all
by asmaamagdi
Mon Mar 03, 2008 1:49 am
Forum: Volume 113 (11300-11399)
Topic: 11388 - GCD LCM
Replies: 18
Views: 13966

Got it ACed but not convinced. Do u have some kind of proof or something ??!!
by asmaamagdi
Mon Mar 03, 2008 12:12 am
Forum: Volume 113 (11300-11399)
Topic: 11388 - GCD LCM
Replies: 18
Views: 13966

Actually I tried to think of an O(1) algo to solve this problem using just math & just couldn't find any.

I have 2 unknown variables & I need 2 equations to determine them while I only have that g * l = a * b.
So :D ??!!

I also know that
a % g = 0
& b % g = 0
& l % a = 0
& l % b = 0
but these ...
by asmaamagdi
Sun Mar 02, 2008 11:40 pm
Forum: Volume 113 (11300-11399)
Topic: 11388 - GCD LCM
Replies: 18
Views: 13966

I'm trying to solve this problem but got WA

I'm using 2 nested loops for a & b, both loops starts from g & ends at l. I did some analysis & figured out that a & b must be in this interval [g, l]. the steps of the 2 loops is also g since I don't need to examine numbers that's not divisable by g. So ...
by asmaamagdi
Sat Mar 01, 2008 3:32 am
Forum: Volume 3 (300-399)
Topic: 336 - A Node Too Far
Replies: 121
Views: 58624

Hey guy,

I'm really getting frustrated by this problem :S, I don't know what's wrong. I've passed all 153 test cases posted CDiMa & still getting WA. I don't know what's wrong


struct Graph
{
int nVertices;
int nEdges;
int edges[100][100];
int degree[100];
}
g;

map<int, int>mp;
bool arr[100 ...
by asmaamagdi
Fri Feb 22, 2008 5:35 pm
Forum: General
Topic: New system is coming!
Replies: 13
Views: 9830

There is something I really miss in the old system which is viewing other people's accepted problems. I'm now coaching a group of student in my college & need to see who solved what problems.

Thnx in advance
by asmaamagdi
Sun Jan 06, 2008 12:00 am
Forum: Volume 1 (100-199)
Topic: 112 - Tree Summing
Replies: 137
Views: 32281

hey guys,

This problem is driving me crazy :S.
First I got it WA several times. Then I changed the way I read input from reading with cin.getline to reading a character by a character for cases where 2 test share a line.
Then I got TLE for that. I changed my code to sum the tree nodes while ...
by asmaamagdi
Wed Nov 28, 2007 11:06 pm
Forum: Volume 7 (700-799)
Topic: 762 - We Ship Cheap
Replies: 51
Views: 29425

Thnx Mostafa but I'm still getting WA :S. I don't know what's wrong with my code. The array size is 1500. Is it big enough ??!!
It's a simple BFS problem. I've used the same BFS function before and got some ACs with it.
Is there any trick about this problem ??!!

Go to advanced search