greatofdream
greatofdream
全部文章
分类
归档
标签
去牛客网
登录
/
注册
greatofdream的博客
全部文章
(共12篇)
题解 | 无人机物流网络最优路径规划
import sys import heapq from collections import defaultdict N, K = map(int, sys.stdin.readline().split()) data = list(map(int, sys.stdin.read().split(...
2026-03-09
0
10
题解 | 实时社交媒体热点追踪
import sys from collections import deque, defaultdict n = int(input()) cnt = defaultdict(lambda: 0) dq = deque() for line in sys.stdin: strs = lin...
2026-03-08
0
7
题解 | 星际跃迁网络
import sys from collections import defaultdict, deque N, M, K = map(int, sys.stdin.readline().split()) adj = defaultdict(lambda: []) INF = 0x3F3F3F3F ...
2026-03-08
0
10
题解 | #古代咒语共鸣匹配#
https://www.nowcoder.com/practice/6463cf20047a4feab35a1379c12fc811?tpId=390&tqId=11522617&sourceUrl=%2Fexam%2Foj%2Fta%3Fpage%3D1%26tpId%3D37%2...
2026-03-01
0
25
题解 | #星环#
星环题目 import sys k, m = map(int, sys.stdin.readline().split()) data = sys.stdin.read().split() N = len(data) * 8 byte_s = ''.join(list(map(lambda x: f'...
2026-02-22
0
24
题解 | 小红的能量校准 Python3
import sys def loadTree(s): precedence = {'(': 0, '+': 1, '*': 2} v_s, op_s = [], [] i = 0 while i < len(s): if s[i].isdig...
2026-02-19
0
32
题解 | 小A的线段(easy version)
n, m = map(int, input().split()) edges = [list(map(int, input().split())) for _ in range(m)] boundary = [] for i, e in enumerate(edges): boundary...
2025-08-26
0
91
题解 | 三角谜题
import math def trig_area(a, c): s = float((a + a + c) / 2) return math.sqrt(s * (s - a) * (s - a) * (s - c)) T = int(input()) for t in range(...
2025-08-20
0
57
题解 | 查找两个字符串a,b中的最长公共子串
import sys s, t = input(), input() if len(s)<len(t): s, t = t, s s_n, t_n = len(s), len(t) dp = [[0] * (t_n+1) for _ in range(s_n+1)] # print(...
2025-08-13
0
83
题解 | 24点游戏算法
import sys arr = list(map(int, input().split())) N = 4 visit = [] st = [] path = [] def dfs(l, res): # if len(path)==4: # if path[0][0] ...
2025-08-11
0
75
首页
上一页
1
2
下一页
末页