何成95
何成95
全部文章
分类
归档
标签
去牛客网
登录
/
注册
何成95的博客
全部文章
(共206篇)
题解 | 数颜色
s = input() r, g, b =0, 0, 0 for c in s: if c=='R': r += 1 elif c=='G': g += 1 elif c=='B': b += 1 print(f'({r},...
2025-10-25
0
10
题解 | 买橘子
n = int(input()) def getresult(n): for i in range(n//6+1):#归买6个/袋的袋数 for j in range(n//8+1):#购买8个/袋的袋数 if 6*i+8*j==n:#累计购买总数 ...
2025-10-25
0
13
题解 | 田忌赛马
v = sorted(list(map(int,input().split())))#齐威王的马升序排列 a = sorted(list(map(int,input().split())))#田忌的马升序排列 a.append(a.pop(0))#田忌的最劣等马放到最后 ans = 0 for i...
2025-10-25
0
12
题解 | 小红喜欢1
print(list(map(int,input().split())).index(1)+1)
2025-10-25
0
13
题解 | 不重复数字
t = int(input()) for _ in range(t): n = int(input()) a = list(map(int,input().split())) seen, ans = set(), [] for c in a: if c...
2025-10-25
0
15
题解 | 宝石计数
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param jewels string字符串 # @param stones string字符串 # @return int整型 # class Solution: def numJewel...
2025-10-25
0
9
题解 | 表达式求值
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # 返回表达式的值 # @param s string字符串 待计算的表达式 # @return int整型 # class Solution: def solve(self , s: str) ->...
2025-10-25
0
11
题解 | 数对计数
n, c = map(int,input().split()) nums = list(map(int,input().split())) counts = {} for num in nums:#统计输入数据中,各数据的个数,存储到字典中 counts[num] = counts.get...
2025-10-25
0
8
题解 | 参议院投票
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # 求出最终获胜帮派的名称 # @param s string字符串 # @return string字符串 # class Solution: def predictVictory(self , s: ...
2025-10-25
0
12
题解 | 字符串构造判定
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param ransomNote string字符串 # @param magazine string字符串 # @return bool布尔型 # from collections import ...
2025-10-24
0
18
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页