counting another path abc

abc206

C - Swappable 171 数组中不相等的数对数量 D - KAIBUNsyo 879 每次操作可以把数组中等于 \(x\) 的数全变成 \(y\),问变成回文数组至少需要几次操作 简单的不错的并查集模拟题 #include <bits/stdc++.h> using namespace s ......
abc 206

内核参数max_map_count 和 ORA-04030

PLSQL Procedure Causing ORA-04030: (pga heap,control file i/o buffer) And ORA-04030: (koh-kghu sessi,pmuccst: adt/record) or ORA-04030: (koh-kghucall ......
max_map_count 内核 参数 count 04030

ABC209E Shiritori 题解

ABC209E Shiritori 题解 原题:洛谷AT_abc209_e 分析 博弈,可重复选,一眼图论,将每个单词的前三个字符向后三个字符连边,并用后三个字符代表这个单词。 看一下样例。 5 eaaaabaa 1 2 eaaaacaa 1 3 daaaaaaa 4 5 eaaaadaa 1 4 ......
题解 Shiritori 209E ABC 209

[918] Copy the formatting from one cell in a table of a Word document to another cell in Python

To copy the formatting from one cell in a table of a Word document to another cell, you can use the python-docx library in Python. Here's a step-by-st ......
cell formatting document another Python

[920] Copy the font style from one cell in a table of a Word document to another cell using Python

To copy the font style from one cell in a table of a Word document to another cell using Python and the python-docx library, you can access the font p ......
cell document another Python style

python sys.path介绍

python sys.path介绍 介绍 当我们导入模块时,python解释器会通过sys.path中的环境变量搜索。sys.path是一个列表,里面包含已添加到环境变量中的路径。使用sys.path.append({路径})可以往里面添加自定义的环境变量。 使用 当我们想要导入某个文件中的文件失败 ......
python path sys

[ABC267F] Exactly K Steps

多次询问 给出x,给出任意点y满足 dis(x,y)==m 以直径端点为根,dfs 可以发现 至少有一个y 在这个路径上 https://www.luogu.com.cn/record/130467795 ......
Exactly Steps 267F ABC 267

Git-error: invalid path

git checkout isp 原因是Win和Linux文件格式不一致,要么切换到Linux环境下操作,要么git config core.protectNTFS false 查了下官方手册,官方原话: If set to true, do not allow checkout of paths ......
Git-error invalid error path Git

AtCoder Beginner Contest(abc) 308

B - Default Price 题目大意 小莫买了n个寿司, 现在给出m个寿司的名称和m+1个价格, 如果小莫买的其中一个寿司不在这m个寿司之中就用价格m0; 请问小莫买的寿司花了多少钱 解题思路 数据不大, 暴力哈希即可; 神秘代码 #include<bits/stdc++.h> #defin ......
Beginner AtCoder Contest 308 abc

[ABC207F] Tree Patrolling 题解

[ABC207F] Tree Patrolling 弱智 DP 题,设 \(f(i,j,0/1/2)\) 表示在点 \(i\),子树中有 \(j\) 个点被覆盖,且 \(i\) 点自身状态是未被覆盖/被自身覆盖/被某个儿子覆盖,然后树上背包更新就行了。 代码: #include<bits/stdc+ ......
题解 Patrolling 207F Tree ABC

AT_abc134_d Preparing Boxes题解

简述题意 这什么破翻译,看了 AtCoder 的英文才看懂。 给定一个长度为 \(n\) 序列 \(a\),要求构造一个数列 \(b\),使得对于任意 \(i\),满足: \(1 \le i \le n\) 将 \(b\) 序列下标为 \(i\) 的倍数的值相加使得这个总和模 2 等于 \(a_i\ ......
题解 Preparing AT_abc Boxes 134

【git】git pull更新项目报错git error:invalid path

1、报错内容 error: invalid path 'xxxxxxx' 原因是某分支下的文件名格式不支持,最终导致在git clone的时候找不到这个文件路径导致的! 2、解决方法 git config core.protectNTFS false 作用是关掉NTFS下的路径保护机制,防止文件系统 ......
git invalid 项目 error pull

vscode log的问题 log前的abc

但存在一个问题,当第二次输入log的时候,会出现两个log选项。前面有abc标识的是因为你输了log这个单词,他自动帮你记录并且提示了。默认情况下。有abc标识的是排在前面的,这不是我们想要的,我们需要是下图这个顺序。 到设置里面搜索Snippet Suggestions,把下面的选项改为top就可 ......
log vscode 问题 abc

Codeforces Round 893 (Div. 2) C. Yet Another Permutation Problem

有一个 \(gcd\) 游戏,按以下步骤进行: 选择一个 \(n\) 的排列 \(p_1, p_2, \cdots, p_n\) 。 对于每个 \(i\) ,\(d_i = gcd(p_i, p_{i \% n + 1})\) 排列 \(p\) 的 \(score\) 为数组 \([d_1, d_2 ......
Permutation Codeforces Another Problem Round

[910] Copy a file to another directory with a new name in Python

To copy a file to another directory with a new name in Python, you can use the shutil library. Here's how you can do it: import shutil # Specify the s ......
directory another Python Copy file

关于crontab运行脚本时报错KeyError: 'PATH'

最近在服务器上为let's encrypt证书添加自动续签计划任务时,发现总是不成功,但手动执行该计划任务所对应的sh脚本则没问题,这让我怀疑crontab执行时可能缺少了点什么导致的,想追踪一下crontab的执行日志,发现并没有,需要手动修改配置文件打开: sudo vim /etc/rsysl ......
脚本 KeyError 时报 crontab 39

题解 ABC267F【Exactly K Steps】

Robin 有一棵树,他有 $m$ 次询问,每次询问他给你 $u,k$,你需要输出树上的一个节点 $v$ 满足 $dist(u,v)=k$,或者报告无解。 $dist(u,v)$ 表示树上 $u$ 到 $v$ 的最短路径的边数。$n\leq 10^5$ ......
题解 Exactly Steps 267F ABC

10.16闲话:abc + 2 > a + b + c 的几何证法

来自wxy大佬的一道题 已知 \(|a|,|b|,|c|<1\),求证: \(abc + 2 > a + b + c\)。 这里给出几何方法: 设 \(a,b,c\) 的绝对值分别为 \(x, y, z\) 考虑构造如下图形: \(x,y,z\) 为图中标示的对应边,而外面的立方体棱长为 1 。 显 ......
证法 几何 10.16 abc 10

[ABC235G] Gardens

[ABC235G] Gardens 题目描述: 有三种不同颜色的球,分别有 \(A,B,C\) 个。(相同颜色的球之间不区分) 将球放入 \(N\) 个不同的盒子中,要求: 每个盒子至少放了一个球 每个盒子不能存在两个相同颜色的球 可以不放完所有的球 求放置方案数对 \(998244353\) 取模 ......
Gardens 235G ABC 235

RuntimeError: Attempting to deserialize object on CUDA device 1 but torch.cuda.device_count() is 1.

问题:服务器上多块卡,使用其中一张训练的模型,在本地预测的时候报错。 解决:在torch.load中加入map_location,指定一块卡 ......

「解题报告」[ABC267F] Exactly K Steps

「解题报告」[ABC267F] Exactly K Steps 大家好,我是个毒瘤,我非常喜欢没脑子做法,于是我就用点分治过了这个题 . 离线在每个点存下与其相关的询问 . 考虑如何计算跨重心的答案 . 记录下每个点在当前重心下的深度,同时开一个桶 \(t_{k, 0/1}\) 存下当前深度为 \( ......
Exactly 报告 Steps 267F ABC

CF1870E Another MEX Problem 题解

原题 翻译 首先 \(O(n^3)\) 的 dp 是 simple 的。设 \(dp_{i,j}\) 表示前 \(i\) 个划分后异或和为 \(j\) 是否可行。因为转移不具有连续性,故bitset无法优化(其实 \(O(\frac{n^3}{\omega})\) 也跑不过去) 官方做法: 定义对于 ......
题解 Another Problem 1870E 1870

AT_abc301_h [ABC301Ex] Difference of Distance

AT_abc301_h [ABC301Ex] Difference of Distance 更好的阅读体验 一道基础图论,很好口胡,但是实现不太简单。 考虑离线,把询问挂在边上,按边权从小到大处理。 处理到一个边权时,把边权小于它的边的两端用并查集合并,对于等于这个边权的边在并查集上建图,跑一边 t ......
Difference 301 Distance AT_abc ABC

ABC262E - Red and Blue Graph

原题 翻译 诈骗诈骗诈骗诈骗诈骗诈骗诈骗诈骗!!! 第一眼看上去很像一个 NP-Hard 问题,完全没有思路 然后以为 dp ,然后看数据范围一眼寄 首先遇到 01 染色问题,而且一边连接的两点颜色相同/不同(其实主要是不同)会产生贡献的问题,要考虑一下能不能先统一染成一个颜色,然后看改变颜色后会产 ......
Graph 262E Blue ABC 262

ABC159F Knapsack for All Segments

原题 翻译 \(O(n^3)\) 的朴素 \(dp\) 是 simple 的 考虑定义一个子序列是”好的子序列”当且仅当 \(a_l\) 和 \(a_r\) 都在子序列中,容易发现他对答案的贡献是包含他的区间,即 \(l \times (n - r + 1)\) 先说我自己的做法:设 \(dp_{i ......
Knapsack Segments 159F ABC 159

ABC324

T1:Same set 代码实现 n = int(input()) a = list(map(int, input().split())) if len(set(a)) == 1: print('Yes') else: print('No') T2:3-smooth Numbers 把 \(N\) ......
ABC 324

Count of Sub-Multisets With Bounded Sum

Count of Sub-Multisets With Bounded Sum You are given a 0-indexed array nums of non-negative integers, and two integers l and r. Return the count of s ......
Sub-Multisets Multisets Bounded Count With

ABC202E Count Descendants

ABC202E Count Descendants 线段树合并模板题。 每次询问就是给定有序数对 \((u,d)\),求有根树 \(T\) 上,点 \(u\) 的子树内有多少点 \(v\),使得 \(v\) 的深度恰好等于 \(d+1\)。定义根节点深度为 \(1\)。 考虑对每一个点开一个长度为 ......
Descendants Count 202E ABC 202

ABC318E Sandwiches

ABC318E Sandwiches 第一次场切 E 题,感动。虽然比较水 注意到 \(\{a_n\}\) 的值域上限为 \(n\),考虑值域相关算法,对每一个 \(a_i\) 开一个 std::vector ,记作 \(pos_{a_i}\),存储 \(a_i\) 所有的出现位置。 枚举 \(x ......
Sandwiches 318E ABC 318

ABC324题解

A/B 赛时没打。 C 暴力判断是相等 s[i] == t 还是替换了一个字符,或者是添加/删除了一个字符。 最后两个判断只需要交换一下 \(s\) 和 \(t\) 的顺序就可以共用一个函数了。 D 注意到 \(N\le 13\),所以平方数不会超过 \(v=10^{13}\),很容易想到暴力枚举 ......
题解 ABC 324