SisselSun
SisselSun
全部文章
分类
归档
标签
去牛客网
登录
/
注册
SisselSun的博客
全部文章
(共28篇)
题解 | 【模板】栈的操作
n = int(input()) stk = [] for _ in range(n): s = list(input().split()) if s[0] == "push": stk.append(int(s[1])) elif s[0...
2025-12-19
0
18
题解 | 【模板】序列操作
q = int(input()) lst = [] for i in range(q): k = list(map(int, input().split())) if k[0] == 1: lst.append(k[1]) elif k[0] == 2 and...
2025-12-19
0
25
题解 | 小红书推荐系统
s = input().split() lib = {} for i in s: if i in lib: lib[i] += 1 else: lib[i] = 1 filtered = [i for i in lib.keys() if lib[i]...
2025-12-19
0
22
题解 | 分数线划定
n, m = map(int, input().split()) t = int(1.5 * m) arr = [list(map(int, input().split())) for _ in range(n)] arr.sort(key=lambda x: (-x[1], x[0])) line...
2025-12-19
0
23
题解 | 单词倒排
s = input() for i in s: if i.isalpha() != True: s = s.replace(i, " ") s1 = s.split() print(*s1[::-1]) 这题特别简单,但是要记得用解包符输出
2025-12-19
0
19
题解 | 合唱队
import bisect def lis(nums): tail = [] res = [] for x in nums: pos = bisect.bisect_left(tail, x) if pos == len(tail): ...
2025-12-19
0
22
题解 | 删除字符串中出现次数最少的字符
from collections import Counter s = input() c = Counter(s) min_count = min(c.values()) print("".join(x for x in s if c[x]!=min_count)) Count...
2025-12-18
0
20
题解 | 简单密码
pwd = input() s1 = "abcdefghijklmnopqrstuvwxyz" s2 = "22233344455566677778889999" encoder_dict = dict(zip(s1,s2)) encoded = [] for...
2025-12-17
0
22
题解 | 字符统计
from collections import Counter c = Counter(input()) result = sorted(c.items(), key=lambda x: (-x[1], x[0])) print("".join(x[0] for x in res...
2025-12-17
0
20
题解 | 平方根
from math import * a = int(input()) print(floor(sqrt(a))) 手搓平方根实在太麻烦了
2025-12-17
0
24
首页
上一页
1
2
3
下一页
末页