Search found 23 matches

by =viki=
Mon Jan 09, 2006 11:01 am
Forum: Volume 4 (400-499)
Topic: 412 - Pi
Replies: 104
Views: 30246

419 PI getting TLE

why TLE plz help,,,

time limit exceeded


#include<stdio.h>
#include<math.h>

int _fact(long int a,long int b)
{
long int i,j;
for(i=2;i<=a || i<=b;i++)
{
if(a%i==0 && b%i==0)
return 1;
}
return 0;
}

int main(void)
{

long int N,count=0,total=0,i,j;
long int arr[50];
while(1)
{
scanf ...
by =viki=
Sat Jan 07, 2006 10:45 am
Forum: Volume 1 (100-199)
Topic: 190 - Circle Through Three Points
Replies: 126
Views: 37324

im getting PE on this code


#include<stdio.h>
#include<math.h>

int main(void)
{
float x[3],y[3];
float mid1X,mid2X,mid1Y,mid2Y,m1,m2,c1,c2,temp;
float h,k,r,c,d,e;
while(scanf("%f%f%f%f%f%f",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2])==6)
{
/* while(!feof(in))
{ for(l=0;l<3;l++)
fscanf(in,"%f%f ...
by =viki=
Sat Jan 07, 2006 10:41 am
Forum: Volume 1 (100-199)
Topic: 190 - Circle Through Three Points
Replies: 126
Views: 37324

presentaion error 190

here is my code
plz check why PE



#include<stdio.h>
#include<math.h>

int main(void)
{
float x[3],y[3];
float mid1X,mid2X,mid1Y,mid2Y,m1,m2,c1,c2,temp;
float h,k,r,c,d,e;
while(scanf("%f%f%f%f%f%f",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2])==6)
{
/* while(!feof(in))
{ for(l=0;l<3;l++)
fscanf(in ...
by =viki=
Fri Jan 06, 2006 4:33 pm
Forum: Volume 4 (400-499)
Topic: 499 - What's The Frequency, Kenneth?
Replies: 93
Views: 20689

thanx.... i got AC now.

used if(ch==EOF) instead of if(ch=='.')
to break out of loop.
by =viki=
Fri Jan 06, 2006 1:50 pm
Forum: Volume 4 (400-499)
Topic: 499 - What's The Frequency, Kenneth?
Replies: 93
Views: 20689

i thought the period denotes the end of input....
thats why after Hellow Howard. the program ends..

how should i know when the input ends..
by =viki=
Thu Jan 05, 2006 2:01 pm
Forum: Volume 4 (400-499)
Topic: 499 - What's The Frequency, Kenneth?
Replies: 93
Views: 20689

damn thats silly...

neway thanx for the help....
by =viki=
Thu Jan 05, 2006 12:16 pm
Forum: Volume 1 (100-199)
Topic: 107 - The Cat in the Hat
Replies: 278
Views: 54952

107 WA (getting output for the sample input with the prob)

im getting the correct output for the inputs provided with the problem

but WA when submiting plz help me..


#include <stdio.h>

int main(void)
{
unsigned long workerCats, maxHeight;
unsigned long N, tempCount, stackHeight, uselessCats, catsInLevel, heightOfCatsInLevel;
int level, i;

scanf ...
by =viki=
Thu Jan 05, 2006 12:13 pm
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 116636

got AC.... C++ style comment was the prob

after removing the comment i got AC....
by =viki=
Thu Jan 05, 2006 12:10 pm
Forum: Volume 4 (400-499)
Topic: 499 - What's The Frequency, Kenneth?
Replies: 93
Views: 20689

499 freq.. WA (getting output on my system though..)

help me plz...
for the inputs supplied with the problem it works dunno why im getting WA

#include<stdio.h>

int count[51];
void _initialize()
{
int i;
for(i=0;i<52;i++)
count[i]=0;
}
int main(void)
{
char ch,line[100];
int i,j,max=0;

while(1)
{
ch=getchar();
if(ch>=65 && ch<=90 ...
by =viki=
Thu Jan 05, 2006 12:05 pm
Forum: Volume 4 (400-499)
Topic: 499 - What's The Frequency, Kenneth?
Replies: 93
Views: 20689

im getting wrong answer(but its working for the input given with the problem)


#include<stdio.h>

int count[51];
void _initialize()
{
int i;
for(i=0;i<52;i++)
count[i]=0;
}
int main(void)
{
char ch,line[100];
int i,j,max=0;

while(1)
{
ch=getchar();
if(ch>=65 && ch<=90)
{
count[ch-65 ...
by =viki=
Thu Jan 05, 2006 12:01 pm
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 116636

C++ style comment was the prob...

thanx for the help... i got AC after remo ving those comments...
by =viki=
Thu Jan 05, 2006 7:49 am
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 116636

damn... thats silly


thanx anyway for pointing out my error..
but how is it getting compile error though..
its doing fine on my system(using DEV C++)
by =viki=
Thu Jan 05, 2006 6:35 am
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 116636

102 compile error (compiled on my system)usin DEV C++

here is the code getting CE


#include<stdio.h>

void _cpy(char *des, char *src)
{
int i=0;
while(src[i]!='\0')
{
des[i]=src[i];
i++;
}
des[i]='\0';
}

int main(void)
{
long int arr[9],min=0;
int i;
char str[5];
while(scanf("%ld%ld%ld%ld%ld%ld%ld%ld%ld",&arr[0],&arr[1 ...
by =viki=
Thu Jan 05, 2006 6:34 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 317936

modified my code and got AC thanx for helping......

Code: Select all



oopss  sorry my mistake... :oops: 



by =viki=
Thu Jan 05, 2006 6:30 am
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 116636

plz help getting compile erroe (no error on my system though)
im using dev c++...



#include<stdio.h>

void _cpy(char *des, char *src)
{
int i=0;
while(src[i]!='\0')
{
des[i]=src[i];
i++;
}
des[i]='\0';
}

int main(void)
{
long int arr[9],min=0;
int i;
char str[5];
while(scanf("%ld%ld ...

Go to advanced search