#include<stdio.h> #include<string.h> int main () { char str[2000000]; int a,b,i,l,j,temp,t,c=1; while (scanf("%s",&str)==1) { if (str=="\0") break; printf("Case %d:\n", c++); scanf("%d",&t); for (j=0;j<t;j++) { scanf("%d%d",&a,&b); if (a==b) { printf("Yes\n"); break; } if (a>b) { temp=a; a=b; b=temp; } for (i=a;i<b;i++) { if (str[i]!=str[b]) { rintf("No\n"); break ; } if (i==b-1) printf("Yes\n"); } } getchar (); } return 0; }
Sunday, April 24, 2016
UVA 10324 - Zeros and Ones : Solution
Unknown
Studying at Shahjalal University of Science and Technology, Sylhet.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment