#abc212b. B - Weak Password
B - Weak Password
Score : points
问题描述
你将得到一个位数的PIN码:,它可能以0开头。当PIN码满足以下任一条件时,我们认为它是弱PIN码:
- 四个数字完全相同。
- 对于每个整数,满足时,紧跟在之后。这里,对于每个, 紧跟在 之后,并且紧跟在之后。
如果给出的PIN码是弱PIN码,则输出Weak
;否则,输出Strong
。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given a -digit PIN: , which may begin with a . The PIN is said to be weak when it satisfies one of the following conditions:
- All of the four digits are the same.
- For each integer such that , follows . Here, follows for each , and follows .
If the given PIN is weak, print Weak
; otherwise, print Strong
.
Constraints
- , , , and are integers.
Input
Input is given from Standard Input in the following format:
Output
If the given PIN is weak, print Weak
; otherwise, print Strong
.
Sample Input 1
7777
Sample Output 1
Weak
All four digits are , satisfying the first condition, so this PIN is weak.
Sample Input 2
0112
Sample Output 2
Strong
The first and second digits differ, and the third digit does not follow the second digit, so neither condition is satisfied.
Sample Input 3
9012
Sample Output 3
Weak
Note that follows .
update @ 2024/3/10 09:26:56