⌨️

[AtCoder]ABC-033|C - 数式の書き換え

2024/11/14に公開

設問ページ

提出結果

import math


def getString():
    return input()


def main():
    S = getString()

    a = S.split("+")
    c = 0
    for b in a:
        x = math.prod(map(int, b.split("*")))
        c += 1 if x > 0 else 0
    print(c)


if __name__ == "__main__":
    main()

Discussion