結果
| 問題 |
No.290 1010
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-12-05 14:42:20 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 591 bytes |
| コンパイル時間 | 1,435 ms |
| コンパイル使用メモリ | 169,632 KB |
| 実行使用メモリ | 6,616 KB |
| 最終ジャッジ日時 | 2024-07-19 00:01:43 |
| 合計ジャッジ時間 | 2,564 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 WA * 2 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
string s;
cin >> s;
string t = s;
while(s.size() > 1) {
string a, b;
if(s.size() % 2 == 0) {
a = s.substr(0, s.size() / 2);
b = s.substr(s.size() / 2);
if(a == b) {
cout << "YES" << endl;
return 0;
}
a = t.substr(0, t.size() / 2 - 1);
b = t.substr(t.size() / 2);
if(a == b) {
cout << "YES" << endl;
return 0;
}
}
s.pop_back();
t.pop_back();
}
cout << "NO" << endl;
return 0;
}