Search found 19 matches

by Daredevil
Sun Jul 02, 2006 1:38 pm
Forum: Volume 103 (10300-10399)
Topic: 10394 - Twin Primes
Replies: 101
Views: 44488

10394 - Twin Primes why RE?

Here's my code: C: #include<stdio.h> #include<string.h> char sieve[19999580]; long count=0,twin[100005],i,j; void main(){ memset(sieve,1,sizeof(sieve)); for(i=4,j=6;i<=19999558||j<=19999558;i+=2,j+=3) sieve[j]=sieve =0; for(i=5;i<=19999558;i+=2){ if(sieve &&sieve[i-2]) twin[count++]=i-2; for...
by Daredevil
Sun Jul 02, 2006 1:27 pm
Forum: Volume 1 (100-199)
Topic: 195 - Anagram
Replies: 242
Views: 51953

195 - Anagrams Why WA?

I don't understand why WA. Here's my code: #include<stdio.h> #include<string.h> int count,n,len; char num[200],string[300],s[300]; void permute(){ int i; /*Uppercase letters*/ for(i=65;i<91;i++){ if(num ){ string[count++]=i; num --; if(count==len) printf("%s\n",string); else permute(); num...
by Daredevil
Sun Oct 19, 2003 12:51 pm
Forum: Volume 4 (400-499)
Topic: 402 - M*A*S*H
Replies: 56
Views: 19212

Why is 402 - M*A*S*H Runtime error (SISEGV)?

[cpp] #include<stdio.h> #include<malloc.h> struct person{ int n; struct person*next; }*head,*tail,*cur; void build(int p){ head=tail=cur=0; for(int i=0;i<p;i++){ cur=(struct person*)malloc(sizeof(struct person)); cur->n=i+1; if(!head) head=cur; else tail->next=cur; tail=cur; tail->next=0; } } void m...
by Daredevil
Wed Sep 17, 2003 7:12 am
Forum: Volume 104 (10400-10499)
Topic: 10484 - Divisibility of Factors
Replies: 39
Views: 24080

10484 - Never mind it

Could anybody help me??
I got WA all the time.

Here's my code:
[c]
????????????????
[/c]

Never mind!! :oops: :oops:
by Daredevil
Sun Aug 31, 2003 4:18 pm
Forum: Volume 102 (10200-10299)
Topic: 10252 - Common Permutation
Replies: 150
Views: 68623

Mine gives WA too. Here's my code: [c] #include<stdio.h> #include<string.h> int i,min,s[30],s1[30]; char a[1002],b[1002]; void main(){ while(scanf("%s %s",&a,&b)==2){ memset(s,0,sizeof(s)); memset(s1,0,sizeof(s1)); for(i=strlen(a)-1;i>=0;i--) s[a -97]++; for(i=strlen(b)-1;i>=0;i--)...
by Daredevil
Sun Aug 31, 2003 4:11 pm
Forum: Volume 8 (800-899)
Topic: 845 - Gas Station Numbers
Replies: 12
Views: 9196

845 - Gas Station Number WA?????

Can anyone help? This problem's driving me nuts!!! :evil: :evil:
Anyone can give some sample I/O???
Thanx in advance!!
by Daredevil
Sat Jun 28, 2003 6:06 am
Forum: Volume 101 (10100-10199)
Topic: 10197 - Learning Portuguese
Replies: 45
Views: 20895

10197

#include<stdio.h> #include<string.h> int l,c; char v1[50],v2[50],t; void main(){ while(scanf("%s",&v1)!=EOF){ gets(v2); printf("%s (to%s)\n",v1,v2); l=strlen(v1)-1; if(v1[l]=='r'){ if(v1[l-1]=='a'||v1[l-1]=='e'||v1[l-1]=='i') { t=v1[l-1];v1[l-1]=0; if(t=='i') c=1; } } if(!v1[...
by Daredevil
Thu Jun 26, 2003 5:59 pm
Forum: Volume 5 (500-599)
Topic: 573 - The Snail
Replies: 45
Views: 25663

Thanks to both of you.
I got AC now!!
:D :D :D God bless you :D :D :D
by Daredevil
Wed Jun 04, 2003 4:49 pm
Forum: Volume 5 (500-599)
Topic: 573 - The Snail
Replies: 45
Views: 25663

573 The Snail Why WA ?

Anybody can tell me where my mistake is? This problem REALLY REALLY drives my crazy !!!!!!!!!!! Here's my code [c]#include<stdio.h> int i; int s,h,u,f,d; void main(){ while(1){ scanf("%i %i %i %i",&h,&u,&d,&f); if(h==0){break;} h*=100;u*=100;d*=100; for(i=1,s=0,f*=(u/100);;...
by Daredevil
Mon Apr 07, 2003 8:03 am
Forum: Volume 101 (10100-10199)
Topic: 10195 - The Knights Of The Round Table
Replies: 59
Views: 21623

Got AC now!!!!
But when either of the side is 0, would that be a triangle? It should be a line instead of a triangle!!
But THANK YOU VERY MUCH !!!!!
Have a nice life !!
by Daredevil
Mon Apr 07, 2003 7:52 am
Forum: Volume 102 (10200-10299)
Topic: 10279 - Mine Sweeper
Replies: 102
Views: 39473

Off course, that's why I use the code: [c]while ( scanf ( " %i ", & n ) ! = EOF )[/c] Oh, wait a minute! Do you mean that the multiple input is not the n value? In that case, there can be 2 possibilities : 1. One board that is played more than once. 2. Many board, but each board played...
by Daredevil
Sun Apr 06, 2003 8:08 am
Forum: Volume 102 (10200-10299)
Topic: 10279 - Mine Sweeper
Replies: 102
Views: 39473

I've tried everything, but still WA C : #include<stdio.h> #include<string.h> int i,j,k,l,m,n,sum,yes; char game[15][15],board[15][15]; void main(){ while(scanf("%i",&n)!=EOF){ for(i=0;i<n;i++){scanf("%s",&board );} for(i=0;i<n;i++){scanf("%s",&game );} for(i...
by Daredevil
Wed Apr 02, 2003 4:39 pm
Forum: Volume 102 (10200-10299)
Topic: 10279 - Mine Sweeper
Replies: 102
Views: 39473

I'm aware that this is a multiple input problem. Btw, It's said if a bomb is encountered during the game, ALL POSITION CONTAINING THE BOMB MUST PRINTED '*' AND ALL OTHER POSITION MUST CONTAIN '.'.
Oh, should I print extra blank line between two consecutive outputs?
Thx anyway!!
by Daredevil
Wed Apr 02, 2003 4:32 pm
Forum: Volume 101 (10100-10199)
Topic: 10195 - The Knights Of The Round Table
Replies: 59
Views: 21623

You mean one of them (a,b,c) or both ((a,b),(b,c),(a,c)) or the three of them are zeroes?
And what if these zeroes occur? should I ignore this input (since it can produce negative result in the sqrt which is undefined) ?
by Daredevil
Tue Apr 01, 2003 8:41 am
Forum: Volume 102 (10200-10299)
Topic: 10279 - Mine Sweeper
Replies: 102
Views: 39473

10279 Why WA and WA ???

consider this input :
4
. . . *
. * * .
. . . .
* * * *
xxx.
xx..
x...
x...
What will the output be?
Output 1
. . . *
. * * .
. . . .
* * * *
Output 2
123.
1**.
3...
****

Or neither of them?, if so what will it be?

Go to advanced search