結果

問題 No.279 木の数え上げ
ユーザー tsuchinagatsuchinaga
提出日時 2019-02-24 15:34:03
言語 Go
(1.22.1)
結果
AC  
実行時間 1,083 ms / 2,000 ms
コード長 302 bytes
コンパイル時間 12,278 ms
コンパイル使用メモリ 199,980 KB
実行使用メモリ 11,304 KB
最終ジャッジ日時 2023-08-24 17:55:08
合計ジャッジ時間 20,462 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,384 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,384 KB
testcase_08 AC 3 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1,015 ms
11,248 KB
testcase_11 AC 219 ms
5,616 KB
testcase_12 AC 685 ms
7,848 KB
testcase_13 AC 126 ms
5,600 KB
testcase_14 AC 1,083 ms
11,284 KB
testcase_15 AC 909 ms
10,016 KB
testcase_16 AC 818 ms
9,732 KB
testcase_17 AC 1,015 ms
11,256 KB
testcase_18 AC 525 ms
7,712 KB
testcase_19 AC 993 ms
11,236 KB
testcase_20 AC 1,077 ms
11,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"fmt"
	"math"
)

func main() {
	s := ""
	_, _ = fmt.Scan(&s)

	var tn, rn, en float64
	for _, r := range []rune(s) {
		switch string(r) {
		case "t":
			tn++
		case "r":
			rn++
		case "e":
			en++
		}
	}

	en = math.Floor(en / 2)
	fmt.Println(math.Min(math.Min(tn, rn), en))
}
0