majority 134c arc the
[ARC136C] Circular Addition
题目大意 给定一个长度为 \(N\) 的序列 \(A\),这个序列组成一个环。每次可以选择环上的一段都减去 \(1\),求最少操作次数使得序列每个位置值均为 \(0\)。 思路 首先考虑一次操作会产生什么影响。 发现,会使得序列的最大值最多减 \(1\),环的差分序列最多减 \(2\)。 那么我们设 ......
ARC102E Stop. Otherwise... 题解
这是一个没有必要的复杂做法,但我考场上第一时间想到的就是这个做法。 分析 首先观察样例。发现答案有对称性,所以我们只需要求出 \(\left[2,k+1\right]\) 区间内的答案。又发现相邻两项答案是一样的,所以只需要处理其中奇数情况的答案。 推式子 设 \(f_s\) 表示点数和不为 \(2 ......
[ARC136C] Circular Addition 题解
题意 给定一个长度为 \(N\) 的环,每次选取环上一段并使其中每个元素值均加 \(1\)。给定一个长度为 \(N\) 的序列 \(A\),环上元素初始值为 \(0\),求将环变为序列 \(A\) 的最少操作次数。 (\(1 \le N \le 2 \times 10^5, 1 \le A_i \l ......
Codeforces Round 730 (Div. 2) B. Customising the Track
有 \(n\) 条高速公路,第 \(i\) 条告诉公路上的车流为 \(a_i\) 。现在可以执行以下操作任意次: 将第 \(i\) 条高速公路上的一辆车移到第 \(j\) 条高速公路。 需要求最小的 \(\sum_{i = 1}^{n}\sum_{j=i+1}^{n} |a_i - a_j|\) 。 ......
UVA10054 The Necklace 题解
好可恶一道题,怎么没人告诉我输出之间有空行( 思路是先抽象成图,然后跑一边dfs记录边的前后顺序。 对于不能成环的情况,只需要再开个数组记录度数判断奇点即可。 若存在奇点则break掉,剩下的跑dfs、 //produced by miya555 //stupid mistakes:1.多测要清空 ......
The 2022 ICPC Asia Shenyang Regional Contest
C. Clamped Sequence 因为\(n\)的范围不大,并且可以猜到\(l,r\)中应该至少有一个在\(a_i,a_i-1,a_i+1\)上。所以直接暴力枚举\(l\)或\(r\)然后暴力的计算一下 #include <bits/stdc++.h> using namespace std; ......
P5299 [PKUWC2018] Slay the Spire
P5299 [PKUWC2018] Slay the Spire 洛谷:P5299 [PKUWC2018] Slay the Spire LOJ:#2538. 「PKUWC2018」Slay the Spire 前言:请分清楚 使用 和 抽取。九条要 抽取 \(m\) 张牌,但只会 使用 \(k\) ......
The name org.freedesktop.secrets was not provided by any .service files 报错问题
在搭建cicd docker 靶场的时候出现这个问题,由于是第一次遇到,就想记录下来 通过各种搜索资料搜索 发现只要安装如下包就没问题 1 apt -y install gnome-keyring 这样做之后,一切都可以 这样就可以了 ......
CF1575I Illusions of the Desert
prologue 还是太菜了,这个 154 行的树剖20min才敲完。 analysis 首先,处理这个给到我们的这个式子。 \[\max(\mid a _ u + a _ v \mid, \mid a _ u - a _ v \mid) \]我们可以分类讨论: \(a > 0, b > 0\): ......
The solution of P3012
problem & blog 很明显是个 DP。 于是我们定义 \(dp_{i,j,k}\) 为末尾的字符的 ASCII 码为 \(i\),有 \(j\) 个大写字母,\(k\) 个小写字母。 然后在枚举能接在 \(i\) 之后所有字母即可。 然后考虑 \(dp_{i,j,k}\) 给后面的 DP ......
The 2022 ICPC Asia Xi'an Regional Contest
C. Clone Ranran 最优解一定是先复制,在做题。最多只需要复制大约 30 次,直接枚举即可 #include <bits/stdc++.h> using namespace std; #define int long long int a , b, c; void solve(){ ci ......
Go - Logging to the System Log Service
Problem: You want to log in to the system log instead of your logfiles. Solution: Use the log/syslog package to write to syslog. Syslog is a standard ......
The solution of ABC144F
都不知道什么时候做的题了 problem & blog 一开始很容易想到枚举断边然后 DP 算代价。 于是很容易想到 DP 状态定义:设 \(dp_u\) 为从 \(u\) 出发到 \(n\) 的期望步数。 那么显然有 \(dp_u = \sum^{v_n}_{v_1} \dfrac{dp_{v_{ ......
vue_error_Runtime directive used on component with non-element root node. The directives will not function as intended
翻译: '运行时指令,用于非元素根节点的组件。这些指令将无法发挥预期的作用'; 这个错误发生在我将v-show放在自定义组件上时, 我想是因为自定义组件在渲染时会被自定义组件的内部元素替换, 因此设置是无效的 解决: 在自定义组件外加一个div, 把v-show写在div上 ......
[ARC059F] バイナリハック
2023-09-29 题目 [ARC059F] バイナリハック 难度&重要性(1~10):6 题目来源 luogu 题目算法 (纯)dp 解题思路 一道非常水的 dp 题。 先看数据 \(N\le 5000\),考虑 \(O(n^2)\) dp。 对于题目的三个操作中,我们唯一需要仔细思考的就是对于 ......
Go - Change What Is Being Logged by the Standard Logger
Problem: You want to change what the standard logger logs. Solution: Use the SetFlags function to set flags and add fields to each log line. The defau ......
Gym 104270 The 2018 ICPC Asia Qingdao Regional Programming Contest (The 1st Universal Cup, Stage 9: Qingdao)
A. Sequence and Sequence B. Kawa Exam 可以发现,对答案会产生影响的只有割边,把所有边双缩起来,然后就是一个森林。 考虑一个树的时候怎么做,就是对于每条边求出这条边两端的众数个数,考虑线段树合并,每次动态维护子树内的众数和子树外的众数。 #include<iost ......
Go - Using Multiple Versions of the Same Dependent Packages
Problem: You want to use multiple versions of the same dependent packages in your code. Solution: Use the replace directive in the go.mod file to rena ......
Road of the King
2023-09-28 题目 Road of the King 难度&重要性(1~10):8.5 题目来源 luogu 题目算法 (纯)dp 解题思路 一道非常好而有意思的题目,码量巨短。 首先观察数据范围,发现是 \(n\le 300\),考虑 \(O(n^3)\) 的 dp。 主要的难点在于如何去 ......
AT_arc111_a 题解
洛谷连接&Atcoder 链接 题目简述 给定两个数 \(n\) 和 \(m\),输出 \(\left\lfloor\frac{10^n}{m}\right\rfloor \bmod m\) 的值。 数据范围:\(n \le 10^{18},m \le 10^4\) 思路 首先看到数据范围还是很大的 ......
pip安装包报错:PS C:\Users\Administrator\Desktop> pip install request ERROR: Could not find a version that satisfies the requirement request (from versions: none)
PS C:\Users\Administrator\Desktop> pip install requestERROR: Could not find a version that satisfies the requirement request (from versions: none)ERRO ......
The Out-of-Memory Syndrome, or: Why Do I Still Need a Pagefile?
The Out-of-Memory Syndrome, or: Why Do I Still Need a Pagefile? July 19, 2016 aziusMemory Management 13 Comments Windows’ memory management—specifical ......
qoj6735. Tree (The 1st Universal Cup. Stage 22: Shaanxi)
https://qoj.ac/contest/1287/problem/6735 考虑定一个根,然后把每个点的点权附属在父边权上,让每条边的边权变成一个 pair。 这样,一个符合条件的路径需要满足的条件是:路径内所有边的边权 pair 相同,以及 路径根节点(lca)的颜色符合。 对于当前树上每个 ......
[ARC135C] XOR to All 题解
include <bits/stdc++.h> typedef long long valueType; typedef std::vector ValueVector; constexpr valueType MAXB = 31; int main() { std::ios::sync_with_ ......
Snapshot appears to have been created more than one day into the future!
Snapshot appears to have been created more than one day into the future! Raspberry PI 4b上安装freebsd13.2 aarch系统后,使用ssh链接,输入portsnap fetch extract命令,提示: ......
The 2021 China Collegiate Programming Contest (Harbin) JBEIDG
The 2021 China Collegiate Programming Contest (Harbin) 目录The 2021 China Collegiate Programming Contest (Harbin)VP概况J - Local MinimumB - Magical Subseq ......
Gym 104172 The 2023 ICPC Asia Hong Kong Regional Programming Contest (The 1st Universal Cup, Stage 2Hong Kong)
A. TreeScript 令 \(f_u\) 表示 \(u\) 及 \(u\) 子树中的节点都创建的最小数量。 如果 \(u\) 只有一个儿子,那么可以将子树最后一个节点存储在当前的 \(u\) 中,答案就是 \(f_v\)。 若 \(u\) 有多个儿子: 令 \(t=\max\limits_{v ......
ARC
ARC——run Adaptive Rotated Convolution for Rotated Object Detection (ICCV 2023)运行过程 Introduction This is the official implementation of the paper, Adap ......