Search found 78 matches

by mido
Sun Nov 16, 2003 3:47 pm
Forum: Volume 1 (100-199)
Topic: 172 - Calculator Language
Replies: 35
Views: 5627

172 help!!!!!!

This problem is killing me..I even found official inputs and outputs for this problem, with my solution getting(as far as I can tell from the 15000 line output file) correct answers...here's my code: [cpp] #include <iostream> #include <sstream> #include <stack> int val[30],final[30]; using namespace...
by mido
Thu Oct 02, 2003 7:21 pm
Forum: Volume 103 (10300-10399)
Topic: 10305 - Ordering Tasks
Replies: 59
Views: 21888

Stupid error that I found...duh
by mido
Sun Sep 28, 2003 6:33 pm
Forum: Volume 103 (10300-10399)
Topic: 10305 - Ordering Tasks
Replies: 59
Views: 21888

Why does this go capoot(WA) : [cpp] #include <iostream.h> long i,e,v,dep[105],x,y,j; bool used[105],mat[105][105],first,vis[105]; void check(int x) { vis[x]=true; int i; if (dep[x]>0) for (i=1;i<=v;i++) { if (mat[x] && !used && !vis[x]) check(i); } cout<<x<<" "; used[x]=true; vis[x]=false; } void ma...
by mido
Wed Sep 24, 2003 3:00 pm
Forum: Volume 103 (10300-10399)
Topic: 10338 - Mischievous Children
Replies: 56
Views: 20626

I solved it finally...letters don't necessarily repeat after each other; Found that the hard way.
by mido
Mon Sep 22, 2003 9:58 am
Forum: Volume 102 (10200-10299)
Topic: 10219 - Find the ways !
Replies: 33
Views: 10524

Found the bug..(very special case if you like to know)
by mido
Sun Sep 21, 2003 4:59 pm
Forum: Volume 100 (10000-10099)
Topic: 10061 - How many zero's and how many digits ?
Replies: 43
Views: 21779

10061 WA

Anything wrong here...I tested it as much as I could : [cpp] #include <iostream.h> #include <math.h> #include <stdio.h> long i,zeroes,n,b,prod; double log_res; void main() { while (cin>>n>>b) { zeroes=0; prod=1; for (i=1;i<=n;i++) { prod*=i; while (prod%b==0) {zeroes++;prod/=b;} prod%=b; } log_res =...
by mido
Thu Sep 18, 2003 4:19 pm
Forum: Volume 102 (10200-10299)
Topic: 10219 - Find the ways !
Replies: 33
Views: 10524

10219 help

what's wrong with this: [cpp] #include <iostream.h> #include <stdio.h> #include <math.h> #define maxof(a,b) a > b ? a : b unsigned long n,i,m,k; double res; void main() { while (cin>>n>>m) { if (!first) cout<<endl; k = maxof(m,n-m); res=0; for (i=k+1;i<=n;i++) { res+=log10(i); res-=log10(n-i+1); } i...
by mido
Sat Jul 12, 2003 11:05 pm
Forum: Volume 104 (10400-10499)
Topic: 10419 - Sum-up the Primes
Replies: 51
Views: 17213

It's over now....I finally solved it...thanks again Mr. Manzoor..;to those interested, the code above is quite close...but some critical changes must be made to suffice the judge's requirements...:)
by mido
Sat Jul 05, 2003 3:34 pm
Forum: Volume 103 (10300-10399)
Topic: 10302 - Summation of Polynomials
Replies: 29
Views: 15316

Got AC long time ago...who would've thought you needed for the temp variable....:)
by mido
Fri Jul 04, 2003 8:08 pm
Forum: Volume 104 (10400-10499)
Topic: 10400 - Game Show Math
Replies: 32
Views: 17888

Check your if statement:
if (used[n][res+32000] || res>32000 || res<-32000) return;
if res is out of range, you'll check outside the bounds of the array
by mido
Fri Jul 04, 2003 8:04 pm
Forum: Volume 104 (10400-10499)
Topic: 10462 - Is There A Second Way Left?
Replies: 29
Views: 14937

10462 - Is There A Second Way Left ?

Is it correct that the problem here is to find the 2nd minimum spanning tree? I'd also aprreciate any tricky input - output set to check my code: #include <iostream.h> struct node{ int x; int y; int cost; bool change; } edge[210]; long long t,cur,i,j,k,v,e,x,y,cost,lim,count,sum; bool found1,found2;...
by mido
Fri Jun 27, 2003 11:03 pm
Forum: Volume 104 (10400-10499)
Topic: 10419 - Sum-up the Primes
Replies: 51
Views: 17213

No luck as of yet..am I way out with this code?...: [cpp] #include <iostream.h> bool prime[300]; bool first[150]; bool used[151][15][1010]; int *output,out_index,lim; int list[200]; int target,t,i,j,k; void prepare() //prepares a lexicographically sorted array of primes { prime[0]=false; prime[1]=fa...
by mido
Fri Jun 27, 2003 1:18 pm
Forum: Volume 104 (10400-10499)
Topic: 10419 - Sum-up the Primes
Replies: 51
Views: 17213

thanks for the reply....:)
by mido
Thu Jun 26, 2003 10:38 pm
Forum: Volume 104 (10400-10499)
Topic: 10419 - Sum-up the Primes
Replies: 51
Views: 17213

10419 sum up the primes help!

I've been trying to solve this one for too long now(6 months minimum...as far as I can tell), and I've never beat the TLE. The best I could reach was to use a normal "take or not to take" backtracking method with a slight modification. Basically, I use an array of primes sorted lexicographically, wi...
by mido
Tue Jun 03, 2003 1:46 am
Forum: Volume 104 (10400-10499)
Topic: 10482 - The Candyman Can
Replies: 10
Views: 5946

10482 - The Candyman Can

Feel ashamed to say this, but any clue would be appreciated :(

Go to advanced search