My mind is out..Why WA. I've got it 10 times.
but it seems ok. Plz Plz Plz help me.
Here is my code.
#include<stdio.h>
int main()
{
char a[105][105],ch;
int b[105][2]={0},i,j,n,m,p,test;
scanf("%d",&test);
for(int k=1;k<=test;k++)
{
scanf("%d %d",&n,&m);
ch=getchar();
for(i=0;i<m;i ...
Search found 9 matches
- Sun Jan 23, 2011 8:29 pm
- Forum: Volume 6 (600-699)
- Topic: 612 - DNA Sorting
- Replies: 122
- Views: 33674
- Sat Jan 15, 2011 9:08 pm
- Forum: Volume 109 (10900-10999)
- Topic: 10954 - Add All
- Replies: 80
- Views: 41715
Re: 10954 - Add All
Runtime Error why??? I'm just dying with this problem. Someone Plz help me !!! :(
#include<stdio.h>
long int partition(long int m,long int p);
void interchange(long int i,long int j);
void quicksort(long int p,long int q);
long int a[5500],num;
int main()
{
long int carry,sum,total,i;
while ...
#include<stdio.h>
long int partition(long int m,long int p);
void interchange(long int i,long int j);
void quicksort(long int p,long int q);
long int a[5500],num;
int main()
{
long int carry,sum,total,i;
while ...
- Sun Dec 19, 2010 11:14 am
- Forum: Volume 101 (10100-10199)
- Topic: 10110 - Light, more light
- Replies: 76
- Views: 39830
Re: 10110 - Light, More Light
why WA plz help
Code: Select all
#include<stdio.h>
#include<math.h>
int main()
{
double n;
while(scanf("%f",&n)==1)
{
if(floor(sqrt(n))==ceil(sqrt(n)))
printf("yes\n");
else printf("no\n");
}
return 0;
}
- Sun Dec 19, 2010 10:59 am
- Forum: Volume 101 (10100-10199)
- Topic: 10110 - Light, more light
- Replies: 76
- Views: 39830
Re: 10110 - Light, More Light
why TLE???
#include<stdio.h>
int main()
{
long long int n,j,count;
while(scanf("%lld",&n)==1)
{ count=0;
if(n==0)break;
if(n%2==0)
for(j=1;j<=n;j++)
{
if(n%j==0) count++;
}
else for(j=1;j<=n;j+=2)
{
if(n%j==0) count++;
}
if(count%2!=0)printf("yes\n");
else printf("no\n ...
#include<stdio.h>
int main()
{
long long int n,j,count;
while(scanf("%lld",&n)==1)
{ count=0;
if(n==0)break;
if(n%2==0)
for(j=1;j<=n;j++)
{
if(n%j==0) count++;
}
else for(j=1;j<=n;j+=2)
{
if(n%j==0) count++;
}
if(count%2!=0)printf("yes\n");
else printf("no\n ...
- Sat Nov 06, 2010 7:14 pm
- Forum: Volume 116 (11600-11699)
- Topic: 11636 - Hello World!
- Replies: 30
- Views: 12530
Re: 11636 -why WA, plz help!!!!
#include<stdio.h>
int main()
{
long int count,paste,n,i;
i=1;
while(scanf("%ld",&n)==1)
{
count=1;paste=0;
if(n==-1)break;
else if(n==1)
paste=0;
else
{
while(1)
{
count*=2;
if(count>=n){paste++;break;}
else paste++;
}
}
printf("Case %ld: %ld\n",i++,paste);
}
return 0;
}
int main()
{
long int count,paste,n,i;
i=1;
while(scanf("%ld",&n)==1)
{
count=1;paste=0;
if(n==-1)break;
else if(n==1)
paste=0;
else
{
while(1)
{
count*=2;
if(count>=n){paste++;break;}
else paste++;
}
}
printf("Case %ld: %ld\n",i++,paste);
}
return 0;
}
- Tue Feb 24, 2009 8:50 pm
- Forum: Volume 115 (11500-11599)
- Topic: 11526 - H(n)
- Replies: 49
- Views: 24802
Re: 11526 - H(n)
I have got TLE, please anyone honest help me as I am a beginner.
Here is my code
#include<stdio.h>
int main()
{
long long n,res,i;
int j,num;
scanf("%d",&num);
for(j=1;j<=num;j++)
{
scanf("%lld",&n);
if(n<1)
n=n*(-1);
res=0;
for(i=1;i<=n;i=i+1)
{
res = (res + n/i);
}
printf("%lld ...
Here is my code
#include<stdio.h>
int main()
{
long long n,res,i;
int j,num;
scanf("%d",&num);
for(j=1;j<=num;j++)
{
scanf("%lld",&n);
if(n<1)
n=n*(-1);
res=0;
for(i=1;i<=n;i=i+1)
{
res = (res + n/i);
}
printf("%lld ...
- Thu Nov 20, 2008 4:58 pm
- Forum: Volume 105 (10500-10599)
- Topic: 10515 - Powers Et Al.
- Replies: 124
- Views: 45404
Re: 10515 - Power et al.
/*
What's the problem of my code please anyone inform me.
I got wrong answer :oops: .
*/
#include<stdio.h>
int main()
{
long long b,m,p,a[10000],i,x,power,j;
while(scanf("%lld %lld",&b,&p)==2)
{
if((b==0)&&(p==0))
break;
m=10;
i=0;
while(p!=0)
{
a[i++]=p%2;
p=p/2;
}
x=1;
power=b%m ...
What's the problem of my code please anyone inform me.
I got wrong answer :oops: .
*/
#include<stdio.h>
int main()
{
long long b,m,p,a[10000],i,x,power,j;
while(scanf("%lld %lld",&b,&p)==2)
{
if((b==0)&&(p==0))
break;
m=10;
i=0;
while(p!=0)
{
a[i++]=p%2;
p=p/2;
}
x=1;
power=b%m ...
- Fri Nov 14, 2008 10:24 am
- Forum: Volume 101 (10100-10199)
- Topic: 10139 - Factovisors
- Replies: 80
- Views: 42132
Re:10193 - All you need is Love
/*
I am totally astonished, I got WA, Please anyone help to find out the reason
Here is my code:
*/
#include<stdio.h>
#include<string.h>
#include<math.h>
int main(){
long int i,k,len1,len2,M,N,n,temp,flag,half,s1,s2;
char a[100],b[100];
scanf("%ld",&n);
for(half=1;half<=n;half ...
I am totally astonished, I got WA, Please anyone help to find out the reason
Here is my code:
*/
#include<stdio.h>
#include<string.h>
#include<math.h>
int main(){
long int i,k,len1,len2,M,N,n,temp,flag,half,s1,s2;
char a[100],b[100];
scanf("%ld",&n);
for(half=1;half<=n;half ...
- Thu Nov 13, 2008 2:18 pm
- Forum: Volume 111 (11100-11199)
- Topic: 11185 - Ternary
- Replies: 34
- Views: 20295
Re: 11185 - Ternary
Thank you so much, I have got accepted now.