Search found 52 matches

by lovemagic
Wed Dec 14, 2005 11:36 pm
Forum: Volume 1 (100-199)
Topic: 122 - Trees on the level
Replies: 103
Views: 11019

122...I cant see my wrong

I got several wa in this problem.Can smbody fix my bug? #include <stdio.h> #include <math.h> #include <string.h> #define max 500 int m[max][max]; int f=1,n; char nn[15],s[30],inp[30]; int row,col,hr,hc; void process(){ int i,j,k; if(f==0){ printf("not complete\n"); return; } for(i=hr;i>0 && f;i--){ ...
by lovemagic
Sun Dec 11, 2005 2:16 am
Forum: Volume 1 (100-199)
Topic: 116 - Unidirectional TSP
Replies: 226
Views: 38053

possibly u compiler doesnt support long long data type.So it gives that answer.my edited code (the only change is all long long is changed into int so that it can be compiled in any c++ version) gives the same ans as urs. #include <stdio.h> int A[15][105],M[15][105],mark[15][105]; int m,n,min; int m...
by lovemagic
Wed Dec 07, 2005 6:31 pm
Forum: Volume 1 (100-199)
Topic: 116 - Unidirectional TSP
Replies: 226
Views: 38053

plz reply cz i see no wrong in my code.I m waiting for smbody who can help me by posting sm critical i/o or debugging my code..... :cry:
by lovemagic
Wed Dec 07, 2005 6:23 pm
Forum: Volume 109 (10900-10999)
Topic: 10959 - The Party, Part I
Replies: 37
Views: 18543

I totally overlooked the line D<=p(p-1)/2.But i think they should give me RE in stead of WA.
by lovemagic
Wed Dec 07, 2005 4:47 pm
Forum: Volume 109 (10900-10999)
Topic: 10959 - The Party, Part I
Replies: 37
Views: 18543

10959 - The Party, Part I

here is my code

Code: Select all


code removed after AC....... :)    

i use bfs.But i donno where is my wrong.Give me sm i/o.
by lovemagic
Mon Dec 05, 2005 6:40 pm
Forum: Volume 1 (100-199)
Topic: 116 - Unidirectional TSP
Replies: 226
Views: 38053

116: where's my wrong?

I got several wa in this prob though all the test cases i found in the board outputs same for my code.Smbody help me? #include <stdio.h> long long A[15][105],M[15][105],mark[15][105]; long long m,n,min; long long min_val(long long a,long long b,long long c){ if(a<=c){ if(a<=b)return a; else return b...
by lovemagic
Sat Dec 03, 2005 8:45 pm
Forum: Volume 108 (10800-10899)
Topic: 10800 - Not That Kind of Graph
Replies: 48
Views: 22342

ok......I got AC.I just print with %s in stead of %c & that gives me AC.I dont know why %c got a WA.If smbody know,tell me why it's problem to use %c here.
by lovemagic
Fri Dec 02, 2005 6:49 pm
Forum: Volume 108 (10800-10899)
Topic: 10800 - Not That Kind of Graph
Replies: 48
Views: 22342

10800:where is my wrong?

I m messed up with this problem.I check all the i/o in the board but havnt found any wrong.But it still gets WA. Smbody plz check my code...... #include <stdio.h> #include <string.h> #define max 120 char m[max][max],s[max]; void init(){ int i,j; for(i=0;i<=110;i++) for(j=0;j<=110;j++) m[i][j]=' '; f...
by lovemagic
Thu Dec 01, 2005 11:15 pm
Forum: Volume 4 (400-499)
Topic: 450 - Little Black Book
Replies: 57
Views: 6680

limit

total information for 3500 person is enough.
by lovemagic
Tue Oct 12, 2004 9:32 pm
Forum: Volume 101 (10100-10199)
Topic: 10107 - What is the Median?
Replies: 74
Views: 19453

I tried with leaner search but also TLE. Do u tell me how i use min-max heap here. Here is my code---- #include <stdio.h> int i; int input[10050]; int sort(){ int i1,i2,tmp; for(i1=0;i1<i-1;i1++) for(i2=i1+1;i2<i;i2++) if(input[i1]>input[i2]){ tmp=input[i1]; input[i1]=input[i2]; input[i2]=tmp; } } v...
by lovemagic
Tue Oct 12, 2004 9:31 pm
Forum: Volume 101 (10100-10199)
Topic: 10107 - What is the Median?
Replies: 74
Views: 19453

I tried with leaner search but also TLE. Do u tell me how i use min-max heap here. Here is my code---- #include <stdio.h> int i; int input[10050]; int sort(){ int i1,i2,tmp; for(i1=0;i1<i-1;i1++) for(i2=i1+1;i2<i;i2++) if(input[i1]>input[i2]){ tmp=input[i1]; input[i1]=input[i2]; input[i2]=tmp; } } v...
by lovemagic
Mon Oct 11, 2004 9:16 pm
Forum: Volume 101 (10100-10199)
Topic: 10107 - What is the Median?
Replies: 74
Views: 19453

10107-TLE plz help

I got TLE several times. Here is my code. #include <stdio.h> #include <stdlib.h> long input[10050]; int sort(const void *a,const void *b){ long p =*(long *)a,q =*(long *)b; return p-q; } void main(){ long i=0; while(scanf("%ld",&input )!=EOF){ i++; qsort(input,i,sizeof(long),sort); if(i%2==0) printf...
by lovemagic
Sun Oct 10, 2004 10:20 pm
Forum: Volume 105 (10500-10599)
Topic: 10521 - Continuously Growing Fractions
Replies: 17
Views: 6350

10521 Why WA?

i think Q!=0,is it? Is input terminated by EOF? Here's some test cases.Where's the wrong? -0 10 0 -10 -00 -100 -5 -5 -5 5 5 5 5 -5 -0000001 1 10 -01 123465417841234654 324324535293485945680579670 1111111 23243546534965867569756 348256345439658746 234234324 -12323214 2131234857943657 63214612 -000021...
by lovemagic
Thu Sep 23, 2004 8:50 pm
Forum: Volume 7 (700-799)
Topic: 762 - We Ship Cheap
Replies: 51
Views: 20579

762-OLE

my code gets output limit exceeded! can anybody help? //start #include<stdio.h> #include<string.h> #define max 105 #define inf 99999 char city[max][35],first[35],sec[35],start[35],dest[35],faltu[10]; int matrix[max][max]; int mini(int a,int b){ if(a>b) return b; else return a; } int maxi(int a,int b...
by lovemagic
Thu Sep 23, 2004 8:41 pm
Forum: Volume 107 (10700-10799)
Topic: 10717 - Mint
Replies: 3
Views: 5106

10717 - Mint

can anybody give me some sample input of 10717?

Go to advanced search