Search found 19 matches
- Fri Dec 28, 2012 11:33 pm
- Forum: Volume 4 (400-499)
- Topic: 444 - Encoder and Decoder
- Replies: 155
- Views: 21705
Re: 444 - Encoder and Decoder (runtime Error!)
why getting wa???????????? :o code: #include<iostream> #include<stdio.h> #include<string.h> #include<ctype.h> #include<vector> using namespace std; char mes[10000]; int func(int n) { int a=0; while(n) { a=a*10+(n%10); n=n/10; } return a; } int main() { while(gets(mes)) { vector<char>ans; vector<int>...
- Fri Nov 30, 2012 12:16 am
- Forum: Volume 5 (500-599)
- Topic: 567 - Risk
- Replies: 46
- Views: 16710
Re: WA in 567
why getting wa?? :o code: #include<iostream> #include<stdio.h> #include<vector> #include<queue> using namespace std; vector<int>v[100]; int ans; void bfs(int src,int des) { queue<int>q; q.push(src); int taken[100]= {0},distance[100]; taken[src]=1; distance[src]=0; while(!q.empty()) { int u=q.front()...
- Sat Nov 17, 2012 4:20 pm
- Forum: Volume 3 (300-399)
- Topic: 336 - A Node Too Far
- Replies: 121
- Views: 39954
Re: 336 WA
why I am getting WA?? My code: #include<stdio.h> #include<iostream> #include<vector> #include<queue> #include<set> #include<string.h> using namespace std; int main() { int edges; int x,y; int src,ttl,kase=1; vector<int>G[100000]; set<int>s; while(cin>>edges&&edges) { // cout<<edges<<endl; // memset(...
- Wed Sep 12, 2012 8:33 pm
- Forum: Volume 4 (400-499)
- Topic: 401 - Palindromes
- Replies: 196
- Views: 31437
Re: 401-Palindromes
What is problem in my code??? My input output is ok. code: #include<stdio.h> #include<string.h> char str[50],ar[50],temp[50]; int main() { while(gets(str)) { printf("%s",str); int palindrome=0,mirror_strig=0; int len=strlen(str),i,j=0; for(i=0;i<len;i++) temp =str ; temp ='\0'; // puts(temp); for(i=...
- Wed Aug 22, 2012 4:20 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10189 - Minesweeper
- Replies: 418
- Views: 67202
Re: 10189 - Minesweeper
My all input and output is ok but why I am getting WA. My code: #include<stdio.h> #include<string.h> char field[105][105]; int main() { int r,c,a=1,kase=1; while(scanf("%d %d",&r,&c)==2) { if(r==0&&c==0) break; // memset(field,0,) int i,j,count=0; for(i=0; i<r; i++) scanf("%s",&field ); for(i=0; i<r...
- Wed Aug 08, 2012 10:23 pm
- Forum: Volume 118 (11800-11899)
- Topic: 11830 - Contract Revision
- Replies: 20
- Views: 4771
Re: Contract revision_11830
my all input and output correct but why I am getting wa :oops: My code: #include<stdio.h> #include<string.h> char ch[1500],ar[1500]; int main() { int n; while(scanf("%d",&n)==1) { if(n==0) break; scanf("%s",&ch); int i,a=0; for(i=0; ch !='\0'; i++) { if(ch -'0'!=n) ar[a++]=ch ; } ar[a]='\0'; if(ar[0...
- Tue Jul 24, 2012 8:24 pm
- Forum: Volume 5 (500-599)
- Topic: 583 - Prime Factors
- Replies: 171
- Views: 36853
Re: 583 - Prime Factors
where is bug in my code: #include<stdio.h> #include<math.h> int prime[5000],k; int list[5000]; void prime_num() { int a=5000; int sq,i,j,str[5000]= {0}; sq=sqrt(a); for(i=3; i<=sq; i+=2) if(str ==0) for(j=i*i; j<=a; j+=2*i) str[j]=1; prime[0]=2; int x=1; for(i=3; i<=a; i+=2) if(str ==0) prime[x++]=i...
- Fri Jul 20, 2012 3:02 pm
- Forum: Volume 118 (11800-11899)
- Topic: 11800 - Determine the Shape
- Replies: 47
- Views: 13055
Re: 11800 - Determine the Shape
Please give me a right logic to solve 

- Fri Jul 20, 2012 3:00 pm
- Forum: Volume 109 (10900-10999)
- Topic: 10945 - Mother bear
- Replies: 65
- Views: 16855
Re: 10945 - Mother Bear WA why? Anyone help me please
thanks I have got AC 

- Tue Jul 17, 2012 7:50 pm
- Forum: Volume 109 (10900-10999)
- Topic: 10945 - Mother bear
- Replies: 65
- Views: 16855
Re: 10945 - Mother Bear WA why? Anyone help me please
what is my problem?All of my input and output is ok.But I am getting WA. :x my code is: #include <stdio.h> #include <string.h> #include <ctype.h> int main() { char str[3000],str1[3000],str2[30000]; while(gets(str)) { int i,j,k,len; if(strcmp(str,"DONE")==0) break; len=strlen(str); for(i=0; i<len; i+...
- Tue Jul 17, 2012 7:41 pm
- Forum: Volume 109 (10900-10999)
- Topic: 10992 - The Ghost of Programmers
- Replies: 36
- Views: 17674
Re: 10992 - The Ghost of Programmers
thanks so much I have got AC
- Sat Jul 14, 2012 2:24 pm
- Forum: Volume 2 (200-299)
- Topic: 294 - Divisors
- Replies: 91
- Views: 23656
Re: 294 please help me
I am asking for help but no one helping me.please help me 

- Thu Jul 12, 2012 12:45 pm
- Forum: Volume 102 (10200-10299)
- Topic: 10221 - Satellites
- Replies: 34
- Views: 13278
Re: 10221 - Satellites
thanks I have got Ac
- Wed Jul 11, 2012 7:27 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10038 - Jolly Jumpers
- Replies: 445
- Views: 79243
Re: 10038 - Jolly Jumpers
what is wrong with my algorithm: #include<stdio.h> #include<math.h> int a[3050],k[3050]; int main() { int n,i,l,dif,y,j,temp; while(scanf("%d",&n)==1) { y=0; j=0; // scanf("%d",&a[0]); for(i=0;i<n;i++) scanf("%d",&a ); for(i=0;i<n-1;i++) { temp=(a -a[i+1]); if(temp<0) temp=temp*(-1); k[j]=temp; j++;...
- Tue Jul 10, 2012 7:00 pm
- Forum: Volume 2 (200-299)
- Topic: 294 - Divisors
- Replies: 91
- Views: 23656
Re: 294 please help me
my output is ok but I am getting wa.please help me to find my bug my code: #include<stdio.h> #include<math.h> int main() { long long t,l,u,i,rem,sq,j,d=0,max,temp,swap; scanf("%lld",&t); while(t--) { d=0; max=0; scanf("%lld %lld",&l,&u); if(l>u) { swap=l; l=u; u=swap; } for(i=l;i<=u;i++) { rem=i,d=0...