結果
| 問題 |
No.290 1010
|
| コンテスト | |
| ユーザー |
fmhr
|
| 提出日時 | 2016-07-09 07:05:20 |
| 言語 | Go (1.23.4) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 549 bytes |
| コンパイル時間 | 10,548 ms |
| コンパイル使用メモリ | 225,272 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-13 08:15:22 |
| 合計ジャッジ時間 | 11,708 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 RE * 4 |
ソースコード
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
}
fmhr