Tried my first real codeforces round, got stuck way too long on one of the earlier questions, but over all, you gotta start somewhere i guess
This commit is contained in:
36
codeforces/rounds/762/a.cpp
Normal file
36
codeforces/rounds/762/a.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
void test_case(int tc){
|
||||
string s;
|
||||
cin >> s;
|
||||
|
||||
for(size_t i = 0; i < (s.size() + 1) / 2; ++i){
|
||||
if(s[i] != s[i + (s.size() + 1) / 2]){
|
||||
cout << "NO\n";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
cout << "YES\n";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(){
|
||||
ios::sync_with_stdio(0);
|
||||
cin.tie(0);
|
||||
|
||||
int t;
|
||||
cin >> t;
|
||||
|
||||
for(int tc = 1; tc <= t; ++tc){
|
||||
test_case(tc);
|
||||
}
|
||||
|
||||
cout << flush;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user