阿be
阿be
全部文章
分类
题解(20)
归档
标签
去牛客网
登录
/
注册
阿be的博客
全部文章
(共19篇)
题解 | #数据分类处理#
'''第一遍做时候是这么想的,再看感觉有很多能简化的部分,懒得再改了''' while 1: try: lst_a=input().split()[1:] lst_b=set(input().split()[1:]) lst_b=sorted(...
Python3
2022-04-22
0
320
题解 | #字符串合并处理#
while 1: try: s1, s2 = input().split() s = list(s1 + s2) except: break else: s[::2]=sorted(s[::2]) ...
Python3
2022-04-19
0
303
题解 | #DNA序列#
tes=input() n=int(input()) c=0 t='' for i in range(len(tes)-n+1): a=tes[i:i+n] b=0 for s in range(n): if a[s]=='G' or a[s]=='C': ...
Python3
2022-04-09
0
270
题解 | #矩阵乘法#
for循环生,for循环死,就是慢了点64ms 4804kb # 做完了看题解,原来大家都是for循环到头hhh # x*y和y*z x=int(input()) y=int(input()) z=int(input()) # x*y矩阵 lst_a=[] for i in range(x): ...
Python3
2022-04-09
1
474
题解 | #查找两个字符串a,b中的最长公共子串#
循环套循环 s1 = input() s2 = input() if len(s2)<len(s1): a=s1 s1=s2 s2=a tes='' for i in range(len(s1)): if s1[i] in s2: for j i...
Python3
2022-04-08
0
337
题解 | #找出字符串中第一个只出现一次的字符#
直接复制其他人的for else都不行,会同时输出o和-1,是我电脑问题吗? while 1: try: a=input() tes=[] for i in a: if a.count(i)==1: ...
Python3
2022-04-07
0
297
题解 | #名字的漂亮度#
字典 48ms 4692kb def beautiful(x): lst=list(x) # 输出个数字典 lst_a=set(lst) lst_num=[] for i in lst_a: a=lst.count(i) lst_num...
Python3
2022-04-07
0
320
题解 | #求解立方根#
好暴力的解法,我只能说。。。 a=float(input()) if a>=0: b=a**(1/3) else: b=(-a)**(1/3) b=-b print(round(b,1))
Python3
2022-04-06
1
425
题解 | #字符串加密#
刚开始想用set去重,但是忘了set会打乱顺序,所以怎么都不对。改成笨方法for循环就行了。 43ms 4668kb lst=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v...
Python3
2022-04-06
1
336
题解 | #挑7#
用列表的话 62ms 5776kb n=int(input()) i=1 lst=[] while i<=n: if i%7==0: lst.append(i) elif '7' in str(i): lst.append(i) i+=1...
Python3
2022-04-06
0
255
首页
上一页
1
2
下一页
末页