結果

問題 No.279 木の数え上げ
ユーザー uu
提出日時 2018-03-03 21:16:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 382 bytes
コンパイル時間 199 ms
コンパイル使用メモリ 10,616 KB
実行使用メモリ 11,084 KB
最終ジャッジ日時 2023-09-17 21:18:51
合計ジャッジ時間 2,305 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,448 KB
testcase_01 AC 19 ms
8,372 KB
testcase_02 AC 19 ms
8,452 KB
testcase_03 AC 19 ms
8,368 KB
testcase_04 AC 18 ms
8,368 KB
testcase_05 AC 18 ms
8,396 KB
testcase_06 AC 19 ms
8,440 KB
testcase_07 AC 18 ms
8,404 KB
testcase_08 AC 19 ms
8,396 KB
testcase_09 WA -
testcase_10 AC 87 ms
9,996 KB
testcase_11 AC 34 ms
8,640 KB
testcase_12 AC 65 ms
9,544 KB
testcase_13 AC 28 ms
8,536 KB
testcase_14 AC 93 ms
11,084 KB
testcase_15 AC 81 ms
10,036 KB
testcase_16 AC 75 ms
9,784 KB
testcase_17 AC 87 ms
10,732 KB
testcase_18 AC 54 ms
9,244 KB
testcase_19 AC 86 ms
9,944 KB
testcase_20 AC 91 ms
10,232 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})

if tree_count["e"] and (tree_count["e"] != 1):
    e_num = tree_count["e"]
    tree_count["e"] = int(e_num / 2)

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