#P12005. 【MX-X10-T1】[LSOT-4] 如何用中间忘了写一篇排版整齐的题解?
【MX-X10-T1】[LSOT-4] 如何用中间忘了写一篇排版整齐的题解?
Description
Given a Markdown article of length , determine whether it satisfies:
- Chinese characters are separated from English letters, numbers, or formulas by half-width spaces.
- Chinese punctuation marks should not have spaces (regardless of quantity) between them and English letters, numbers, or formulas.
In other words:
- No adjacent Chinese characters and English letters, numbers, or formulas exist.
- No pair of Chinese punctuation marks and English letters, numbers, or formulas has only spaces (any number) between them.
If the article satisfies the conditions, output Yes. Otherwise, output No.
For simplicity, the article is guaranteed to consist only of the characters a@1$,_, where:
arepresents English letters.@represents Chinese characters.1represents numbers.$represents formulas. Note: This differs from the traditional meaning of$.,represents Chinese punctuation._represents spaces.
Input Format
One line containing a string of length composed solely of a@1$,_, representing the Markdown article.
Output Format
One line containing Yes if the article meets the criteria, or No otherwise.
a@1$,_
No
a,@_1$,_
Yes
,__a
No
Hint
Sample Explanation #1
The only Chinese character is adjacent to an English letter/number, violating the requirements. Hence, the article should be rejected.
Sample Explanation #2
All Chinese characters are properly separated from English letters/numbers/formulas by spaces. All Chinese punctuation marks have no spaces between them and English letters/numbers/formulas. The article meets the criteria.
Sample Explanation #3
The only Chinese punctuation mark and an English letter are separated only by spaces, violating the requirements. Hence, the article should be rejected.
Data Range
- For of the data: .
- For another : no formulas exist.
- For another : no Chinese characters exist.
- For all data: , and the string contains only
a@1$,_.
Translation by DeepSeek R1
京公网安备 11011102002149号