题解counting t399753 problem

luogu P4119(未来日记) 题解

[题目链接](https://www.luogu.com.cn/problem/P4119) 首切 Ynoi QAQ 调了4个小时 ## 题目描述 写个支持以下操作的数据结构: 对于长度为 $n$ 的序列 $a$, - 给定 $l,r,k$, 求序列 $a$ 在该区间的 kth - 给定 $l,r, ......
题解 日记 luogu P4119 4119

使用gorm进行数量统计【limit、offset对count的统计的影响】

limit、offset对count的统计的影响 错误示例1:请注意,如下例子中,Count放在了最后面,查询时,count方法也会加上Limit和offset这两个语句: global.DB.Limit(10).Offset(2).Find(&users).Count(&total) 错误示例2: ......
数量 offset count limit gorm

题解:【ARC142D】 Deterministic Placing

[题目链接](https://www.luogu.com.cn/problem/AT_arc142_d) 大佬讲解的太精简了,做点蒟蒻视角的思考补充。下面记摆放棋子的点为黑点,没有摆放棋子的为白点。 因为进行无数次操作后,占据节点集合总是唯一,所以黑点一定是在反复横跳;每个位置上只能存在一个黑点,所 ......
题解 Deterministic Placing 142D ARC

ABC300F 题解

前两天忘发出来了,补一下QAQ ## [题目链接](https://www.luogu.com.cn/problem/AT_abc300_f) ## 题意简述 给定一个长度为 $n$ 且只包含 $\texttt{o}$ 和 $\texttt{x}$ 的字符串 $s$ 以及正整数 $n$ $m$ $k ......
题解 300F ABC 300

Luogu P3605 [USACO17JAN]Promotion Counting P

# [USACO17JAN]Promotion Counting P ## 题目描述 The cows have once again tried to form a startup company, failing to remember from past experience that cow ......
Promotion Counting Luogu P3605 USACO

【题解】Luogu-P4240 毒瘤之神的考验

可以得到: $$\varphi(ij)=\dfrac{\varphi(i)\varphi(j)}{\varphi(\gcd(i,j))}\gcd(i,j)=\varphi(\mathrm{lcm}(i,j))\gcd(i,j)$$ 证明考虑 $\varphi$ 的展开式。 选取中间的式子带进去化简。 ......
毒瘤 题解 Luogu-P Luogu 4240

P3392 涂国旗 题解

###题目大意 题目真的是不说人话...... 有一个国家的国旗是由一个 N * M 的方格组成的。如果想要这面国旗合法,就必须满足要求: - 国旗从上到下必须是白色、蓝色和红色,顺序不能改变。 - 每一种颜色都至少有一行。 小a这时候捡到了一块破布,希望你通过涂颜色的方式,把破布成合法的国旗,并且 ......
题解 国旗 P3392 3392

题解 P4556 [Vani有约会]雨天的尾巴 /【模板】线段树合并

[传送门](https://www.luogu.com.cn/problem/P4556) 如题目所言,这就是个线段树合并的板子题。 ## 题目大意 ### 题目描述 首先村落里的一共有 $n$ 座房屋,并形成一个树状结构。然后救济粮分 $m$ 次发放,每次选择两个房屋 $(x, y)$,然后对于 ......
线段 题解 雨天 尾巴 模板

CF149E Martian Strings 题解

#### 题意 给定一个主串 $s$ 和一些模式串 $p_i$,问主串中是否存在两个不相交的非空字串,拼起来和模式串相同。 考虑如何拼接 $p_i$。我们可以从前向后匹配一遍主串,找到 $p_i$ 的所有长度的前缀在主串中最先出现的位置,并记录下来;然后再从后向前跑匹配,每次匹配上一个后缀,就判断该 ......
题解 Martian Strings 149E 149

CF1559D2 Mocha and Diana (Hard Version) 题解

[Luogu](https://www.luogu.com.cn/problem/CF1559D2) | [Codeforces](https://codeforces.com/problemset/problem/1559/D2) ### 题意 给定两个森林 $A$ 和 $B$,均有编号 $1$ ......
题解 Version 1559D Mocha Diana

CodeForces 1838E Count Supersequences

[洛谷传送门](https://www.luogu.com.cn/problem/CF1838E "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1838/E "CF 传送门") **结论:$a_i$ 对答案没有影响。** 考虑 ......
Supersequences CodeForces 1838E Count 1838

AT_abc304_f 题解

一、题目描述: 给你一个长度为 $n$ 的字符串 $s$ ,$s_i$ 要么是 $\#$ ,要么是 $.$ 。 求有多少种长度为 $n$ 的字符串 $t$ ,恰好由一个长度为 $\frac{n}{x}$ 的字符串循环 $x$ 次得来, 且对于每一个 $i$ 使得 $s_i$ 为 $.$,$t_i$ ......
题解 AT_abc 304 abc AT

Contrastive Learning for Representation Degeneration Problem in Sequential Recommendation

[TOC] > [Qiu R., Huang Z., Ying H. and Wang Z. Contrastive learning for representation degeneration problem in sequential recommendation. WSDM, 2022.] ......

解决cURL error 60: SSL certificate problem: unable to get local issuer certifica

转载:[](https://blog.csdn.net/qq_38776443/article/details/125202116) 报错原因:因为没有配置信任的服务器HTTPS验证。默认情况下,cURL被设为不信任任何CAs,因此浏览器无法通过HTTPs访问你服务器。 #### 一、解决方式 [下 ......
certificate certifica problem issuer unable

Git 的SSL certificate problem: unable to get local issuer certificate问题

D:\temp>git clone https://github.com/xxxxxx/yyyyyy.git Cloning into 'yyyyyy'... fatal: unable to access 'https://github.com/xxxxxx/yyyyyy.git/': SSL c ......
certificate problem issuer unable 问题

CF1838E - Count Supersequences

先考虑正着做,我们只考虑整个 $b$ 序列中出现的第一个子序列 $a$。 这样,我们就是要往 $a$ 中插入 $m-n$ 个数,其中 $a_{i-1}$ 和 $a_i$ 之间不能有 $a_i$(否则就会有更靠前的子序列)。$a_1$ 前面不能有 $a_1$,$a_n$ 后面什么都可以有。 我们发现, ......
Supersequences 1838E Count 1838 CF

DRTREE - Dynamically-Rooted Tree 题解

[DRTREE - Dynamically-Rooted Tree](https://www.luogu.com.cn/problem/SP14943) 本题建议评蓝。 ### 思路: 题目就是要对一颗不定根树求子树权值和。 这题不带修,如果带修难度会增加一点,就跟 [遥远的国度](https:// ......

Meteors 题解

[Meteors](https://www.luogu.com.cn/problem/SP10264) 蒟蒻初学整体二分,写一篇题解记录一下思考与看法。 ### 题目大意 在一个环形的轨道上分别着若干国家的空间站,在接下来的一段时间内会出现若干次陨石,每次出现在环形的某一段轨道,每个国家都想收集一定 ......
题解 Meteors

Full Tank 题解

[Full Tank](https://www.luogu.com.cn/problem/UVA11367) ### 题目大意 给定一张 $n$ 个点,$m$ 条边的连通无向图,在每个点有一个加油站,油价为该点的点权,每条边的油耗为该边的边权。现给出若干询问,问一辆油箱容量为 $c$ 的车子是否能从 ......
题解 Full Tank

Visible Lattice Points 题解

[Visible Lattice Points](https://www.luogu.com.cn/problem/SP7001) ### 题目大意 给定一个 $N×N×N$ 的由若干点组成的立方体,点的坐标从 $(0,0,0)$ 到 $(N,N,N)$,求从点 $(0,0,0)$ 处可以看见多少个 ......
题解 Visible Lattice Points

We Need More Bosses 题解

[We Need More Bosses](https://www.luogu.com.cn/problem/CF1000E) ### 题目大意 给定一张图,找到两个点,使得这两个点之间的所有路径必须经过的边最多。 ### 思路分析 我们先来思考一下如果已知两个点,怎么求两个点之间必须经过的边的数量 ......
题解 Bosses Need More We

Substring of Sorted String 题解

[Substring of Sorted String](https://www.luogu.com.cn/problem/AT_abc285_f) 写篇题解纪念一下蒟蒻第一次赛时切出的 F 题。 ### 题目简述 对一个字符串进行单点修改,区间判断操作。 修改操作为将一个字符修改为另一个,判断操作 ......
题解 Substring Sorted String of

镜面通道 题解

[镜面通道](https://www.luogu.com.cn/problem/P3260) ### 题目大意 在一个二维平面内,给出一个镜面通道和若干个镜面元件,每个元件可能是圆形或矩形。求出为了能够使光从通道左边通过通道到达右边,至少需要拿走的元件个数。 ![](https://i.imgloc ......
题解 镜面 通道

逛森林 题解

[P5344 逛森林](https://www.luogu.com.cn/problem/P5344) ### 题目大意 ~~原题的题目大意已经很明确了要这个干嘛~~ 给定一些孤立点,将要进行两种操作: - 若两点之间不可以通过 $1$ 类边连通,则在两点之间连双向 $1$ 类边 - 若 $u_1, ......
题解 森林

OTOCI 题解

[OTOCI](https://www.luogu.com.cn/problem/SP4155) ### 题目大意 给定 $n$ 个带权的点,需要进行四种操作:查询两点连通性;加边;修改点权;查询两点路径的权值和。 ### 思路分析 首先观察题目,我们会发现,在所有的操作结束后,所有的点构成一个森林 ......
题解 OTOCI

旅游 题解

[旅游](https://www.luogu.com.cn/problem/P3976) ### 题目大意 对一颗树进行两种操作:将一条从 $u$ 到 $v$ 的链上的点的权值增加 $x$;查询从 $u$ 到 $v$ 的链上最大的 $p_i-p_j(dis_{ui} using namespace ......
题解

Sell Pigs 题解

[Sell Pigs](https://www.luogu.com.cn/problem/SP4063) [双倍经验](https://www.luogu.com.cn/problem/P4638) ### 题目大意 有 $n$ 个顾客前来买猪,共有 $m$ 个猪圈,每个顾客携带着某一些猪圈的钥匙, ......
题解 Sell Pigs

Interesting Array 题解

[Interesting Array](https://www.luogu.com.cn/problem/CF482B) ### 题目大意 构造一个序列 $a$,使其满足若干限制条件,每个限制条件是形如 `l r q` 的式子,其意义是:$\&_{i=l}^ra_i=q$。 ### 题意分析 看上去 ......
题解 Interesting Array

Sum of MSLCM 题解

[Sum of MSLCM](https://www.luogu.com.cn/problem/UVA1730) ### 题目大意 定义 $\text{MSLCM}(n)$ 为所有满足该数集的 $\text{lcm}$ 为 $n$ 的数集中元素个数最多的数集的所有数字的和,现有多次询问,求 $$\s ......
题解 MSLCM Sum of

CF338D GCD Table 题解

# CF338D GCD Table 题解 ## 题目描述 你有一个长度为 $k$ 的数列 $a$ , 询问是否存在 $x\in[1,n]~~~y\in[1,m]$ 使得 $\forall i~~~ \gcd(x,y+i-1)=a_i$。 ## 解析 我们转换一下可以得到: $$ \forall i ......
题解 Table 338D 338 GCD