何成95
何成95
全部文章
分类
归档
标签
去牛客网
登录
/
注册
何成95的博客
全部文章
(共158篇)
题解 | a 加 b 问题(函数)
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # 实现求两个参数的和 # @param Integer1 int整型 # @param Integer2 int整型 # @return int整型 # class Solution: def add...
2025-08-30
0
12
题解 | 牛牛的考试
t = int(input()) for _ in range(t): dic = dict(zip(['A','B','C','D'],[len(input()) for _ in range(4)]))#计算输入数据及长度其 ldic = sorted(list(dic.val...
2025-08-30
0
8
题解 | 二维数组中的查找
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param target int整型 # @param array int整型二维数组 # @return bool布尔型 # class Solution: def Find(self ,...
2025-08-30
0
9
题解 | 字符串操作
n, m = map(int,input().split()) s = input() for _ in range(m): l, r, c1, c2 = input().split() s = s[:int(l)-1]+s[int(l)-1:int(r)].replace(c1,c...
2025-08-29
0
5
题解 | 简写单词
print(''.join([x[0] for x in input().split()]).upper())
2025-08-29
0
6
题解 | 凯撒加密
n = int(input()) s = input() #数据输入及初始化 out = '' for c in s: out += chr((ord(c)-ord('a')+n)%26+ord('a')) #按位偏移 print(out) #输出结果
2025-08-29
0
10
题解 | BFS
s = input().lower() def bfs(s): n = len(s) if n < 3: return -1 else: for i in range(n - 2): if s[i : i + 3...
2025-08-29
0
7
题解 | 添加逗号
s = input() n = len(s) if n<=3: print(s) else: a, b = divmod(n,3)#可以划分成3个数的组合数,及多余出来的数 if b==0:#全部可以划分成3个一组 ans = ','.join([s[...
2025-08-29
0
6
题解 | 斗兽棋
nn, nm = input().split() game = ["elephant","tiger","cat","mouse"] idn, idm = game.index(nn), game.index(nm) ...
2025-08-29
0
7
题解 | 年轻人不讲5的
print(input().replace('5','*'))
2025-08-29
0
7
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页