結果

問題 No.290 1010
ユーザー tsunabittsunabit
提出日時 2020-03-25 13:49:30
言語 Java19
(openjdk 21)
結果
WA  
実行時間 -
コード長 572 bytes
コンパイル時間 3,593 ms
コンパイル使用メモリ 72,956 KB
実行使用メモリ 59,508 KB
最終ジャッジ日時 2023-08-30 09:34:25
合計ジャッジ時間 9,033 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
55,652 KB
testcase_01 AC 130 ms
55,656 KB
testcase_02 AC 130 ms
55,948 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 130 ms
55,768 KB
testcase_06 AC 132 ms
55,800 KB
testcase_07 AC 132 ms
56,056 KB
testcase_08 AC 130 ms
55,408 KB
testcase_09 RE -
testcase_10 AC 129 ms
55,812 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 AC 131 ms
55,752 KB
testcase_15 AC 131 ms
55,804 KB
testcase_16 AC 131 ms
53,576 KB
testcase_17 AC 130 ms
55,772 KB
testcase_18 AC 131 ms
55,796 KB
testcase_19 AC 131 ms
55,552 KB
testcase_20 AC 297 ms
58,940 KB
testcase_21 AC 311 ms
59,508 KB
testcase_22 AC 283 ms
59,236 KB
testcase_23 AC 275 ms
59,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;

public class No290 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String s = sc.next();
		if(s.length() < 2) {
			System.out.println("NO");
			return;
		}
		for(int i = 0; i < n; i++) {
			for(int j = 0; j < n; j++) {
				if(j+(j+1-i) <= n) {
					String m = s.substring(i, j+1);
					String a = s.substring(j+1, j+(j+1-i)+1);
					if(m.equals(a)) {
						System.out.println("YES");
						return;
					}
				}
			}
		}
		System.out.println("NO");
	}
}
0