結果
問題 | No.290 1010 |
ユーザー |
![]() |
提出日時 | 2015-10-16 22:37:32 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 50 ms / 5,000 ms |
コード長 | 375 bytes |
コンパイル時間 | 503 ms |
コンパイル使用メモリ | 56,156 KB |
実行使用メモリ | 5,424 KB |
最終ジャッジ日時 | 2024-07-21 19:20:05 |
合計ジャッジ時間 | 1,458 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
#include<iostream>#include<string>int main() {int n;std::string str;std::cin >> n >> str;for (int i = 2; i <= n; i++) { // 取り出す文字列の長さfor (int j = 0; j <= n - i; j++) {if (str.substr(j, i / 2) == str.substr(j + i / 2, i / 2)) {std::cout << "YES" << std::endl;return 0;}}}std::cout << "NO" << std::endl;return 0;}