摘要: #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define mem(a, b) memset((a), (b), sizeof(a)) #define inf 阅读全文
posted @ 2024-04-09 16:38 holy_crap 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 今天学了重链剖分,正好可以补题 描述 You are given a tree with N nodes. The tree’s nodes are numbered 1 through N and its edges are numbered 1 through N − 1. Each edge 阅读全文
posted @ 2024-03-26 01:06 holy_crap 阅读(14) 评论(1) 推荐(1) 编辑
摘要: ##### 1. Codeforces Round 892 (Div. 2), problem: (D) Andrey and Escape from Capygrad [题目传送门](https://codeforces.com/contest/1859/problem/D "题目传送门") 题意 阅读全文
posted @ 2023-08-15 00:54 holy_crap 阅读(46) 评论(0) 推荐(0) 编辑
摘要: 描述 In this problem, "lattice points" in the plane are points with integer coordinates. In order to contain his cows, Farmer John constructs a triangul 阅读全文
posted @ 2023-08-13 02:53 holy_crap 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 描述 线段相交有两种情形:一种是“规范相交”,另一种是“非规范相交”。规范相交是指两条线段恰有唯一一个不是端点的公共点。即如果一条线段的端点在另一条线段上则不视为相交。如果两条线段有部分重合,也不视为相交。而非规范相交则把以上两种情况都视为相交。如下图所示: 规范相交认为a,b两种情况都是不相交的, 阅读全文
posted @ 2023-08-13 02:52 holy_crap 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 1471: Wall 描述 Once upon a time there was a greedy King who ordered his chief Architect to build a wall around the King's castle. The King was so greed 阅读全文
posted @ 2023-08-12 16:11 holy_crap 阅读(8) 评论(0) 推荐(0) 编辑
摘要: ## 题目描述 婷婷是个喜欢矩阵的小朋友,有一天她想用电脑生成一个巨大的 $n$ 行 $m$ 列的矩阵(你不用担心她如何存储)。她生成的这个矩阵满足一个神奇的性质:若用 $F[i,j]$ 来表示矩阵中第 $i$ 行第 $j$ 列的元素,则 $F[i,j]$ 满足下面的递推式: $$\begin{al 阅读全文
posted @ 2023-08-12 14:45 holy_crap 阅读(31) 评论(0) 推荐(0) 编辑