結果

問題 No.341 沈黙の期間
ユーザー urutomurutom
提出日時 2022-10-28 22:48:33
言語 Go
(1.22.1)
結果
WA  
実行時間 -
コード長 763 bytes
コンパイル時間 14,984 ms
コンパイル使用メモリ 206,792 KB
実行使用メモリ 8,488 KB
最終ジャッジ日時 2023-09-20 05:58:27
合計ジャッジ時間 45,216 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,925 ms
8,260 KB
testcase_01 AC 1,938 ms
8,464 KB
testcase_02 AC 1,951 ms
8,268 KB
testcase_03 AC 1,934 ms
8,272 KB
testcase_04 AC 1,946 ms
8,240 KB
testcase_05 AC 1,932 ms
8,360 KB
testcase_06 AC 1,937 ms
8,468 KB
testcase_07 AC 1,934 ms
8,312 KB
testcase_08 AC 1,922 ms
8,388 KB
testcase_09 AC 1,909 ms
8,484 KB
testcase_10 AC 1,937 ms
8,256 KB
testcase_11 WA -
testcase_12 AC 1,960 ms
8,320 KB
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

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
		}
	}
}

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