Search found 53 matches

by oulongbin
Sun Sep 05, 2004 10:01 am
Forum: Volume 100 (10000-10099)
Topic: 10042 - Smith Numbers
Replies: 75
Views: 23277

thanx ,i have changed the value :
[cpp]
bool b[1000000]={0};
void prime()
{
int i,j;
b[1]=1;
for(i=1;i<1000;i++)
if (b==0)
for(j=2;j<=1000000/i;j++)
b[i*j]=1;
}
[/cpp]
but still got TLE.
by oulongbin
Sun Sep 05, 2004 9:53 am
Forum: Volume 101 (10100-10199)
Topic: 10176 - Ocean Deep ! - Make it shallow !!
Replies: 37
Views: 12315

10176 WA???

please help me ,thanx; [cpp] #include <iostream> using namespace std; #include <cmath> #include <cstdio> #include <cstring> int main() { int s; int b=2; char c; int p=131071; while(cin.get(c)) { s=0; do { if(c=='1'||c=='0') { s *= b; s += int(c)-48; s %= p; } }while(cin.get(c)&&c!='#'); if(s==0) cou...
by oulongbin
Sun Sep 05, 2004 5:39 am
Forum: Volume 100 (10000-10099)
Topic: 10042 - Smith Numbers
Replies: 75
Views: 23277

10042 Runtime Error??

This is my code ,why it will RT?? [cpp] #include <iostream> using namespace std; #include <cmath> #include <cstdio> bool b[20250000]={0}; void prime() { long i,j; b[1]=1; for(i=1;i<4500;i++) if (b ==0) for(j=2;j<=20250000/i;j++) b[i*j]=1; } int main() { long p[7000]; long i,j; long n; long x,t,pt,k;...
by oulongbin
Sat Aug 28, 2004 4:19 am
Forum: Volume 3 (300-399)
Topic: 355 - The Bases Are Loaded
Replies: 74
Views: 22934

355 WA

can someone tell me why my code is wrong?? [cpp] #include <iostream> using namespace std; #include <cstring> #include <cmath> int main() { int a,b; char c[15]={'\0'}; char cc[100]; int len; int i; long long temp; bool illegala; while(cin>>a>>b) { cin>>c; illegala=false; len=strlen(c); for(i=0;i<len;...
by oulongbin
Wed Aug 25, 2004 4:48 am
Forum: Volume 4 (400-499)
Topic: 444 - Encoder and Decoder
Replies: 155
Views: 21978

444 WA

I think the code doens't have any bug. What's wrong with the code? [cpp] #include <iostream> using namespace std; #include <cmath> #include <cstdio> int main() { char a[200]; char c[300]; int t; int len; int i,j; while(cin.getline(a,200)) { if(a[0]>='0'&&a[0]<='9') { len=strlen(a); j=0; for(i=len-1;...
by oulongbin
Sun Aug 22, 2004 10:45 am
Forum: Volume 103 (10300-10399)
Topic: 10394 - Twin Primes
Replies: 101
Views: 32579

10394 compiler error??

This is my code ,it runs well in VC,why i submit it will be compiler error?? [cpp] #include <iostream> using namespace std; int b[20250000]={0}; void prime() { long i,j; b[1]=1; for(i=1;i<4500;i++) if (b ==0) for(j=2;j<=20250000/i;j++) b[i*j]=1; } int main() { long a[100010]; long cnt=1; long i,j; p...
by oulongbin
Sat Aug 21, 2004 11:21 am
Forum: Volume 1 (100-199)
Topic: 145 - Gondwanaland Telecom
Replies: 62
Views: 9355

145 WA thanx

plz help me ,thanx! [cpp] #include <iostream> using namespace std; #include <cstdio> #include <cmath> int main() { char dis; char l[50]; char tnb[8]; int starth,startm,endh,endm; int stime,etime; int time[1441]; int d,e,n; int i; double money,day,evening,night; while(cin.getline(l,50)&&l[0]!='#') { ...
by oulongbin
Tue Aug 17, 2004 5:38 am
Forum: Volume 3 (300-399)
Topic: 374 - Big Mod
Replies: 79
Views: 11963

thank you very much!
i got AC now ! :D
by oulongbin
Sun Aug 15, 2004 3:42 pm
Forum: Volume 105 (10500-10599)
Topic: 10533 - Digit Primes
Replies: 108
Views: 31985

10533 WA

this is my code. i think it is right.can someone tell me why i always gei WA :cry: [cpp] #include <iostream> using namespace std; #include <cstdio> int b[1000000]={0}; void prime() { int i,j; b[0]=1; b[1]=1; for(i=1;i<1000;i++) if (b ==0) for(j=2;j<=1000000/i;j++) b[i*j]=1; } int main() { prime(); l...
by oulongbin
Sun Aug 15, 2004 10:45 am
Forum: Volume 103 (10300-10399)
Topic: 10323 - Factorial! You Must be Kidding!!!
Replies: 106
Views: 32565

10323 compiler error!

can somebody tell me why it will compiler error? [cpp] #include <iostream> using namespace std; int main() { long long d; int n; int i; bool f; while(cin>>n) { f=false; d=1; for(i=1;i<=n;i++) { d*=i; if(d>6227020800) { f=true; break; } } if(f) cout<<"Overflow!"<<endl; if(d<10000&&!f) cout<<"Underflo...
by oulongbin
Thu Aug 12, 2004 3:15 pm
Forum: Volume 3 (300-399)
Topic: 374 - Big Mod
Replies: 79
Views: 11963

374 WA!

Could somebody tell me why it always says TLE? i think it is all right. [cpp] #include <iostream.h> long bigmod(long b,long p,long m) { if (p==0) return 1; else if (p%2==0) return (bigmod(b,p/2,m))*(bigmod(b,p/2,m))%m; else return ((b%m)*(bigmod(b,p-1,m)%m))%m; } int main() { long b,p,m; while(cin>>...
by oulongbin
Fri Jul 30, 2004 12:05 pm
Forum: Volume 4 (400-499)
Topic: 483 - Word Scramble
Replies: 122
Views: 20207

Thanks.I have changed my code.Now got AC.
Thank you very much! :D
by oulongbin
Thu Jul 29, 2004 4:30 am
Forum: Volume 4 (400-499)
Topic: 483 - Word Scramble
Replies: 122
Views: 20207

483 WA

Could somebody tell me what's wrong with my code? Thanx. [cpp] #include <iostream> using namespace std; #include <cstdio> #include <cstring> int main() { int temp; bool flag; char *a; a=new char; while(gets(a)) { flag=true; for(int i=0;i<strlen(a);i++) { if(a[i-1]==' '&&a ==' ') cout<<" "; if(a !=' ...
by oulongbin
Wed Jul 28, 2004 1:38 pm
Forum: Volume 1 (100-199)
Topic: 160 - Factors and Factorials
Replies: 205
Views: 25145

I know why i was wrong.
It's the output problem,thank you .
by oulongbin
Wed Jul 28, 2004 8:26 am
Forum: Volume 102 (10200-10299)
Topic: 10219 - Find the ways !
Replies: 33
Views: 10395

Sorry,i am not very know what is your meaning.
Could you explain it more particular?
Thanks. :P

Go to advanced search