〓Fly〓
〓Fly〓
全部文章
分类
题解(36)
归档
标签
去牛客网
登录
/
注册
〓Fly〓的博客
全部文章
(共69篇)
题解 | #参数解析#
while True: try: str1=str(input()).replace(' ','\n') e = '' flag = False for i in str1: if i == '"': ...
2022-11-04
0
173
题解 | #字符串通配符#
def fun(str1, str2): if str1 == '' and str2 == '': # 空模式空字符串,匹配成功 return True elif str1 == '' and str2 != '': # 空模式无法匹配非空字符串 r...
2022-11-04
0
161
题解 | #矩阵乘法计算量估算#
while True: try: n=int(input()) dic={} for i in range(n): dic[chr(ord('A')+i)]=list(map(int,input().strip().sp...
2022-11-04
0
177
题解 | #矩阵乘法#
'''注意点:输入矩阵的建立,行录入的时候还是要注意末尾空格,直接用input().split()分隔,就可以把空格去掉了,直接用map(int, ),不用单独去处理末尾空格。 如果用input().split(' '),则末尾的空格会被分隔成一个‘’字符,没法直接map(int,)''' whil...
2022-11-02
0
187
题解 | #24点游戏算法#
def calculate_24(arr,item): if len(arr)==1: # 递归终点,当数组arr只剩一个数的时候,判断是否等于item return arr[0]==item else: # 如果arr不是只剩一个数,就调用函数本身(直到只剩一个数为...
2022-11-01
0
194
题解 | #配置文件恢复#
while True: try: m=input().strip().split() key=["reset","reset board","board add","board delete","reboot backplane","backplane abo...
2022-11-01
0
152
题解 | #查找两个字符串a,b中的最长公共子串#
while True: try: s1=input() # s1保存短字符串 s2=input() # s2保存长字符串 s='' if 1<=len(s1)<=300 and 1<=len(s2)<=3...
2022-10-31
0
155
题解 | #MP3光标位置#
while True: try: n = int(input()) # 储存歌曲总数 s = input().strip() # 储存操作 l = [] for i in range(1, n+1): # 建立歌曲列表(非...
2022-10-31
0
210
题解 | #DNA序列#
# while True: # try: # DNA=input().strip() # n=int(input()) # max_counts=0 # max_DNA=[] # for i in range(l...
2022-10-31
0
133
题解 | #找出字符串中第一个只出现一次的字符#
s = input() for i in s: if s.count(i) == 1: print(i) break else: print('-1')
2022-10-31
0
111
首页
上一页
1
2
3
4
5
6
7
下一页
末页