意若久时天然呆
意若久时天然呆
全部文章
分类
归档
标签
去牛客网
登录
/
注册
意若久时天然呆的博客
全部文章
(共62篇)
题解 | 【模板】队列操作
que, n = [], int(input().strip()) for _ in range(n): a = list(map(int, input().strip().split(" "))) if a[0] == 1: que.append...
2025-11-24
1
44
题解 | 验证栈序列
q = int(input().strip()) for _ in range(q): t, j, n, pushed, popped = ( [], 0, int(input().strip()), list(map(str,...
2025-11-24
1
36
题解 | 吐泡泡
n = int(input()) for _ in range(n): li, a = list(input().strip()), [] for i in li: if i == "o": if a and a[-1] =...
2025-11-14
1
35
题解 | 括号配对问题
import sys a, s, t = "", "", [] for line in sys.stdin: a = line.split() for i in a[0]: if i in "()[]": ...
2025-11-14
1
31
题解 | 最厉害的学生
N = int(input()) a = [] for i in range(N): s, c1, c2, c3 = input().split() t = int(c1) + int(c2) + int(c3) a.append((s, c1, c2, c3, t)) re...
2025-11-07
2
49
题解 | 校门外的树
L, M = map(int, input().split()) t = [1] * (L + 1) for _ in range(M): l, r = map(int, input().split()) for j in range(l, r + 1): t[j] ...
2025-11-04
1
38
题解 | 记数问题
n, x = map(int, input().split()) c = 0 for i in range(n): c += str(i + 1).count(str(x)) print(c)
2025-11-04
2
43
题解 | 数组计数维护
T=int(input()) for _ in range(T): n,k=map(int,input().split()) a=list(map(int,input().split())) s=cnt=0 for i in range(n): if ...
2025-11-04
1
49
题解 | 牛牛的数学作业
T=int(input()) for i in range(T): n=int(input()) a=list(map(int,input().split())) x=max(a)-min(a) avg=sum(a)/n s=0 for j in ra...
2025-11-04
2
43
题解 | 左侧严格小于计数
n=int(input()) a=list(map(int,input().split())) l=[] for i in range(n): c=0 for j in range(i): if a[j]<a[i]:c+=1 l.append(c) pr...
2025-11-04
1
38
首页
上一页
1
2
3
4
5
6
7
下一页
末页