結果

問題 No.279 木の数え上げ
ユーザー kat0rikkat0rik
提出日時 2020-01-12 18:36:42
言語 Go
(1.22.1)
結果
AC  
実行時間 1,066 ms / 2,000 ms
コード長 322 bytes
コンパイル時間 11,945 ms
コンパイル使用メモリ 201,356 KB
実行使用メモリ 7,812 KB
最終ジャッジ日時 2023-08-20 01:15:44
合計ジャッジ時間 22,621 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,352 KB
testcase_01 AC 2 ms
4,356 KB
testcase_02 AC 2 ms
4,356 KB
testcase_03 AC 2 ms
4,352 KB
testcase_04 AC 1 ms
4,352 KB
testcase_05 AC 2 ms
4,356 KB
testcase_06 AC 2 ms
4,352 KB
testcase_07 AC 2 ms
4,356 KB
testcase_08 AC 3 ms
4,380 KB
testcase_09 AC 1 ms
4,356 KB
testcase_10 AC 1,000 ms
7,792 KB
testcase_11 AC 216 ms
5,604 KB
testcase_12 AC 666 ms
7,700 KB
testcase_13 AC 120 ms
4,356 KB
testcase_14 AC 1,066 ms
7,812 KB
testcase_15 AC 884 ms
7,792 KB
testcase_16 AC 809 ms
7,792 KB
testcase_17 AC 1,006 ms
7,796 KB
testcase_18 AC 514 ms
7,684 KB
testcase_19 AC 971 ms
7,792 KB
testcase_20 AC 1,052 ms
7,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import "fmt"

func main() {
	var S string
	fmt.Scan(&S)
	set := make(map[byte]int, 0)
	for i := 0; i < len(S); i++ {
		if S[i] == 't' || S[i] == 'r' || S[i] == 'e' {
			set[S[i]]++
		}
	}
	fmt.Println(min(set['t'], min(set['r'], set['e']/2)))
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
0