ergodicity liouville theorem and
typedef and define
# `typedef` vs. `#define` - `#define` is a preprocessor token: the compiler itself will never see it. - `typedef` is a compiler token: the preprocesso ......
typedef struct and struct
# `typedef struct` and `struct` > status: 更新中 > > warning: 初学者写的内容,可能有内容上的错误 > https://stackoverflow.com/questions/252780/why-should-we-typedef-a-stru ......
CF1858D Trees and Segments
[一道考查预处理技巧的 dp。](https://codeforces.com/problemset/problem/1858/D "一道考查预处理技巧的 dp。") 观察式子 $a\times L_0+L_1$,一个显然的想法是“定一求一”,即预处理求出对于每个 $L_1$ 最大的 $L_0$,然 ......
Saving your Plot: Stylesheets and Layouts (STY, LAY, LPK)
Description We describe the uses and differences between Tecplot 360’s three different methods for saving the style and settings of your plot. These i ......
CF258D Little Elephant and Broken Sorting 题解
# CF258D Little Elephant and Broken Sorting 题解 ## 题目大意 有一个 $1 \sim n$ 的排列,会进行 $m$ 次操作,操作为交换两位置的数,每次操作都有 $50\%$ 的概率进行,求 $m$ 次操作之后的期望逆序对个数。($n, m \le 10 ......
【CF1348C】Phoenix and Distribution(构造、贪心)
**题目大意:** 将给定的$n(1\le n\le10^{5})$个字符分配为$k$个字符串(不能有空串),求此操作得到的字典序最大的字符串最小的情况。 我们先将给定的字符按照字典序从小到大排序,然后逐个分配给字符串。我们要让字典序最大的字符串尽可能小,所以将第$i$个字符安排在第$i$字符串的头 ......
CF1862E Kolya and Movie Theatre
## 思路 假设我们选择了第 $p_1,p_2 \cdots p_x$ 场电影,那么减去的舒畅值是 $d\times(p_1+p_2-p_1+\cdots+p_x-p_{x-1})=d\times p_x$ 所以减去的舒畅值,只与最后一场电影的天数有关。 所以我们可以枚举最后一场电影在第几天,假设在 ......
CF258D Little Elephant and Broken Sorting 题解
## 题意 给定一个长度为 $n$ 的排列 $a$ 和 $m$ 个形如 $\left(x,y\right)$ 的操作,每次操作有 $50\%$ 的概率交换 $a_x, a_y$,求最终排列的期望逆序对数。 ($1 \le n,m \le 5000$)。 ## 题解 首先转化答案 $$\text{An ......
ADRABR - Adrita and Her Bike Ride 题解
## 1.题目大意 [题目传送门](https://www.luogu.com.cn/problem/SP34012) ## 2.思路 因为每条道路长均为 $1km$,所以我们可以在建边时就加上走这条路的初始成本,即对于每条边的两端 $a,b$ 和通行费 $w$,我们直接 $add (a,b,w+1 ......
E. Kolya and Movie Theatre
E. Kolya and Movie Theatre Recently, Kolya found out that a new movie theatre is going to be opened in his city soon, which will show a new movie ever ......
vue3 报错 and 'localEnabled' does not exist in type 'ViteMockOptions'
报错:ReferenceError: require is not defined 原因: 通过命令行 pnpm install -D vite-plugin-mock mockjs 安装得vite-plugin-mock 之后发现再vite.config.ts里边报错 vue3+vite安装vit ......
[CF1824D] LuoTianyi and the Function
## 题目描述 LuoTianyi gives you an array $ a $ of $ n $ integers and the index begins from $ 1 $ . Define $ g(i,j) $ as follows: - $ g(i,j) $ is the large ......
[AGC007D] Shik and Game 题解
一道有意思的 $\text{dp}$ 呀。 ### 思路 我们容易发现,一个点最多会往回走一次。 也就是每一个点最多被遍历三次。 因此,我们可以考虑每个点的贡献。 $$dp_i=\min_{j=1}^{i-1}dp_j+x_i-x_j+\max(2\times(x_i-x_{j+1}),T)$$ 其 ......
Ciel and Flipboard
## Ciel and Flipboard 一道好题,很有思维难度。 首先,我们发现 $n$ 很小,所以对于一些位置应该是可以枚举的,再通过一些限制来确定其他位置。 对于操作的矩阵 $m * m$,我们发现中间一行必会被操作,而 $i$ 和 $i + m$ 行有且仅有一个被操作,那么设 $f_{i, ......
CodeForces1741G-Kirill and Company题解
# $\large\text{CodeForces1741G-Kirill and Company题解}$ ## [题面传送门(有翻译(由黄巨佬提供))](Https://Vjudge.Net/Problem/Codeforces-1741g#Author=Huangqixuan) ## 思路 ## ......
1.变量and输入输出
## 一、变量 概念:变量的本质是一个装东西的盒子,只能存放一个值,且区分大小写。 ### 1.变量命名规则 变量的名字由:字母、数字、下划线 组成,并且不能以数子开头 ```python _a=5 a_1=6 ``` ### 2.变量的定义 格式:变量名 = 值 = 赋值符号,== 等于 ```p ......
[论文理解] HACK: Learning a Parametric Head and Neck Model for High-fidelity Animation
# HACK: Learning a Parametric Head and Neck Model for High-fidelity Animation 上科大发布的头和脖子精细建模的参数化模型HACK。 ## 纹理转化 由于HACK没有开源纹理基,我将FLAME开源的纹理基迁移到了HACK上,代 ......
[LeetCode][121]best-time-to-buy-and-sell-stock
# Content You are given an array prices where prices[i] is the price of a given stock on the ith day. You want to maximize your profit by choosing a s ......
2023-08-22 SAS数据集与Excel文件之间的批量转换 Batch File Exchange between SAS and Excel
参考资料:[Batch File Exchange between SAS and Excel - the Magic of Call Execute](https://support.sas.com/resources/papers/proceedings19/3114-2019.pdf) 我们经 ......
P9559 [SDCPC2023] D-Fast and Fat
## 思路 直接做比较难,考虑二分答案,所以我们需要想出一种时间复杂度还行的方法检查答案是否合格。 假设目前二分的答案是 $x$,那么速度低于 $x$ 必然需要别人背。 那么,自然而然地想到将所有人分成两部分,那么速度低于 $x$ 中的所有人应当优先满足较重的,如果优先满足较轻的,就可能导致较重的无 ......
CF1485C Floor and Mod 题解
## 题面 给定 $x, y$,求 $$\sum\limits_{a = 1}^{x} \sum\limits_{b = 1}^{y} \left[\left\lfloor\dfrac{a}{b}\right\rfloor = a \bmod b\right]$$ ($1 \le x, y \le ......
Mixture-of-Domain-Adapters: Decoupling and Injecting Domain Knowledge to Pre-trained Language Mod...
### 1. Abstract 经过预训练的语言模型(PLM)表现出在通用领域理解文本的出色能力,同时在特定领域中表现不佳。**尽管在大型领域特定语料库上继续预训练是有效的,但调整领域上的所有参数是昂贵的**。在本文中,我们研究了是否可以通过只调整几个参数来有效地调整PLM。具体来说,我们将Tran ......
E2. Erase and Extend (Hard Version)
题意:给你一个字符串s,请你找到所有的特殊字符串,满足它既是s的前缀,又是s的后缀,并输出它在s中出现的次数。 做法:对于第一步,我们只需要先做出kmp,考虑kmp中ne数组的意义,不就是求border吗,那么我们一直去求最后一个字符串字母的border,然后就能把所有的既是前缀又是后缀的字符串求出 ......
门面设计模式(Facade Pattern) and Encapsulation—— Structure Class
如果只看代码,应该可以说是一种最简单的代码结构,不就封装吗!这玩意谁不会! 还是看它背后所蕴含的思想吧,看了之后发现背后的思想也很简单。 - -。 # Think Encapsulation: 在物理世界中,从古代的`弹药`到`子弹`的发展其实就是对弹药的`封装`,因此大大提高了装弹效率。经过演化, ......
Paper Reading: PCTBagging: From inner ensembles to ensembles. A trade-off between discriminating capacity and interpretability
针对 CTC 分类性能较差和 Bagging 的可解释性较差的问题,本文提出了一种结合 CTC 和 Bagging 的算法 PCTBagging。首先构建一棵不完整的 CTC,CTC 的规模由超参数合并比来确定,接着使用 Bagging 完成后续的树结构的生成。将 PCTBagging 的结果与 B... ......
论文解读(KD-UDA)《Joint Progressive Knowledge Distillation and Unsupervised Domain Adaptation》
Note:[ wechat:Y466551 | 可加勿骚扰,付费咨询 ] 论文信息 论文标题:Joint Progressive Knowledge Distillation and Unsupervised Domain Adaptation论文作者:Yanping Fu, Yun Liu论文来源 ......
[CF1790F] Timofey and Black-White Tree 题解
# [CF1790F] Timofey and Black-White Tree 题解 ## 题目描述 ZYH 有一棵 $n$ 个节点的树,最初 $c_0$ 号节点是黑色,其余均为白色。 给定操作序列 $c_1,c_2,\cdots,c_{n-1}$,第 $i$ 次操作表示将 $c_i$ 号节点染黑 ......
CF1060E Sergey and Subway
### 题目大意 给定一棵树,每两个有边直接相连的点之间距离为 $1$。现在我们要给所有原来距离为 $2$ 的城市之间修一条长度为 $1$ 的道路。 记 $\operatorname{dis}(a,b)$ 表示 $a,b$ 之间的最短距离,求 $$\sum_{i=1}^n\sum^{n}_{j=i+ ......
CF1101F Trucks and Cities
### 题目大意 有 $n$ 个城市坐落在一条数轴上,第 $i$ 个城市位于位置 $a_i$。 城市之间有 $m$ 辆卡车穿行。每辆卡车有四个参数:$s_i$ 为起点编号,$f_i$ 为终点编号,$c_i$ 表示每行驶 $1$ 个单位长度需要消耗的油量,$r_i$ 表示可以在路途中加油的次数。 当卡 ......