ciallobit
ciallobit
全部文章
分类
归档
标签
去牛客网
登录
/
注册
ciallobit的博客
全部文章
(共9篇)
题解 | 吐泡泡
import sys def main(): lines = sys.stdin.read().splitlines() T = len(lines) ret = [] idx = -1 for _ in range(T): idx += ...
2025-05-31
1
16
题解 | 好串
def main(): s = input() st = 0 n = len(s) for i in range(n): if s[i] == 'a': st += 1 elif s[i] == 'b': ...
2025-05-31
1
17
题解 | 括号配对问题
import queue def main(): st = queue.LifoQueue() s = input() n = len(s) for i in range(n): if s[i] == '[' or s[i] == '(': ...
2025-05-31
1
11
题解 | 求峰谷点数
class Solution: def countPeakPoint(self , a: List[int]) -> int: a = [a[0]] + a + [a[len(a) - 1]] n = len(a) cnt = 0 ...
2025-05-31
1
12
题解 | 【模板】序列操作
q = [] T = int(input()) for _ in range(T): a = list(map(int, input().split())) op = a[0] if op == 1: x = a[1] q.append(x) ...
2025-05-31
1
11
题解 | 小y的考试
T = int(input()) for _ in range(T): A = len(input()) B = len(input()) C = len(input()) D = len(input()) v = [A, B, C, D] mp = ...
2025-05-31
1
11
题解 | 珂朵莉的假toptree
n = int(input()) s = "" for i in range(1, n + 1): s += str(i) print(s[n - 1]) 不用枚举,时间复杂度O(n)
2025-05-31
1
11
题解 | BFS
print(input().lower().find('bob')) 使用内置函数
2025-05-31
1
12
题解 | Young Man Don‘t Say Five
s = list(input()) n = len(s) for i in range(n): if(s[i] == '5'): s[i] = '*' print(''.join(s))
2025-05-31
1
21