PLZ help me out. I am getting TLE.Advance thanks 2 the helpers. :roll:
#include<stdio.h>
#include<iostream.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#define max 1000009
long seive[max];
void genseive()
{
int i,j;
int sq=sqrt(max);
seive[0]=seive[1]=1;
for(i=2;i<=sq;i ...
Search found 18 matches
- Thu Sep 22, 2005 3:24 pm
- Forum: Volume 105 (10500-10599)
- Topic: 10533 - Digit Primes
- Replies: 108
- Views: 47619
- Fri Sep 16, 2005 4:16 pm
- Forum: Volume 5 (500-599)
- Topic: 583 - Prime Factors
- Replies: 171
- Views: 61155
583 Run time error??????????
plz help me out
#include<stdio.h>
#include<iostream.h>
#include<math.h>
#define max 48009 :oops:
long long seive[max];
long long prmcol[max];
void genseive()
{
long long m,n;
long long sq=sqrt(max);
seive[0]=seive[1]=1;
for(m=2;m<=sq;m++)
{
for(n=m+m;n<max;n+=m)
seive[n]=1;
}
n=-1;
for(m ...
#include<stdio.h>
#include<iostream.h>
#include<math.h>
#define max 48009 :oops:
long long seive[max];
long long prmcol[max];
void genseive()
{
long long m,n;
long long sq=sqrt(max);
seive[0]=seive[1]=1;
for(m=2;m<=sq;m++)
{
for(n=m+m;n<max;n+=m)
seive[n]=1;
}
n=-1;
for(m ...
- Wed Jul 13, 2005 12:09 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10189 - Minesweeper
- Replies: 418
- Views: 124793
- Sun Jul 10, 2005 5:30 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10189 - Minesweeper
- Replies: 418
- Views: 124793
- Sun Jul 10, 2005 5:26 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10189 - Minesweeper
- Replies: 418
- Views: 124793
10189 - Minesweeper
i just can't believe that i am getting WA!!!! i know i am making simple mistakes but can't find out where the mistake is :evil:
#include<stdio.h>
#include<iostream.h>
int main()
{
char str[50][50];
int i,j,count,a,b,field=1;
while(cin>>a>>b)
{
if(a==0&&b==0)
break;
for(i=0;i<a;i++)
{
for ...
#include<stdio.h>
#include<iostream.h>
int main()
{
char str[50][50];
int i,j,count,a,b,field=1;
while(cin>>a>>b)
{
if(a==0&&b==0)
break;
for(i=0;i<a;i++)
{
for ...
- Fri Jul 01, 2005 5:36 pm
- Forum: Volume 5 (500-599)
- Topic: 583 - Prime Factors
- Replies: 171
- Views: 61155
583~~TLE!!!~~
Why am i getting TLE???? :o
plz help me.
#include<stdio.h>
#include<iostream.h>
#include<math.h>
#define max 480000
long long seive[max];
long long prmcol[max];
void genseive()
{
long long m,n;
long long sq=sqrt(max);
seive[0]=seive[1]=1;
for(m=2;m<=sq;m++)
{
for(n=m+m;n<max;n+=m)
seive[n ...
plz help me.
#include<stdio.h>
#include<iostream.h>
#include<math.h>
#define max 480000
long long seive[max];
long long prmcol[max];
void genseive()
{
long long m,n;
long long sq=sqrt(max);
seive[0]=seive[1]=1;
for(m=2;m<=sq;m++)
{
for(n=m+m;n<max;n+=m)
seive[n ...
- Tue Apr 19, 2005 9:44 am
- Forum: Volume 103 (10300-10399)
- Topic: 10394 - Twin Primes
- Replies: 101
- Views: 48524
10394 WA????
plz help me :o
#include<iostream.h>
#include<stdio.h>
#include<math.h>
#define max 100000
long long seive[max];
long long pi;
long long a[max],b[max];
long long prime[max];
void genseive()
{
long i,j,sq;
sq=sqrt(max);
seive[0]=seive[1]=1;
for(i=2;i<=sq;++i)
{
for(j=i+i;j<=max;j+=i)
seive[j ...
#include<iostream.h>
#include<stdio.h>
#include<math.h>
#define max 100000
long long seive[max];
long long pi;
long long a[max],b[max];
long long prime[max];
void genseive()
{
long i,j,sq;
sq=sqrt(max);
seive[0]=seive[1]=1;
for(i=2;i<=sq;++i)
{
for(j=i+i;j<=max;j+=i)
seive[j ...
- Tue Apr 05, 2005 9:01 pm
- Forum: Volume 7 (700-799)
- Topic: 713 - Adding Reversed Numbers
- Replies: 142
- Views: 60663
Now Run Time Error????
now run time error!!! plz help me :o
#include<stdio.h>
#include<string.h>
#include<iostream.h>
#define L 20000000
void reverse(char *orig,char *store)
{
long long len;
len=strlen(orig);
long long i;
for(i=len-1;i>=0;i--)
{
store[len-i-1]=orig ;
store[len]='\0';
}
}
void add(char s[], char t ...
#include<stdio.h>
#include<string.h>
#include<iostream.h>
#define L 20000000
void reverse(char *orig,char *store)
{
long long len;
len=strlen(orig);
long long i;
for(i=len-1;i>=0;i--)
{
store[len-i-1]=orig ;
store[len]='\0';
}
}
void add(char s[], char t ...
- Sun Apr 03, 2005 5:02 pm
- Forum: Volume 7 (700-799)
- Topic: 713 - Adding Reversed Numbers
- Replies: 142
- Views: 60663
713 why WA plz help
why am i getteing WA :o plz help me
#include<iostream.h>
#include<stdio.h>
#include<string.h>
void strrev1(char *str1,char *str2)
{
long long len,i,j,k;
len=strlen(str1);
for(i=0;i<=len;i++)
str2 =str1[len-i-1];
}
int main()
{
char buffer[100000],bufferrev[100000],fuffer[100000],fufferrev ...
#include<iostream.h>
#include<stdio.h>
#include<string.h>
void strrev1(char *str1,char *str2)
{
long long len,i,j,k;
len=strlen(str1);
for(i=0;i<=len;i++)
str2 =str1[len-i-1];
}
int main()
{
char buffer[100000],bufferrev[100000],fuffer[100000],fufferrev ...
- Fri Feb 04, 2005 3:52 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10327 - Flip Sort
- Replies: 81
- Views: 35373
10327 why WA????
plz help me :o
why WA?
#include<stdio.h>
#include<iostream.h>
int main()
{
long long n,data[10000],j,k,i,temp,swap;
while(cin>>n)
{
for(i=1;i<=n;i++)
cin>>data ;
swap=0;
for(k=1;k<=n-1;k++)
{
for(j=1;j<=n-k;j++)
{
if(data[j]>=data[j+1])
{
temp=data[j];
data[j]=data[j+1];
data[j+1 ...
why WA?
#include<stdio.h>
#include<iostream.h>
int main()
{
long long n,data[10000],j,k,i,temp,swap;
while(cin>>n)
{
for(i=1;i<=n;i++)
cin>>data ;
swap=0;
for(k=1;k<=n-1;k++)
{
for(j=1;j<=n-k;j++)
{
if(data[j]>=data[j+1])
{
temp=data[j];
data[j]=data[j+1];
data[j+1 ...
- Thu Feb 03, 2005 6:01 pm
- Forum: Volume 4 (400-499)
- Topic: 488 - Triangle Wave
- Replies: 270
- Views: 64374
- Wed Feb 02, 2005 7:53 pm
- Forum: Volume 5 (500-599)
- Topic: 576 - Haiku Review
- Replies: 50
- Views: 22438
- Tue Feb 01, 2005 2:54 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10050 - Hartals
- Replies: 59
- Views: 29761
- Mon Jan 31, 2005 8:23 pm
- Forum: Volume 5 (500-599)
- Topic: 576 - Haiku Review
- Replies: 50
- Views: 22438
- Mon Jan 31, 2005 8:20 pm
- Forum: Volume 4 (400-499)
- Topic: 488 - Triangle Wave
- Replies: 270
- Views: 64374
488 why WA???
plz help me out.
#include<stdio.h>
#include<iostream.h>
int main()
{
int a,f,i,j,k,l,m,flag;
cin>>a>>f;
flag=0;
for(i=1;i<=f;i++)
{
if(flag==1)
cout<<"\n";
for(j=1;j<=a;j++)
{
for(k=1;k<=j;k++)
cout<<j;
cout<<"\n";
}
for(l=a-1;l>=1;l--)
{
for(m=1;m<=l;m++)
cout<<l;
cout<<"\n ...
#include<stdio.h>
#include<iostream.h>
int main()
{
int a,f,i,j,k,l,m,flag;
cin>>a>>f;
flag=0;
for(i=1;i<=f;i++)
{
if(flag==1)
cout<<"\n";
for(j=1;j<=a;j++)
{
for(k=1;k<=j;k++)
cout<<j;
cout<<"\n";
}
for(l=a-1;l>=1;l--)
{
for(m=1;m<=l;m++)
cout<<l;
cout<<"\n ...