chong_0428
chong_0428
全部文章
分类
归档
标签
去牛客网
登录
/
注册
chong_0428的博客
全部文章
(共132篇)
题解 | 数字求和
a = list(map(int, input().split())) l = len(a)-1 s = 0 for i in range(l): if a[0] > a[i+1]: s += a[i+1] print(s)
2025-02-17
0
39
题解 | Number Steps
#n = int(input()) a = 2 b = 0 c1 = 0 c = 0 #for i in range(n): x, y = list(map(int, input().split())) if x == 0 and y == 0: print(0) elif x == 2 ...
2025-02-17
0
39
题解 | Integer Inquiry
s = [] while True: a = int(input()) if a == 0: break s.append(a) print(sum(s))
2025-02-16
0
55
题解 | 浮点数加法
def add_large(a, b, a1, b1): a = list(map(int, a)) a1 = list(map(int, a1)) b = list(map(int, b)) b1 = list(map(int, b1)) max_ab =...
2025-02-16
0
49
题解 | 字符串排序
s = input() a = list(s) a.sort() a = ''.join(a) print(a)
2025-02-16
0
37
题解 | 子串计算
from operator import itemgetter s = input().strip() l = len(s) dic_s = {} for i in range(l): for j in range(i+1, l+1): sub_s = s[i:j] ...
2025-02-15
0
44
题解 | 学分绩点
'''北京大学对本科生的成绩施行平均学分绩点制(GPA)。 既将学生的实际考分根据不同的学科的不同学分按一定的公式进行计算。 公式如下: 实际成绩 绩点 90——100 4.0 85——89 3.7 82——84 3.3 78——81 3.0 75——77 2.7 72——74 2.3 68——...
2025-02-15
0
55
题解 | 打印极值点下标
while True: try: n = int(input()) a = list(map(int, input().split())) pear = [] if a[0] != a[1]: pear....
2025-02-15
0
46
题解 | 位操作练习
def bitmovw(a, b): if a == b: return 'YES' a = bin(a) b = bin(b) a = a[2:] b = b[2:] for i in range(16 - len(a)): ...
2025-02-15
0
44
题解 | #A + B#
def fun(a, l): larr = [] rarr = [] c=0 k=0 m = int(l/2) op = a[m] for i in a: c+=1 if c > m: ...
2024-03-26
0
245
首页
上一页
2
3
4
5
6
7
8
9
10
11
下一页
末页