結果

問題 No.290 1010
ユーザー fjafjafjafjafjafja
提出日時 2017-09-19 18:18:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 590 bytes
コンパイル時間 2,924 ms
コンパイル使用メモリ 74,672 KB
実行使用メモリ 54,004 KB
最終ジャッジ日時 2024-04-25 18:13:48
合計ジャッジ時間 5,252 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
50,420 KB
testcase_01 AC 54 ms
50,364 KB
testcase_02 AC 49 ms
50,172 KB
testcase_03 AC 50 ms
49,812 KB
testcase_04 AC 47 ms
50,016 KB
testcase_05 AC 49 ms
50,280 KB
testcase_06 AC 50 ms
50,332 KB
testcase_07 AC 45 ms
50,368 KB
testcase_08 AC 45 ms
50,420 KB
testcase_09 AC 48 ms
50,476 KB
testcase_10 AC 50 ms
50,068 KB
testcase_11 AC 48 ms
50,420 KB
testcase_12 AC 47 ms
50,388 KB
testcase_13 AC 50 ms
50,324 KB
testcase_14 AC 49 ms
50,092 KB
testcase_15 AC 49 ms
50,036 KB
testcase_16 AC 48 ms
50,020 KB
testcase_17 AC 51 ms
50,196 KB
testcase_18 AC 52 ms
50,328 KB
testcase_19 AC 51 ms
50,332 KB
testcase_20 AC 119 ms
53,700 KB
testcase_21 AC 127 ms
54,004 KB
testcase_22 AC 124 ms
53,816 KB
testcase_23 AC 129 ms
53,920 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