柚茶_Rola
柚茶_Rola
全部文章
分类
归档
标签
去牛客网
登录
/
注册
柚茶_Rola的博客
全部文章
(共451篇)
题解 | #计算某字符出现次数#
s = input().lower() ss = input().lower() print(s.count(ss)) #两个注意的地方: #1 count()函数的用法 #2 需要统一大小写
2024-06-12
0
132
题解 | #输入n个整数,输出其中最小的k个#
n,k = map(int,input().split()) ls = list(map(int,input().split()))#输入n个整数,怎么控制个数是n个?? ls.sort() print(' '.join(map(str,ls[:k])))
2024-06-11
0
130
题解 | #截取字符串#
s = input() k = int(input()) print(s[:k])
2024-06-11
0
125
题解 | #提取不重复的整数#
#print(int(set(input())[::-1])) #此处为什么能不能用set去重? c = input()[::-1] #为什么要先颠倒顺序,再去重? res = '' for i in c: if i not in res: res += i pr...
2024-06-11
0
155
题解 | #取近似值#
f = float(input()) #input()输入的是字符串,注意此处float()函数的应用; if (f - int(f)) >= 0.5: print(int(f)+1) else: print(int(f))
2024-06-11
0
116
题解 | #字符串最后一个单词的长度#
print(len(input().split()[-1]))
2024-06-11
0
146
题解 | #字符串最后一个单词的长度#
print(len(input().split()[-1]))
2024-05-01
0
132
题解 | #坐标移动#
s = input().split(';') #A10;S20;W10;D30;X;A1A;B10A11;;A10; start = [0,0] for i in s: if not 2 <= len(i) <= 3: continue try: ...
2024-03-25
0
189
题解 | #坐标移动#
# 2024年3月18日 下午15:09 # wujie # A10;S20;W10;D30;X;A1A;B 10AA11;;A10; s = input().split(';') start = [0,0] # 注意起点一定是写在这里的 for i in s:# 一定是遍历字...
2024-03-25
0
203
题解 | #Redraiment的走法#
n = int(input()) ls = list(map(int,input().split())) dp = [1]*len(ls) def f(ls): lst = [1]*(len(ls)) for i in range(len(ls)-1,-1,-1): ...
2024-03-22
0
146
首页
上一页
26
27
28
29
30
31
32
33
34
35
下一页
末页