Search found 405 matches

by anupam
Fri Jul 02, 2004 11:23 pm
Forum: Volume 106 (10600-10699)
Topic: 10626 - Buying Coke
Replies: 23
Views: 15939

Please help. frustated. WA 5 times. what is to check more?? :cry:
by anupam
Fri Jul 02, 2004 10:55 pm
Forum: Volume 106 (10600-10699)
Topic: 10626 - Buying Coke
Replies: 23
Views: 15939

Please help in this problem. I can't find where the problem is... checking all possible cases with dp. so why wa? is there any critical case?? here is the code. please check it.. #include<stdio.h> #define A 155 #define B 200 #define C 40 long a[A][B][C],m,noo,nff,ntt,nn; long no,min,b; main() { fre...
by anupam
Fri Jul 02, 2004 7:59 pm
Forum: Volume 106 (10600-10699)
Topic: 10625 - GNU = GNU'sNotUnix
Replies: 16
Views: 8831

Hello,
will you please describe the algorithm you have used to solve the porblem??
getting WA 5 times.
by anupam
Fri Jul 02, 2004 7:55 pm
Forum: Algorithms
Topic: help with one "usaco hard problem" ... please.....
Replies: 19
Views: 9755

Please help me in the following problem. I have applied two different alg. but one got mle and the other got tle. Please rescue me from the 'LE' s. Here is the problem.. from USACO Shaping Regions N opaque rectangles (1 <= N <= 1000) of various colors are placed on a white sheet of paper whose size ...
by anupam
Fri Jul 02, 2004 2:48 pm
Forum: Volume 104 (10400-10499)
Topic: 10487 - Closest Sums
Replies: 89
Views: 30805

I can't still solve the problem. it gives me WA. btu donno why. Would you please give some critical cases for my program? here it is. #include<stdio.h> #include<math.h> #define N 1005 main() { freopen("in.txt","r",stdin); long int cas=1,n,i,j,h,m,z,a[N],l,dif,now,pre,b[N]; while(scanf("%ld",&n)!=EOF...
by anupam
Fri Jul 02, 2004 12:51 pm
Forum: Volume 105 (10500-10599)
Topic: 10543 - Traveling Politician
Replies: 25
Views: 7361

I have solved the problem withuot using any queue or bfs at all. I used three arrays. Let the adj matrix is a[1..N][1..N] where a [j]=1 if it is given in input otherwise it is 0. Then A^n=A^(n-1)*A given you the a matrix where each entry denotes the number of way to reach the destination from the so...
by anupam
Fri Jul 02, 2004 12:50 pm
Forum: Volume 105 (10500-10599)
Topic: 10543 - Traveling Politician
Replies: 25
Views: 7361

I have solved the problem withuot using any queue or bfs at all. I used three arrays. Let the adj matrix is a[1..N][1..N] where a [j]=1 if it is given in input otherwise it is 0. Then A^n=A^(n-1)*A given you the a matrix where each entry denotes the number of way to reach the destination from the so...
by anupam
Wed Jun 30, 2004 6:30 pm
Forum: Volume 106 (10600-10699)
Topic: 10679 - I Love Strings!!
Replies: 101
Views: 49303

Thanks Adrian, got it. Found the book, named here, also.
by anupam
Wed Jun 30, 2004 7:51 am
Forum: Volume 106 (10600-10699)
Topic: 10677 - Base Equality
Replies: 11
Views: 3514

long trans(int v,int b) {
long n = 0;
long t = 1;
while(v>0) {
n += t * (v % 10);
v /= 10;
t *= b;
}
return n;
}

this should be with base b1, not with 10;
and iiuc gold described the last case correctly.
by anupam
Tue Jun 29, 2004 9:28 am
Forum: Volume 106 (10600-10699)
Topic: 10679 - I Love Strings!!
Replies: 101
Views: 49303

Adrian, would you please describe the algorithm? it seems new to me. Or would be give me a link please??
by anupam
Tue Jun 29, 2004 9:12 am
Forum: Volume 106 (10600-10699)
Topic: 10679 - I Love Strings!!
Replies: 101
Views: 49303

Nice problem for KMP.
Thanks to Sajjad bhai :lol:
by anupam
Tue Jun 29, 2004 9:11 am
Forum: Volume 106 (10600-10699)
Topic: 10677 - Base Equality
Replies: 11
Views: 3514

First, I thought all the numbers in the input are given in base ten. But, then I found that, the range is to be treated in b1. So, the task is actually simple, for loop between the limit given, for each iterated value, convert it in b1, and then b2. then check whether b2%b1==0 if yes, then break an...
by anupam
Sat Jun 26, 2004 7:03 am
Forum: Volume 102 (10200-10299)
Topic: 10283 - The Kissing Circles
Replies: 13
Views: 5785

would you please describe the algorithm plz?
I think I have a problem in my algo.
help please.
by anupam
Wed Jun 16, 2004 8:28 am
Forum: Off topic (General chit-chat)
Topic: Who is going to win EuroCup 2004 ?
Replies: 10
Views: 5288

English is my favorite. They have passion in their play. So, I love them.
by anupam
Wed Jun 16, 2004 7:57 am
Forum: Volume 106 (10600-10699)
Topic: 10668 - Expanding Rods
Replies: 38
Views: 20545

Thanks Sohel for your help.
I got ac now. just expanding the limit of pi and checking c==0 and n==0. :lol:

Go to advanced search