Drink0318
Drink0318
全部文章
分类
归档
标签
去牛客网
登录
/
注册
Drink0318的博客
全部文章
(共124篇)
题解 | 反转链表
from contextlib import nullcontext # class ListNode: # def __init__(self, x): # self.val = x # self.next = None # # 代码中的类名、方法名、参数名...
2025-12-03
0
38
题解 | 移除链表元素
# class ListNode: # def __init__(self, x): # self.val = x # self.next = None # # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @para...
2025-12-02
0
29
题解 | 两两交换链表中的结点
# class ListNode: # def __init__(self, x): # self.val = x # self.next = None # # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @para...
2025-12-02
0
38
题解 | 两端问优先队列
import sys import heapq from collections import defaultdict op_x = list(map(int,sys.stdin.read().split())) ptr =0 #总共操作数量 n =op_x[ptr] #操作指针 ptr+=1 #用...
2025-12-01
0
33
题解 | 结构体优先队列
import heapq class Student: def __init__(self, chinese, math, english): self.chinese = chinese self.math = math self.engl...
2025-12-01
0
34
题解 | 【模板】整数优先队列
import sys import heapq def insert(heap:list,x:int): heapq.heappush(heap,x) def searchMin(heap:list): if len(heap)>0: print(heap[...
2025-12-01
0
24
题解 | 宝石计数
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param jewels string字符串 # @param stones string字符串 # @return int整型 # import bisect class Solution: ...
2025-12-01
0
26
题解 | 快乐数
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param n int整型 # @return bool布尔型 # import bisect class Solution: def happynum(self , n: int) ->...
2025-12-01
1
30
题解 | 数对计数
import sys from collections import Counter N,C = map(int,input().split()) lst = list(map(int,input().split())) #num_count为每个数出现的次数,key为num val为count n...
2025-12-01
0
36
题解 | 动态整数集最近值提取
import sys import bisect lst=list() N =int(input()) for i in range(N): op,x = map(int,input().split()) if op==1: idx = bisect.bisect_l...
2025-11-29
0
29
首页
上一页
4
5
6
7
8
9
10
11
12
13
下一页
末页