結果

問題 No.290 1010
コンテスト
ユーザー fmhr
提出日時 2016-07-09 07:05:20
言語 Go
(1.27.0 + ACL)
コンパイル:
/usr/bin/go_c
実行:
./Main
結果
RE  
実行時間 -
コード長 549 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 9,962 ms
コンパイル使用メモリ 270,604 KB
実行使用メモリ 9,872 KB
最終ジャッジ日時 2026-09-15 13:02:29
合計ジャッジ時間 12,065 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20 RE * 4
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

package main

import (
	"fmt"
	"bufio"
	"os"
	"strconv"
)

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	s := nextLine()
	ans := false
	for i := 0; i <= n; i++ {
		for j := i + 1; j+j-i <= n; j++ {
			//fmt.Println(i, j)
			if s[i:j] == s[j:j+j-i] {
				ans = true
				j = n
				i = n
			}
		}
	}
	if ans {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


var sc = bufio.NewScanner(os.Stdin)

func nextLine() string {
    sc.Scan()
    return sc.Text()
}

func nextInt() int {
    i, _ := strconv.Atoi(nextLine())
    return i
}
0