mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-24 03:31:59 +00:00
#1272. 【20230228省选模拟赛T2】Palindrome
https://sjzezoj.com/submission/72864
This commit is contained in:
parent
bd509c8fa3
commit
f61f305eb3
45
S2OJ/1272/1272.cpp
Normal file
45
S2OJ/1272/1272.cpp
Normal file
@ -0,0 +1,45 @@
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
using std::cin;
|
||||
using std::cout;
|
||||
const char endl = '\n';
|
||||
|
||||
void solve() {
|
||||
int n;
|
||||
bool flag = false;
|
||||
std::unordered_map<std::string, bool> map, map2;
|
||||
|
||||
cin >> n;
|
||||
|
||||
for (int i = 1; i <= n; i++) {
|
||||
std::string s;
|
||||
|
||||
cin >> s;
|
||||
|
||||
map[s] = true;
|
||||
if (s.size() > 1) map2[s.substr(0, s.size() - 1)] = true;
|
||||
|
||||
std::reverse(s.begin(), s.end());
|
||||
|
||||
if (map.count(s) || map2.count(s)) flag = true;
|
||||
if (s.size() > 1 && map.count(s.substr(0, s.size() - 1))) flag = true;
|
||||
}
|
||||
|
||||
cout << (flag ? "YES" : "NO") << endl;
|
||||
}
|
||||
|
||||
int main() {
|
||||
std::ios::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
int t;
|
||||
|
||||
cin >> t;
|
||||
|
||||
while (t--) solve();
|
||||
|
||||
return 0;
|
||||
}
|
BIN
S2OJ/1272/data/ex_palindrome1.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/ex_palindrome1.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/ex_palindrome1.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/ex_palindrome1.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome1.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome1.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome1.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome1.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome10.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome10.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome10.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome10.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome11.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome11.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome11.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome11.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome12.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome12.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome12.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome12.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome13.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome13.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome13.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome13.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome14.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome14.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome14.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome14.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome15.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome15.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome15.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome15.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome16.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome16.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome16.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome16.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome17.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome17.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome17.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome17.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome18.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome18.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome18.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome18.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome19.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome19.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome19.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome19.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome2.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome2.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome2.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome2.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome20.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome20.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome20.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome20.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome3.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome3.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome3.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome3.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome4.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome4.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome4.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome4.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome5.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome5.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome5.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome5.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome6.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome6.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome6.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome6.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome7.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome7.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome7.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome7.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome8.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome8.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome8.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome8.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome9.ans
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome9.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/palindrome9.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/palindrome9.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1272/data/problem.conf
(Stored with Git LFS)
Normal file
BIN
S2OJ/1272/data/problem.conf
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user