Search found 6 matches

by rk
Sun Dec 24, 2006 7:53 pm
Forum: Volume 1 (100-199)
Topic: 125 - Numbering Paths
Replies: 56
Views: 11367

WA in 125

hi,

i m consttantly getting WA in 125....
kindly give test cases that fail in this using floyd warshall

code is

# include <iostream>
# include <vector>
# include <algorithm>
using namespace std;
int main()
{int X[35][35],X2[35][35],n,mx,cc=-1,Z[35][35];
vector<int> v1[35];
//vector<int> ex ...
by rk
Sun Aug 20, 2006 6:44 pm
Forum: Volume 1 (100-199)
Topic: 107 - The Cat in the Hat
Replies: 278
Views: 54926

WA in 107

my code gives right o/p 4 all test cases i encountered,
but i get WA by judge ....

please help

code is


# include <iostream.h>
# include <math.h>
int main()
{unsigned int h,i,a,b,c,fg;double d;
while(1)
{cin>>h>>i;
if(h==0 && i==0) break;
if(h==1 && i==0) cout<<"1 1\n";
else if(h==1) cout ...
by rk
Tue Aug 15, 2006 7:41 am
Forum: Volume 1 (100-199)
Topic: 106 - Fermat vs. Pythagoras
Replies: 138
Views: 30300

the idea used was

Any primitive Pythagorean triplet (m,n,p) is of the form
p=x*x+y*y
m=x*x-y*y
n=2*x*y
where x and y are co prime and at least one of x and y is even. Also all other Pythagorean triplets are simply obtained by taking multiples of these. These are well known results from number ...
by rk
Tue Aug 15, 2006 7:40 am
Forum: Volume 1 (100-199)
Topic: 106 - Fermat vs. Pythagoras
Replies: 138
Views: 30300

RE in 106

i am getting Invalid memory reference in 106. the prob works fine on my pc. no idea abt the error, please help....

code is

# include <iostream.h>
# include <stdio.h>
using namespace std;
int p(int x,int y)
{int a,b=(x<y?x:y);
for(a=2;a<=b;a++)
if(x%a==0 && y%a==0) return 0;
return 1;
}
int ...
by rk
Wed Jul 26, 2006 8:14 pm
Forum: Volume 1 (100-199)
Topic: 110 - Meta-Loopless Sorts
Replies: 92
Views: 16398

WA in 110

kindly give me test cases that give WA in 110.

code is


# include <iostream.h>
# include <string.h>
void sort(char *X,char *Y,int t);
int main()
{int n2,a,n,d;char b,c[9],e;
cin>>n2;
for(a=1;a<=n2;a++)
{cin>>n;
cout<<"\nprogram sort(input,output);\nvar\na";
for(b='b';b<'a'+n;b++)
cout ...
by rk
Sun Jul 23, 2006 12:41 pm
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 108633

runtime error in 101 - invalidmemor refrence

the code works fine on my pc but gives runtime error on submission....


# include <iostream.h>
# include <string.h>
using namespace std;
struct no
{int n;no *u,*d;};
no *Z[26],*X[26];int n,Y[26];
void rem(int a);
void pr();
int main()
{int a,b;char s[5],s2[5];no *t,*t2;
cin>>n;
for(a=0;a<n;a ...

Go to advanced search