⌨️

[AtCoder]ABC-212|B - Weak Password

2023/04/25に公開

設問ページ

提出結果

def getString():
    return input()


def gap(n, m):
    return (10 if n == 0 else n) - m


def main():
    x = list(map(int, getString()))
    y = [gap(x[i + 1], x[i]) for i in range(len(x) - 1)]

    r = 'Strong'
    if len(set(x)) == 1:
        r = 'Weak'
    elif len(set(y)) == 1 and sum(y) == 3:
        r = 'Weak'
    print(r)


if __name__ == "__main__":
    main()

Discussion