鹿沉
鹿沉
全部文章
分类
归档
标签
去牛客网
登录
/
注册
鹿沉的博客
全部文章
(共45篇)
题解 | 求峰谷点数
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # 求序列a中的峰、谷点的个数 # @param a int整型一维数组 序列a # @return int整型 # class Solution: def countPeakPoint(self , a:...
2025-06-23
0
35
题解 | 【模板】序列操作
res = [] q = int(input()) for i in range(q): line = input().strip().split(' ') operate = line[0] if operate == '1': res.append(lin...
2025-06-21
0
36
题解 | 学生综合评估系统
class Student: def __init__(self, student_id, academic_score, activity_score): self.id = student_id self.academic_score = academic...
2025-06-21
0
46
题解 | 最厉害的学生
n = int(input()) lines = [input().strip().split(' ') for _ in range(n)] lines.sort(key=lambda i: sum(map(int, i[1::])), reverse=True) print(' '.join(l...
2025-06-21
0
40
题解 | 凯撒解密
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # 进行凯撒解密 # @param password string字符串 旺仔哥哥的密码 # @param n int整型 每个字符加密过程中错位的次数 # @return string字符串 # class So...
2025-06-21
0
41
题解 | a 加 b 问题(函数)
class Solution: def addTwoInteger(self , Integer1: int, Integer2: int) -> int: result = Integer1 + Integer2 return result
2025-06-21
0
31
题解 | 字符串操作
n, m = map(int, input().split(' ')) s = input() for i in range(m): line = input().split() l, r, c1, c2 = int(line[0]) - 1, int(line[1]), line[...
2025-06-21
0
27
题解 | 添加逗号
n = input()[::-1] cur, newn = 1, '' for i in n: newn += i if cur == 3 and i != n[-1]: newn += ',' cur = 0 cur += 1 print(n...
2025-06-21
0
25
题解 | 牛牛的考试
def exam(): cis = [input().strip() for _ in range(4)] cis = sorted(cis, key=len, reverse=False) # 按答案长度从短到长排序 if len(cis[0]) != len(cis[1]...
2025-06-21
0
28
题解 | 简写单词
summ = input().split(' ') res = '' for i in summ: res += i[0] print(res.upper())
2025-06-20
0
36
首页
上一页
1
2
3
4
5
下一页
末页