結果

問題 No.341 沈黙の期間
ユーザー urutomurutom
提出日時 2022-10-28 22:50:55
言語 Go
(1.22.1)
結果
AC  
実行時間 1,967 ms / 5,000 ms
コード長 779 bytes
コンパイル時間 13,713 ms
コンパイル使用メモリ 206,996 KB
実行使用メモリ 8,516 KB
最終ジャッジ日時 2023-09-20 06:02:13
合計ジャッジ時間 42,448 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,966 ms
8,456 KB
testcase_01 AC 1,961 ms
8,336 KB
testcase_02 AC 1,961 ms
8,320 KB
testcase_03 AC 1,952 ms
8,464 KB
testcase_04 AC 1,945 ms
8,136 KB
testcase_05 AC 1,951 ms
8,132 KB
testcase_06 AC 1,951 ms
8,480 KB
testcase_07 AC 1,936 ms
8,252 KB
testcase_08 AC 1,956 ms
8,516 KB
testcase_09 AC 1,962 ms
8,296 KB
testcase_10 AC 1,963 ms
8,352 KB
testcase_11 AC 1,934 ms
8,256 KB
testcase_12 AC 1,967 ms
8,320 KB
testcase_13 AC 1,960 ms
8,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

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

const MaxInt = math.MaxInt64

var scanner *bufio.Scanner

func main() {
	var s string
	fmt.Scanln(&s)
	for i := 100000; i > 0; i-- {
		if strings.Contains(s, strings.Repeat("…", i)) {
			fmt.Println(i)
			return
		}
	}
	fmt.Println(0)
}

func init() {
	scanner = bufio.NewScanner(os.Stdin)
	scanner.Buffer([]byte{}, MaxInt)
	scanner.Split(bufio.ScanWords)
}

func Int() int {
	scanner.Scan()
	ret, _ := strconv.ParseInt(scanner.Text(), 10, 0)
	return int(ret)
}

func Ints(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = Int()
	}
	return ret
}

func Max(a, b int) int {
	if a < b {
		return b
	}
	return a
}

func Min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
0