Why i got WA?
#include <iostream>
using namespace std;
#include <cstring>
#include <cstdio>
#define N 10000
typedef struct
{
char c;
long num;
}Z;
int main(int argc, char* argv[])
{
char str[N];
long i,j,k,l,sum;
Z z;
z.num=0;
while(gets(str))
{
l=strlen(str);sum=0;
for(i=0;i<l;i++)
{
if ...
Search found 20 matches
- Fri Feb 24, 2006 2:12 pm
- Forum: Volume 4 (400-499)
- Topic: 445 - Marvelous Mazes
- Replies: 93
- Views: 21928
- Sun Feb 19, 2006 5:14 pm
- Forum: Volume 4 (400-499)
- Topic: 483 - Word Scramble
- Replies: 122
- Views: 38818
483 Presentation Error
i don't know why i got Presentation Error
it's my code
#include <iostream>
using namespace std;
#include <cstring>
#include <cstdio>
int main(int argc, char* argv[])
{
char str[1000];
char copy[1000];
char s[1000][1000];
long i,j,l,m,k;
bool flag,flag2;
while(gets(str))
{
l=strlen(str);
j=0 ...
it's my code
#include <iostream>
using namespace std;
#include <cstring>
#include <cstdio>
int main(int argc, char* argv[])
{
char str[1000];
char copy[1000];
char s[1000][1000];
long i,j,l,m,k;
bool flag,flag2;
while(gets(str))
{
l=strlen(str);
j=0 ...
- Thu Feb 09, 2006 8:39 am
- Forum: Volume 3 (300-399)
- Topic: 382 - Perfection
- Replies: 95
- Views: 35277
382 WA pls give me some test cases
382 WA pls give me some test cases
- Wed Feb 08, 2006 2:08 pm
- Forum: Volume 3 (300-399)
- Topic: 382 - Perfection
- Replies: 95
- Views: 35277
382 WA
i don't know why i got WA instead of AC.
my code following:
#include <iostream>
using namespace std;
#include <cstring>
#include <cstdio>
#include <cmath>
int main(int argc, char* argv[])
{
char str[1000];
long copy[110];
long s[110];
long i,j,k,l,sum,val,i_save,j_copy;
//bool flag;
for(i=0;i ...
my code following:
#include <iostream>
using namespace std;
#include <cstring>
#include <cstdio>
#include <cmath>
int main(int argc, char* argv[])
{
char str[1000];
long copy[110];
long s[110];
long i,j,k,l,sum,val,i_save,j_copy;
//bool flag;
for(i=0;i ...
- Sun Feb 05, 2006 4:42 pm
- Forum: Volume 102 (10200-10299)
- Topic: 10295 - Hay Points
- Replies: 20
- Views: 12664
10295 WA (need some Sample Input!!!)
10295 WA ( I need some Sample Input!!!)
- Sat Feb 04, 2006 4:08 pm
- Forum: C++
- Topic: about next_permutation() my VC6.0 can't run this function
- Replies: 2
- Views: 2063
about next_permutation() my VC6.0 can't run this function
about next_permutation() my VC6.0 can't run this function
why?
why?
- Wed Feb 01, 2006 4:01 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10179 - Irreducible Basic Fractions
- Replies: 28
- Views: 13457
10179 Time Limit Exceeded
#include "iostream.h"
#include "stdio.h"
#include "string.h"
#include "math.h"
bool Gcd(long M,long N)
{
long Rem;
while(N>0)
{
Rem=M%N;
M=N;
N=Rem;
}
if(M==1)
return true;
else
return false;
}
int main(int argc, char* argv[])
{
long n;
long i,j;
long num;
while(cin>>n)
{
if(n==0 ...
#include "stdio.h"
#include "string.h"
#include "math.h"
bool Gcd(long M,long N)
{
long Rem;
while(N>0)
{
Rem=M%N;
M=N;
N=Rem;
}
if(M==1)
return true;
else
return false;
}
int main(int argc, char* argv[])
{
long n;
long i,j;
long num;
while(cin>>n)
{
if(n==0 ...
- Tue Jan 31, 2006 5:07 pm
- Forum: Volume 4 (400-499)
- Topic: 446 - Kibbles "n" Bits "n" Bits "n" Bits
- Replies: 50
- Views: 11466
446 Output Limit Exceeded
my code :(
#include "iostream.h"
#include "stdio.h"
#include "string.h"
int main(int argc, char* argv[])
{
long N;
char h1[3],h2[3];
char b1[15],b2[15];
long val;
long l1,r1;
long i,j;
long sum1,sum2;
long sum;
char c;
while(cin>>N)
{
for(i=0;i<N;i++)
{
cin>>h1>>c>>h2;
l1=strlen ...
#include "iostream.h"
#include "stdio.h"
#include "string.h"
int main(int argc, char* argv[])
{
long N;
char h1[3],h2[3];
char b1[15],b2[15];
long val;
long l1,r1;
long i,j;
long sum1,sum2;
long sum;
char c;
while(cin>>N)
{
for(i=0;i<N;i++)
{
cin>>h1>>c>>h2;
l1=strlen ...
- Mon Jan 30, 2006 4:39 pm
- Forum: Volume 102 (10200-10299)
- Topic: 10200 - Prime Time
- Replies: 202
- Views: 96691
10200 Time Limit Exceeded (need help)
I don't know why i always got Time Limit Exceeded.
My code:
#include "iostream.h"
#include "stdio.h"
#include "math.h"
#include "string.h"
int main(int argc, char* argv[])
{
long a,b,i,j,k,num,l;
double t;
double sum;
while(cin>>a>>b)
{
num=0;
l=b-a+1;
for(i=a;i<=b;i++)
{
j=i*i+i+41;
t ...
My code:
#include "iostream.h"
#include "stdio.h"
#include "math.h"
#include "string.h"
int main(int argc, char* argv[])
{
long a,b,i,j,k,num,l;
double t;
double sum;
while(cin>>a>>b)
{
num=0;
l=b-a+1;
for(i=a;i<=b;i++)
{
j=i*i+i+41;
t ...
- Sun Jan 29, 2006 11:15 am
- Forum: Volume 105 (10500-10599)
- Topic: 10551 - Basic Remains
- Replies: 11
- Views: 8053
10551 Runtime Error
why? anyone could help me
my code:
#include "iostream.h"
#include "stdio.h"
#include "math.h"
#include "string.h"
int main(int argc, char* argv[])
{
char str[2000];
char m[100];
long b;
long i,j,l1,l2;
long sum_p,sum_m;
long val;
long sum;
while(cin>>b)
{
sum_p=0;
sum_m=0;
if(b==0 ...
my code:
#include "iostream.h"
#include "stdio.h"
#include "math.h"
#include "string.h"
int main(int argc, char* argv[])
{
char str[2000];
char m[100];
long b;
long i,j,l1,l2;
long sum_p,sum_m;
long val;
long sum;
while(cin>>b)
{
sum_p=0;
sum_m=0;
if(b==0 ...
- Sat Jan 28, 2006 1:11 pm
- Forum: Volume 109 (10900-10999)
- Topic: 10929 - You can say 11
- Replies: 69
- Views: 37106
- Sat Jan 28, 2006 8:31 am
- Forum: Volume 109 (10900-10999)
- Topic: 10929 - You can say 11
- Replies: 69
- Views: 37106
10929 - You can say 11
I got Time Limit Exceeded,but i don't know why
my code:
#include "iostream.h"
#include "stdio.h"
#include "string.h"
#include "math.h"
int main(int argc, char* argv[])
{
char str[1010];
int s_odd,s_even;
int s;
int i,j;
while(cin>>str)
{
if(strcmp(str,"0")==0)
break;
else if(str[0 ...
my code:
#include "iostream.h"
#include "stdio.h"
#include "string.h"
#include "math.h"
int main(int argc, char* argv[])
{
char str[1010];
int s_odd,s_even;
int s;
int i,j;
while(cin>>str)
{
if(strcmp(str,"0")==0)
break;
else if(str[0 ...
- Thu Jan 26, 2006 8:14 am
- Forum: Volume 4 (400-499)
- Topic: 490 - Rotating Sentences
- Replies: 212
- Views: 48059
490 Presentation Error
#include<iostream.h>
#include"string.h"
#include"stdio.h"
void main(int argc, char* argv[])
{
char a[100],b[100][150];
int k=0;
int i,j,m,n;
while(gets(a))
{
strcpy(b[k],a);
k++;
}
for(j=0;;j++)
{
m=0;
for(i=k-1;i>=0;i--)
{
n=strlen(b );
if(j>=n)
continue;
else
{
cout<<b [j];
m=1 ...
#include"string.h"
#include"stdio.h"
void main(int argc, char* argv[])
{
char a[100],b[100][150];
int k=0;
int i,j,m,n;
while(gets(a))
{
strcpy(b[k],a);
k++;
}
for(j=0;;j++)
{
m=0;
for(i=k-1;i>=0;i--)
{
n=strlen(b );
if(j>=n)
continue;
else
{
cout<<b [j];
m=1 ...
- Wed Jan 25, 2006 5:31 pm
- Forum: Volume 5 (500-599)
- Topic: 568 - Just the Facts
- Replies: 39
- Views: 21268
568 how to reduce the run time? anyone can help me ?
i found the run time is too long.
this is my code:
#include "iostream.h"
#include "stdio.h"
int main(int argc, char* argv[])
{
long n;
long sum;
long i;
while(cin>>n)
{
sum=1;
for(i=n;i>0;i--)
{
sum*=i;
}
while(sum>0)
{
if(sum%10!=0)
{
cout<<sum%10<<endl;
sum/=10;
break;
}
else ...
this is my code:
#include "iostream.h"
#include "stdio.h"
int main(int argc, char* argv[])
{
long n;
long sum;
long i;
while(cin>>n)
{
sum=1;
for(i=n;i>0;i--)
{
sum*=i;
}
while(sum>0)
{
if(sum%10!=0)
{
cout<<sum%10<<endl;
sum/=10;
break;
}
else ...
- Wed Jan 25, 2006 11:24 am
- Forum: Volume 100 (10000-10099)
- Topic: 10035 - Primary Arithmetic
- Replies: 328
- Views: 101751
10035 WA
my code:i want to know why i got WA
#include "iostream.h"
#include "math.h"
#include "string.h"
int main(int argc, char* argv[])
{
char str1[11],str2[11];
long num1[11],num2[11];
long i,j;
long m,k;
long m1,k1;
long n;
while(cin>>str1>>str2)
{
if(strcmp(str1,"0")==0&&strcmp(str2,"0")==0 ...
#include "iostream.h"
#include "math.h"
#include "string.h"
int main(int argc, char* argv[])
{
char str1[11],str2[11];
long num1[11],num2[11];
long i,j;
long m,k;
long m1,k1;
long n;
while(cin>>str1>>str2)
{
if(strcmp(str1,"0")==0&&strcmp(str2,"0")==0 ...