結果
問題 | No.290 1010 |
ユーザー |
![]() |
提出日時 | 2017-09-19 18:18:58 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 134 ms / 5,000 ms |
コード長 | 590 bytes |
コンパイル時間 | 3,575 ms |
コンパイル使用メモリ | 73,124 KB |
実行使用メモリ | 41,548 KB |
最終ジャッジ日時 | 2024-11-08 05:40:10 |
合計ジャッジ時間 | 5,715 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
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");}}}