XMZ_LL
XMZ_LL
全部文章
分类
归档
标签
去牛客网
登录
/
注册
XMZ_LL的博客
全部文章
(共45篇)
题解 | #单词倒排#
import re sentence=input() word=re.split('\W',sentence) word.reverse() new_sentence=' '.join(word) print(new_sentence)
2024-02-17
0
183
题解 | #坐标移动#
#以分号分隔读取 #正则表达式验证移动是否有效 #移动or 丢弃 import re def isorientation(mystr): is_vaild = bool(re.fullmatch(r"^[AWDS]\d{1,2}$", mystr)) retur...
2024-02-17
0
170
题解 | #坐标移动#
#以分号分隔读取 #验证移动是否有效 #移动or 丢弃 import re def isorientation(mystr): is_vaild = bool(re.fullmatch(r"[AWDS]\d+", mystr)) return is_vaild ...
2024-02-17
0
176
题解 | #字符统计#
from sre_compile import isstring string=input() strings={} for i in string: if i in strings: strings[i]+=1 else: ...
2024-02-07
0
159
题解 | #记负均正II#
import sys lines = [] for line in sys.stdin: lines.append(int(line)) times=0 nums=[] for num in lines: if num<0: times+=1 el...
2024-02-07
0
160
题解 | #记负均正II#
import sys lines = [] for line in sys.stdin: lines.append(int(line)) times=0 nums=[] for num in lines: if num<0: times+=1 el...
2024-02-07
0
147
题解 | #记负均正II#
import sys lines = [] for line in sys.stdin: lines.append(int(line.rstrip('\n'))) # 移除行末的换行符 times=0 nums=[] for num in lines: if num<0:...
2024-02-07
0
159
题解 | #输入n个整数,输出其中最小的k个#
m,n=map(int,input().split()) nums=list(map(int,input().split())) nums.sort() print(' '.join(str(i) for i in nums[:n]))
2024-02-07
0
147
题解 | #删除字符串中出现次数最少的字符#
string=input() strings={} for i in string: if i in strings: strings[i]+=1 else: strings[i]=1 code=min(strings.values()) for i ...
2024-02-06
0
156
题解 | #汽水瓶#
while True: n=int(input()) if n==0: break else: m=n//2 res=m print(m)
2024-02-06
0
185
首页
上一页
1
2
3
4
5
下一页
末页