結果

問題 No.290 1010
ユーザー hanorverhanorver
提出日時 2015-10-16 22:37:32
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 48 ms / 5,000 ms
コード長 375 bytes
コンパイル時間 397 ms
コンパイル使用メモリ 53,104 KB
実行使用メモリ 5,168 KB
最終ジャッジ日時 2023-09-29 00:39:33
合計ジャッジ時間 1,613 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 20 ms
5,132 KB
testcase_21 AC 21 ms
5,124 KB
testcase_22 AC 48 ms
5,168 KB
testcase_23 AC 21 ms
5,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0