結果
問題 | No.290 1010 |
ユーザー |
|
提出日時 | 2015-10-16 21:28:06 |
言語 | Go1.4 (1.4.2) |
結果 |
AC
|
実行時間 | 4 ms / 5,000 ms |
コード長 | 719 bytes |
コンパイル時間 | 376 ms |
コンパイル使用メモリ | 33,380 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-25 00:35:37 |
合計ジャッジ時間 | 1,123 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
package mainimport ("bufio""os""strconv""fmt")func main() {N := nextInt()S := next()if N >= 4 {fmt.Println("YES")}else {for ln := 1; ln <= N/2; ln++ {for i := 0; i < N-ln; i++ {if S[i:i+ln] == S[i+ln:i+2*ln] {fmt.Println("YES")return}}}fmt.Println("NO")}}var s = bufio.NewScanner(os.Stdin)func next() string {s.Split(bufio.ScanWords)s.Scan()return s.Text()}func nextLine() string {s.Split(bufio.ScanLines)s.Scan()return s.Text()}func nextInt() int {i, e := strconv.Atoi(next())if e != nil {panic(e)}return i}func nextLong() int64 {i, e := strconv.ParseInt(next(), 10, 64)if e != nil {panic(e)}return i}