Created
April 7, 2021 07:08
-
-
Save Loki-Astari/5a8f945919d53da75c9a69f9facc1a5b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <iostream> | |
int main() | |
{ | |
std::string s; | |
std::getline(std::cin, s); // Should check that worked. | |
int q; | |
std::cin >> q; | |
for (int loop = 0; loop < q; ++loop) { | |
int a, b, l; | |
std::cin >> a >> b >> l; | |
std::string_view view_a(s); | |
view_a.remove_prefix(a); | |
view_a.remove_suffix(std::size(view_a) - l); | |
std::string_view view_b(s); | |
view_b.remove_prefix(b); | |
view_b.remove_suffix(std::size(view_b) - l); | |
std::cout << ((view_a == view_b) ? "Yes" : " No") << "\n"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment