爱读书的菠萝蜜很想去杭州
爱读书的菠萝蜜很想去杭州
全部文章
分类
归档
标签
去牛客网
登录
/
注册
爱读书的菠萝蜜很想去杭州的博客
全部文章
(共62篇)
题解 | 【模板】队列操作
n = int(input()) from collections import deque q = deque() for _ in range(n): a = input().split() if a[0] == '1': q.append(int(a[1])) ...
2025-06-11
0
44
题解 | 栈和排序
#之前那个思路不太完善,不知道为什么通过了。 n = int(input()) p = list(map(int, input().split())) pushed = [] popped = [] for ele in p: pushed.append(ele) if pushed...
2025-06-11
0
45
题解 | 验证栈序列
[亲亲] #看不懂题目的朋友可以先做下一道题目,然后再回来做这道,就能简单很多。 q = int(input()) for _ in range(q): n = int(input()) pushed = input().split() popped = input().sp...
2025-06-11
0
36
题解 | 栈和排序
n = int(input()) p = list(map(int, input().split())) pushed = [] popped = [] for ele in p: pushed.append(ele) if ele == n: pushed.pop(...
2025-06-11
0
33
题解 | 吐泡泡
t = int(input()) from collections import deque for _ in range(t): s = input() stack = deque() for char in s: if not stack: ...
2025-06-10
1
26
题解 | 好串
s = input() while s.find('ab')!=-1: s = s.replace('ab','') if len(s) != 0: print('Bad') else: print('Good')
2025-06-10
1
49
题解 | 添加逗号
n = input() n_re = n[::-1] result = '' for i in range(1,len(n)+1): if i%3 == 0: result += n_re[i-1] + ',' else: result += n_re...
2025-06-09
0
29
题解 | 简写单词
words = input().split() s = '' for word in words: s += word[0].upper() print(s)
2025-06-09
0
38
题解 | 无限长正整数排列字符串
n = int(input()) s = '' for i in range(1,n+1): if len(s)>=n: break else: s += str(i) print(s[n-1])
2025-06-09
0
44
题解 | 凯撒加密
n = int(input()) s = input() s_new = '' for char in s: s_new += chr((ord(char)-ord('a')+n)%26+ord('a')) print(s_new)
2025-06-08
0
32
首页
上一页
1
2
3
4
5
6
7
下一页
末页