何成95
何成95
全部文章
分类
归档
标签
去牛客网
登录
/
注册
何成95的博客
全部文章
(共206篇)
题解 | 小红的优惠券
n, m = map(int,input().split()) coupon = [list(map(int,input().split())) for _ in range(m)]#输入存储优惠券 minfee = n#存储最少需要支付的费用 for a,b in coupon:#遍历整个优惠券列...
2025-08-27
0
33
题解 | 小红背单词
n = int(input()) words = []#已经记住的单词 dic = dict()#要记得单词,以及背的次数 for i in range(n): word = input() dic[word] = dic.setdefault(word,0)+1#将当前背的单词,背...
2025-08-27
0
19
题解 | 宝石手串
t = int(input()) for _ in range(t): n = int(input()) s = input() if len(set(s)) == n:#手串中没有相同的宝石,无法破环,返回-1 print(-1) conti...
2025-08-27
0
27
题解 | 预知
t = int(input())#测试数据组数 for _ in range(t): n = int(input())#当前组测试数据包含的卡牌种类,n种卡牌 cards = list(map(int,input().split()))#n种卡牌每种包含的卡牌数量 if n=...
2025-08-27
0
22
题解 | 支付宝消费打折
n, k = map(int,input().split()) a = list(map(int,input().split())) s = input() aa = sorted([a[i]*0.95 if s[i]=='1' else a[i] for i in range(n)])#折扣后的升...
2025-08-26
0
34
题解 | 【模板】排序
n = int(input())#输入元素个数 ns = list(map(int,input().split()))#输入元素列表 ns.sort()#对元素列表进行升序排列 print(' '.join(map(str,ns)))#对排列后的元素列表进行拼接输出
2025-08-26
0
29
题解 | 分数线划定
n, m = map(int,input().split())#输入n,m ks = [list(map(int,input().split())) for _ in range(n)]#输入报名号和成绩 ks.sort(key=lambda x:(-x[1],x[0]))#成绩降序,报名号升序排列...
2025-08-26
0
20
HJ120 彩虹糖的梦
返回输入数组中最小值即可。 print(min(list(map(int,input().split()))))
2025-06-28
0
36
HJ19 简单错误记录
处理循环输入后输出,看代码注释。 import sys import re from collections import defaultdict dic = defaultdict(int)#创建默认字典,默认值为整数0 for s in sys.stdin:#循环输入字符串 s = re...
2025-06-28
0
45
题解 | Redraiment的走法
n = int(input()) h = list(map(int, input().split())) dp = [1] * n for i in range(n): # 动态规划求解,每次计算前i个字符串中,最长可跳过的梅花桩 for j in range(i): if...
2025-06-17
0
35
首页
上一页
8
9
10
11
12
13
14
15
16
17
下一页
末页