majority 134c arc the

The 2021 Sichuan Provincial Collegiate Programming Contest

\(E. Don’t Really Like How The Story Ends\) \(dfs\)的时候如果一个点没有子节点,可以回溯,在父节点上找后续节点。如果找到了一个更大的节点,那么必须要与当前目标连接,然后回溯回来的时候如果目标值比当前的值更小说明仍有后续节点可以用,必须还在这个节点接后 ......

[ARC149E] Sliding Window Sort

[ARC149E] Sliding Window Sort 考虑到 \(k \le 10^9\) 太大了,我们先模拟一下看看能不能化成 \(k\) 比较小的情况。注意到,我们每次只会在 \(i\) 留下一个数,相当于我们手上一定有前缀前 \(m - 1\) 大的数。这样当我们操作完 \([n - m ......
Sliding Window 149E Sort ARC

[CF1098E] Fedya the Potter 题解

[CF1098E] Fedya the Potter 题解 前言 一道类欧好题。 题解 这道题让求 \(c\) 数组的中位数,那么有一个比较套路的方法就是二分答案 \(mid\) 然后计算 \(b\) 数组中区间和小于 \(mid\) 的区间个数进行 \(check\)。但是 \(b\) 数组总共有 ......
题解 Potter 1098E Fedya 1098

excel 导出 The maximum length of cell contents (text) is 32767 characters Excel单元格最大存储长度32767个字符,超长会报错,数据库中也有这个最大长度

excel 导出 The maximum length of cell contents (text) is 32767 characters 导出excel功能,报错。错误日志提示::The maximum length of cell contents (text) is 32767 chara ......
长度 32767 characters 字符 单元

Blazor Server App Cannot find the fallback endpoint specified by route values

github官方issues中提到的解决方案,CreateBuilder时指定项目绝对路径可以解决。 1 // 指定项目路径,也可以用Assembly.GetCallingAssembly获取 2 const string ContentRootPath = @"C:\Users\BlazorSer ......
specified fallback endpoint Blazor Server

The database cluster initialisation failed but was not the same version as initdb的解决办法(postgresql)

问题:不论装哪个版本的postgresql,都报 The program "postgres" was found by ".../initdb.exe" but was not the same version as initdb. 和 The database cluster initialis ......

[LeetCode] 2434. Using a Robot to Print the Lexicographically Smallest String_Medium tag: stack

You are given a string s and a robot that currently holds an empty string t. Apply one of the following operations until s and t are both empty: Remov ......

Codeforces Round 700 (Div. 2) B. The Great Hero

英雄卡初始存在 \(A\) 点力量值和 \(B\) 点生命值。有 \(n\) 张怪物卡,第 \(i\) 张怪物卡拥有 \(a_i\) 点力量和 \(b_i\) 点生命值。任意卡的生命值 \(\leq 0\) 则阵亡。 在任意一步中可以选择一张怪物卡与英雄卡决斗,战斗结束后双方各受到对方力量点数的伤害 ......
Codeforces Round Great Hero 700

CF48C [The Race]

Problem 题目简述 现有 \(n\) 个已经加过油的加油站,如果当前剩余油量 \(< 10\) 升,则会加 \(x\) 升的油。 初始状态下,有 \(x\) 升油。每个加油站之间的距离为 \(100\) 米,耗油量为 \(10\) 升。 思路 首先,从左向右求出能到达的编号最小的车站,记为 \ ......
Race 48C The CF 48

P1457 [USACO2.1] 城堡 The Castle 题解

分析 感觉没有蓝题难度 一道 bfs 题目,相较于大部分 bfs 题,它较为复杂,但分析一下还是很好水过的。 建立墙时,可以用三维数组,\(wall_{~i, ~j, ~pos}\) 表示 第 \(i\) 行第 \(j\) 列 \(pos\) 方向有墙。 观察发现,\(8 = 2^3,4 = 2^2 ......
题解 城堡 Castle USACO2 P1457

[ARC128E] K Different Values

[ARC128E] K Different Values 考察 \(k=2\) 的情形,这个很经典,就是绝对众数。这样的话我们发现显然的一个必要条件是 \(\max A_i \le \lceil \frac{n}{k} \rceil\)。进一步,我们按照 \(k\) 为块长分块,还需满足 \(A_i ......
Different Values 128E ARC 128

《Mastering the FreeRTOS Real Time Kernel》读书笔记(2)任务管理

3.任务管理 如何为每个任务分配处理时间,如何选择在任何给定时间执行何种任务,任务优先级,任务状态。 3.2 任务功能 每个任务必须返回void,并接受一个void类型指针。这些任务一般会写成一个无限循环,由内核来调度,完成任务安排,创建和删除。 3.3 顶层任务状态 由于一般单片机处理器为单核单线 ......
Mastering FreeRTOS 任务 笔记 Kernel

【论文阅读】Accuracy of real-time multi-model ensemble forecasts for seasonal influenza in the U.S.

原始题目:Accuracy of real-time multi-model ensemble forecasts for seasonal influenza in the U.S. 中文翻译:针对美国季节性流感的实时多模型集合预报的准确性 发表时间:2019年11月22日 平台:PLOS Com ......

[ARC125E] Snack

[ARC125E] Snack 经典啊,经典。 很容易看出网络流模型:每个人连一个限制 \(c_i\),每种糖果拆点限流 \(a_i\),然后每个人向每个糖果连边,最大流就是答案。 考虑转成最小割,我们相当于选出两个集合 \(S \subseteq [1,n], T \subseteq [1,m]\ ......
Snack 125E ARC 125

已解决ERROR: Could not install packages due to an OSError: [WinError 5] 拒绝访问。: 'e:\\python\\scripts\\pip.exe' Consider using the `--user` option or check the permissions.

已解决ERROR: Could not install packages due to an OSError: [WinError 5] 拒绝访问。: 'e:\\python\\scripts\\pip.exe' Consider using the `--user` option or check ......
permissions the Consider WinError packages

《Mastering the FreeRTOS Real Time Kernel》读书笔记(1)堆内存管理

这是161204的版本,不完全覆盖目前最新版本的内核。 0.关于freeRTOS 首先提出了了在小型嵌入式系统中为何需要多任务管理的问题,介绍了freeRTOS的用途。然后开始做广告,吹了一波freeRTOS的好处。其中要注意一些关键的名词:任务优先级分配、任务通知、队列、信号量、互斥锁、软定时器、 ......
Mastering FreeRTOS 内存 笔记 Kernel

ARC132E Paw

题面传送门 笑了,题做太多导致的。 首先拿到这个题的时候考虑的就是算每个点的期望和,但是这样其实不太好算。 先容易 dp 出 \(f_i\) 表示 \(i\) 个洞走完之后均不影响到更右边/左边的概率,这样就可以算出如果一个点原来就是左脚印,左右都不影响到它的概率。 然后考虑最后答案的形式,一定是某 ......
132E ARC 132 Paw

[ARC130E] Increasing Minimumm

[ARC130E] Increasing Minimumm ? 考虑模拟一下题目中的过程,发现相当于将原序列按照初始值划分为若干个等价类,然后每次都会先合并等价类然后重排等价类中的所有数并加入 \(I\) 中。这样将 \(I\) 划分成了若干段。 考虑假设我们一共划分出 \(T\) 个段,那么最终每 ......
Increasing Minimumm 130E ARC 130

otImplementedError: "sortBed" does not appear to be installed or on the path, so this method is disabled.

NotImplementedError Traceback (most recent call last) Cell In[10], line 5 3 s = pybedtools.BedTool(args.starrseq[0]).filter(lambda x: float(x[9]) > 1. ......

[arc133e]Cyclic Medians

E - Cyclic Medians 看到中位数,就是经典套路:将\(\geq\)中位数的都赋值为\(1\),\(<\)的赋值为\(0\) 那么对于数\(A\),就等于\(\sum_{i=1}^{\infty}[A\geq i]\) 所以我们考虑枚举中位数,然后若其\(\leq A\),那么就对答案 ......
Medians Cyclic 133e arc 133

[arc135f] Delete 1, 4, 7, ...

F - Delete 1, 4, 7, ... 设\(f(i)\)表示第一次操作后,第\(i\)个位置的数,那么\(f(i)=\lfloor \frac{3i+1}2\rfloor\) 那么\(k\)次操作后,第\(i\)个位置上的数就是: \[f(f(...f(f(i))...))=f^k(i) ......
Delete 135f arc 135

[CF878E]Numbers on the blackboard

E - Numbers on the blackboard 最后的答案肯定为\(\sum_{l\leq i\leq r} 2^{p_i}\times a_i\) 然后这个\(p\)满足以下限制: \(p_i=0\)(\(i=l\)) \(1\leq p_i\leq p_{i-1}+1\)(\(l<i ......
blackboard Numbers 878E 878 the

[ARC143D] Bridges 题解

[ARC143D] Bridges 题意:给定 \(2n\) 个点和 \((u_1,v_1) , \cdots , (u_m,v_m)\),选择让 \(u_i\) 连 \(v_i+n\) 或 \(v_i\) 连 \(u_i+n\),以最小化图中桥的个数。 有种技巧叫拆点,把一个点拆成入点和出点,看这 ......
题解 Bridges 143D ARC 143

《[ARC157C] YY Square》解题报告

另解,不过也是 \(dp\) 。 一个小套路,关于平方我们可以考虑他的组合意义。 假如一条路径上有三个 \(YY\) 那么他的贡献是 \((1+1+1)^2=(1+1+1)(1+1+1)\) 相当于是从左右两边括号里各选一个 \(1\) 。 所以实际上我们的贡献可以看成从 \((1,1)\to (n ......
报告 Square 157C ARC 157

vscode git提交——报please enter the commit message for your changes....

如图: 其大意就是:在提交之前,需要给此次提交添加一些备注信息 1. git命令操作 git命令为:git commit -m "备注信息" 2. vscode操作 1)点击 + :暂存更改 2)在消息输入框中添加 备注信息(关键地方) 3)一定要输入 备注信息 后,再点击 提交,不然就会报“ple ......
changes message vscode commit please

ARC166E Fizz Buzz Difference

题面传送门 首先一个观察是随着 \(n\) 的增大,最长的区间肯定是增大的,因此可以直接把等式放缩成 \(\leq n\)。 另一个观察使为了使区间长度最大,左右端点肯定是顶着两个 \(a\) 的,不妨设其为 \(al+1\) 和 \(ar-1\)。 将 \(a,b\) 先搞成互质的,那么现在的问题 ......
Difference 166E Fizz Buzz ARC

[902] Get the current file's directory of CMD batch scripts

In a batch file, you can use the %~dp0 special variable to get the directory of the currently executing batch file. Here's how you can do it: @echo of ......
directory current scripts batch file

[898] Convert the data type of a DataFrame column

In Pandas, you can convert the data type of a DataFrame column to a string data type using the .astype() method. Here's how to do it: import pandas as ......
DataFrame Convert column data type

[895] Sort the rows of a DataFrame

In Pandas, the sort_values() method is used to sort the rows of a DataFrame by one or more columns. This method allows you to specify which column(s) ......
DataFrame Sort rows 895 the

Go - Finding the Shortest Path on a Graph

Problem: You want to find the shortest path between two nodes on a weighted graph. Solution: Use Dijkstra’s algorithm to find the shortest path betwee ......
Shortest Finding Graph Path the