华算鸭
华算鸭
全部文章
分类
题解(5)
归档
标签
去牛客网
登录
/
注册
华算鸭的博客
全部文章
(共6篇)
题解 | #称砝码#
import sys n = input() m = list(map(int,input().split())) x = list(map(int,input().split())) ans = [0] #存储多少种重量的数组 for s,i in enumerate(m): # 拿出一种砝码...
2023-04-22
0
83
题解 | #跳台阶#
代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 @param number int整型 @return int整型 小小斐波那契数列还想难住我 搞笑 我就想问还有谁比我短 class Solution: def jumpFloor(self , number: int...
Python3
2021-12-10
1
210
题解 | #统计大写字母个数#
import re while True: try: s=re.compile("[A-Z]") st=input() st2=s.sub('', st) print(len(st)-len(st2)) except:...
Python3
2021-11-29
1
285
题解 | #查找兄弟单词#
啥叫算法啊,我就会做题,我也不懂 while True: try: ls=input().split() dst=ls[-2] cc=int(ls[0]) lsn=[] for i in range(2,2+cc...
Python3
2021-11-24
9
1291
题解 | #字符串分隔#
while True: try: tt=input() if len(tt)<=8: print(tt+'0'*(8-len(tt))) else: while tt: ...
Python3
2021-11-15
0
217
题解 | #质数因子#
代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 @param A string字符串 @param n int整型 @return int整型 看不懂 这个啥原理啊 谁能优化一下 比我还短 class Solution: def getLongestPalin...
Python3
2021-11-07
2
367