Search found 7 matches

by Shafayat
Fri Sep 09, 2016 4:28 pm
Forum: Volume 11 (1100-1199)
Topic: 1172 - The Bridges of Kolsberg
Replies: 5
Views: 3112

Re: 1172 - The Bridges of Kolsberg

Why I'm getting WA? I've submitted without comments. #include<iostream> #include<string.h> #include<algorithm> #include<stdio.h> using namespace std; struct bridge { long long int cost; char city[1000],os[1000]; }le[1000],ri[1000]; //store inputs. 'le' for first bank and 'ri' for second bank struct ...
by Shafayat
Sat Mar 07, 2015 4:01 pm
Forum: Volume 4 (400-499)
Topic: 492 - Pig-Latin
Replies: 213
Views: 25634

Re: 492 - Pig-Latin

Got RTE. Can someone tell me why? #include<stdio.h> #include<string.h> int main() { int a,b,c,d,e,f,g,h,i,j,k,l; char m[10000000],n[10000000],o; while(gets(m)) { b=strlen(m); d=0; c=0; for(a=0;a<b;a++) { if((m[a]>='a' && m[a]<='z') || (m[a]>='A' && m[a]<='Z')) { if(c==0) { if(m[a]=='a' || m[a]=='e' ...
by Shafayat
Thu Feb 05, 2015 9:22 pm
Forum: Volume 112 (11200-11299)
Topic: 11221 - Magic square palindromes.
Replies: 58
Views: 20802

Re: 11221 - Magic square palindromes.

Thanks a lot. Got accepted
by Shafayat
Thu Feb 05, 2015 7:36 pm
Forum: Volume 112 (11200-11299)
Topic: 11221 - Magic square palindromes.
Replies: 58
Views: 20802

Re: 11221 - Magic square palindromes.

As gets() function can not get input after using scanf("%d"...., so I input number of test case in a string p[10]. Then convert in into integer. After that I use gets(m) to input characters of the square. From m, I separate all alphabets into n. Then check whether its length is a square of a integer...
by Shafayat
Tue Feb 03, 2015 4:32 pm
Forum: Volume 112 (11200-11299)
Topic: 11221 - Magic square palindromes.
Replies: 58
Views: 20802

Re: 11221 - Magic square palindromes.

Can anyone tell me why I got WA?

Code: Select all

Removed after accepted
by Shafayat
Tue Jan 20, 2015 7:36 pm
Forum: Volume 2 (200-299)
Topic: 263 - Number Chains
Replies: 45
Views: 7868

Re: 263 - Number Chains

Thanks a lot. Got accepted
by Shafayat
Mon Jan 19, 2015 11:39 am
Forum: Volume 2 (200-299)
Topic: 263 - Number Chains
Replies: 45
Views: 7868

Why WA in 263 - Number Chains?

#include <stdio.h> #include<string.h> #include<math.h> int main () { long long int a,b,c,d,e,f[10],g,h,i,j=0,k[2000],l,n,o=0,p; char m[100]; while(scanf("%s",m)) { if(strcmp(m,"0")==0) break; a=0; n=0; if(o>0) printf("\n"); p=0; while(a!=1) { for(c=0;c<10;c++) f[c]=0; d=0; e=1; b=strlen(m); for(c=b...

Go to advanced search