Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- // Comment
- int main()
- {
- //freopen("in.txt", "r", stdin);
- char str[1000005];
- int tc = 1;
- while(scanf("%s", str)!= EOF)
- {
- printf("Case %d:\n", tc++);
- int t;
- scanf("%d", &t);
- while(t--)
- {
- int i, j;
- scanf("%d %d", &i, &j);
- int maxindex, minindex;
- maxindex = max(i, j);
- minindex = min(i, j);
- bool flag = true;
- while(minindex<= maxindex)
- {
- if(str[minindex] != str[maxindex] )
- {
- flag = false;
- break;
- }
- minindex++;
- }
- if(flag)
- printf("Yes\n");
- else
- printf("No\n");
- }
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment