Search found 14 matches

by rmotome
Wed Sep 27, 2006 7:20 am
Forum: Volume 5 (500-599)
Topic: 540 - Team Queue
Replies: 37
Views: 16207

I am getting RTE, help me out by giving me valid input #include<stdio.h> #include<stdlib.h> #include<assert.h> #include<string.h> #include<ctype.h> #define T 1000 #define Z 1000000 typedef struct node *link; struct node{int n; int team; link prev; link next; }; link NEW(int n,int team,link prev,link...
by rmotome
Wed Sep 27, 2006 5:57 am
Forum: Volume 5 (500-599)
Topic: 540 - Team Queue
Replies: 37
Views: 16207

ANS: keep an updated link to the last element of each group thus reducing ENQUEUE to O(1)
by rmotome
Wed Sep 27, 2006 12:11 am
Forum: Volume 5 (500-599)
Topic: 540 - Team Queue
Replies: 37
Views: 16207

540 Attack!!!!!

My algorithm times-out during it's run. I am asking for help optimizing my approach. I keep two doubly-linked lists (1) a freelist (2) the team queue. I start by adding every element into the freelist and remove each as they are ENQUEUEd into the team queue. Searching the freelist and adding into to...
by rmotome
Wed Aug 16, 2006 6:12 am
Forum: Volume 102 (10200-10299)
Topic: 10227 - Forests
Replies: 23
Views: 9084

wooooooowwwwwwwwww! what the hell?

1,2,3 hold the same opinions as 4,5 and 6 respectively this makes 3 opinions in total not 4. Is there something I am missing? I have read the problem statement many times
by rmotome
Tue Aug 08, 2006 1:36 am
Forum: Volume 4 (400-499)
Topic: 465 - Overflow
Replies: 104
Views: 24231

wtf?????

I have used all the test data in the forum but I still get wrong answer; here is my program. #include<iostream> #include<functional> #include<algorithm> #include<iterator> #include<string> #include<sstream> #include<climits> #include<cassert> using namespace std; #define LIM 2147483647 int main() { ...
by rmotome
Sun Jul 23, 2006 3:28 pm
Forum: Algorithms
Topic: about multiple path
Replies: 5
Views: 1545

Here is my approach

You can choose any shortest path algorithm so long as you compute the predecessor matrix/array. Then remove the shortest path and run the algorithm once more; you will end up with the alternate shortest path. If you find a way of computing all (same length) shortest paths with a single pass of the s...
by rmotome
Sun Jul 09, 2006 1:19 am
Forum: Volume 103 (10300-10399)
Topic: 10356 - Rough Roads
Replies: 29
Views: 15449

I also took care of:
4 4
0 1 10
1 2 5
1 2 0
2 3 15

Vertices 1 & 2 are the same; the edge of length 5 from 1 to 2 is a selfloop. Thus the path from 0 to 3 is even.

I am looking for more critical input
by rmotome
Mon Sep 19, 2005 1:57 am
Forum: Volume 4 (400-499)
Topic: 482 - Permutation Arrays
Replies: 159
Views: 31818

482 (Permutation Arrays) WA?????? Look here first!!!!!!!!!!!

Do not treat the doubles as doubles, read them in as strings. Ohh dear, have I said too much :P
by rmotome
Sun Sep 18, 2005 6:13 pm
Forum: Volume 4 (400-499)
Topic: 450 - Little Black Book
Replies: 57
Views: 6432

450 (Little Black Book) WA????? Look here first!!!!!!

You will continue to get WA until you have the right number of dashes above every recond. Copy the dash line from the problem's output (there are 39 if I am not mistaken) paste it on your code. I had my program ACed after doing so; give this a try.
by rmotome
Fri Sep 16, 2005 9:47 am
Forum: C++
Topic: How to skip lines while using cin <<
Replies: 7
Views: 4334

Ummmmmm, ......

int main()
{
int n;
cin.ignore(4); // '1' + '\n' + '2' + '\n' = 4 chars
cin>>n;
cout<<n<<endl; // output: 3
}
by rmotome
Fri Jul 15, 2005 2:01 pm
Forum: Volume 101 (10100-10199)
Topic: 10183 - How Many Fibs?
Replies: 66
Views: 23730

Fibonacci, ....

There is an error in problem 10183 (How many Fibs?) ..... F[2] is defined as 2 instead of 1; you must however use the information as given in order to get an AC.
by rmotome
Sun Feb 13, 2005 5:18 am
Forum: Volume 100 (10000-10099)
Topic: 10067 - Playing with Wheels
Replies: 62
Views: 24203

I can't do what?!!!!!!!!!!!!!

Sorry, was just following the [bad] example of others on the board. I will have to do the work myself. On a related note, I just got a copy of the book "The Practice of Programming" thought I might learn good programming habits from the get-go. From the look of things many on the forum should consid...
by rmotome
Sat Feb 12, 2005 6:49 am
Forum: Volume 100 (10000-10099)
Topic: 10067 - Playing with Wheels
Replies: 62
Views: 24203

Just looking for input that could break my program, source is for ur experimentation pleasure :-)
by rmotome
Mon Jan 17, 2005 5:01 pm
Forum: Volume 100 (10000-10099)
Topic: 10067 - Playing with Wheels
Replies: 62
Views: 24203

10067 AGAIN! :-(

I have checked previous posts and know for sure that my solution is correct and most likely what first comes to mind when dealing with this problem. However, I still can't get mine excepted. If u have any ideas I would love to hear from u. Thanks, Robert #include <stdio.h> #include <stdlib.h> #inclu...

Go to advanced search