結果

問題 No.279 木の数え上げ
ユーザー uu
提出日時 2018-03-03 21:34:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 308 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 10,620 KB
実行使用メモリ 11,040 KB
最終ジャッジ日時 2023-09-17 21:56:39
合計ジャッジ時間 2,250 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,296 KB
testcase_01 AC 18 ms
8,360 KB
testcase_02 AC 18 ms
8,316 KB
testcase_03 AC 18 ms
8,372 KB
testcase_04 AC 18 ms
8,320 KB
testcase_05 AC 18 ms
8,356 KB
testcase_06 AC 18 ms
8,292 KB
testcase_07 AC 18 ms
8,368 KB
testcase_08 AC 18 ms
8,364 KB
testcase_09 AC 18 ms
8,300 KB
testcase_10 AC 86 ms
9,924 KB
testcase_11 AC 33 ms
8,656 KB
testcase_12 AC 67 ms
9,440 KB
testcase_13 AC 27 ms
8,548 KB
testcase_14 AC 93 ms
11,040 KB
testcase_15 AC 80 ms
10,016 KB
testcase_16 AC 79 ms
9,828 KB
testcase_17 AC 93 ms
10,832 KB
testcase_18 AC 54 ms
9,180 KB
testcase_19 AC 85 ms
10,036 KB
testcase_20 AC 93 ms
10,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

S = input()
count = Counter(S)
tree_count = dict()

for k,v in count.items():
    if k in ["t","r","e"]:
        tree_count.update({k:v})

e_num = int((tree_count["e"] if tree_count["e"] else 0)/2)

print(0 if e_num < 1 else int(min([tree_count["t"],tree_count["r"],e_num])))
0