結果

問題 No.290 1010
ユーザー fjafjafjafjafjafja
提出日時 2017-09-19 18:18:58
言語 Java19
(openjdk 21)
結果
AC  
実行時間 130 ms / 5,000 ms
コード長 590 bytes
コンパイル時間 3,192 ms
コンパイル使用メモリ 72,176 KB
実行使用メモリ 54,544 KB
最終ジャッジ日時 2023-08-08 00:08:14
合計ジャッジ時間 5,790 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
47,296 KB
testcase_01 AC 43 ms
49,264 KB
testcase_02 AC 43 ms
49,080 KB
testcase_03 AC 43 ms
49,148 KB
testcase_04 AC 44 ms
49,336 KB
testcase_05 AC 44 ms
49,388 KB
testcase_06 AC 43 ms
49,208 KB
testcase_07 AC 43 ms
49,612 KB
testcase_08 AC 44 ms
49,300 KB
testcase_09 AC 43 ms
49,212 KB
testcase_10 AC 43 ms
49,208 KB
testcase_11 AC 43 ms
49,340 KB
testcase_12 AC 43 ms
49,320 KB
testcase_13 AC 43 ms
49,312 KB
testcase_14 AC 43 ms
49,336 KB
testcase_15 AC 44 ms
49,296 KB
testcase_16 AC 44 ms
49,380 KB
testcase_17 AC 43 ms
49,180 KB
testcase_18 AC 44 ms
49,140 KB
testcase_19 AC 44 ms
49,156 KB
testcase_20 AC 129 ms
54,544 KB
testcase_21 AC 120 ms
54,452 KB
testcase_22 AC 119 ms
54,024 KB
testcase_23 AC 130 ms
54,432 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class N290
{
	public static void main(String[] args) throws IOException
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int l=Integer.parseInt(br.readLine());
		String str=br.readLine();
		int end=0;
		for(int i=1;end==0&&i<=l;i++)
		{
			for(int j=i;end==0&&j+1<=l&&j+(j+1-i)<=l;j++)
			{
				if(str.substring(i-1, j).equals(str.substring(j,j+(j+1-i))))
				{end++;}
			}
		}
		if(end==1){System.out.println("YES");}
		else{System.out.println("NO");}
	}

}
0