結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
49,200 KB
testcase_01 AC 39 ms
49,388 KB
testcase_02 AC 40 ms
49,276 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 39 ms
49,148 KB
testcase_06 AC 39 ms
49,508 KB
testcase_07 AC 38 ms
49,296 KB
testcase_08 AC 39 ms
49,384 KB
testcase_09 AC 38 ms
49,360 KB
testcase_10 AC 38 ms
49,212 KB
testcase_11 AC 40 ms
49,248 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 39 ms
49,300 KB
testcase_15 AC 38 ms
49,244 KB
testcase_16 AC 39 ms
49,212 KB
testcase_17 AC 39 ms
49,312 KB
testcase_18 AC 39 ms
49,188 KB
testcase_19 AC 38 ms
49,680 KB
testcase_20 AC 126 ms
54,232 KB
testcase_21 AC 119 ms
54,696 KB
testcase_22 AC 121 ms
54,652 KB
testcase_23 AC 120 ms
54,056 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-1).equals(str.substring(j,j+(j-i))))
				{end++;}
			}
		}
		if(end==1){System.out.println("YES");}
		else{System.out.println("NO");}
	}

}
0