牛客393513999号
牛客393513999号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客393513999号的博客
全部文章
(共6篇)
题解 | 01序列
m = int(input()) a = list(map(int, input().split())) n = int(input()) count = 0 l = [] for i in a: if i == 0: count += 1 else: ...
2025-10-08
0
6
题解 | 灵异背包?
n=int(input()) a=list(map(int,input().split())) if sum(a)%2==0: print(sum(a)) else: a.sort() for i in a: if i%2==1: re...
2025-10-08
0
9
题解 | 小红的字符串
s=input()l, r = 0,len(s)-1count=0while l<r: diff = abs(ord(s[l])-ord(s[r])) count += min(diff,26-diff) l+=1 r-=1print(count)
2025-10-08
0
8
题解 | 清楚姐姐买竹鼠
a,b,x = map(int,input().split()) if x<3 or a*3<b: print(a*x) else: num = x // 3 rem = x % 3 res1 = b*num+rem*a res2 = b*(nu...
2025-10-08
0
7
题解 | 小红书推荐系统
s=input().split(' ') d={} for i in s: res=s.count(i) d[i]=res d_sorted = dict(sorted(d.items(),key = lambda x: (-x[1],x[0]))) for k,v in d_sor...
2025-10-07
0
9
题解 | 分数线划定
n,m = map(int,input().split()) t = (3 * m) // 2 d = {} score=[] for _ in range(n): k,s = map(int,input().split()) d[k] = s score.append(s)...
2025-10-07
0
17