majority 134c arc the

[ARC125B] Squares 题解

题意 给定正整数 \(N\),求满足如下条件的正整数对 \((x, y)\) 的数量: \(1 \le x, y \le N\) \(x^2 - y\) 为完全平方数(\(0\) 也是完全平方数) (\(1 \le N \le 10^{12}\))。 题解 因为 \(x^2 - y\) 为完全平方数 ......
题解 Squares 125B ARC 125

ARC063F Snuke's Coloring 2

Day \(4!\)。 首先容易找到周长为 \(2(w+1)\) 和 \(2(h+1)\) 的矩形,所以答案下界是 \(2(\max(w,h)+1)\)。 考虑按照整个矩形中心坐标,将矩形分成 \(4\) 个子矩形,观察到若有矩形完全包含于其中一个子矩形,则其周长必不超过 \(2\max(w,h)\ ......
Coloring Snuke 063F ARC 063

[892] Change the background color of a table in a Word document

ref: python-docx Changing Table Cell Background Color. To change the background color of a table in a Word document using Python, you can use the pyth ......
background document Change color table

How to get the original size of an image using JavaScript All In One

How to get the original size of an image using JavaScript All In One 如何使用 JavaScript 获取一个图片像的原始大小 naturalWidth & naturalHeight aspect ratio / 纵横比 ......
JavaScript original image using size

arc120D - Bracket Score 2

D - Bracket Score 2 看了题解之后发现自己是弱智 如果能够猜到答案就是前n大-前n小,那么这题就解决了,直接用一个栈模拟匹配即可。 #include<cstdio> #include<algorithm> #include<cstring> #include<cmath> #inc ......
Bracket Score 120D arc 120

Knights of the Round Table

prologue 相信很多人都感觉这个题不就是求一下这个二分图的最大独立集嘛,有什么难的,(劈里啪啦、库里跨啦、叮里哐啷)好,不对,好好好,题解! analysis 这个题目实际上并不是一个完整的最大独立集问题,因为在这个题里面,是可以有相互仇恨的骑士的,只要不让他们二人坐成同桌就行。 那么我们就不 ......
Knights Round Table the of

ERROR: Could not find a version that satisfies the requirement selunium (from versions: none)

错误信息 ERROR: Could not find a version that satisfies the requirement selenium (from versions: none) ERROR: No matching distribution found for selenium ......

[LeetCode] 2582. Pass the Pillow

There are n people standing in a line labeled from 1 to n. The first person in the line is holding a pillow initially. Every second, the person holdin ......
LeetCode Pillow 2582 Pass the

「解题报告」The 1st Universal Cup. Stage 3: Poland

大概按难度排序。签到题没写。 QOJ M. Minor Evil 有 \(n\) 个球与 \(k\) 个操作,初始所有球都是白色的。第 \(i\) 个操作为如果 \(a_i\) 是白色的,那么就将 \(b_i\) 染成黑色,否则什么都不做。你可以选择每个操作执行或不执行,但是不能改变操作之间的相对顺 ......
Universal 报告 Poland Stage The

[888] How to get the directory of the current Python file

To get the directory of the current Python file, you can use the os.path module in combination with the __file__ attribute. Here's how you can do it: ......
directory the current Python file

VSCode 安装插件 Unity 后,一直弹 The .NET Core SDK cannot be located

如题。 明明已经安装了.Net 7.0。并且添加到了 PATH 中。 (也就是在 终端/CMD 可以通过 dotnet 命令访问到。) 但 Vscode 还是一直弹 The .NET Core SDK cannot be located。 然后开始下载 .Net7.0。 解决方案 写在了 .NET ......
插件 located VSCode cannot Unity

The 2023 ICPC Asia Regionals Online Contest (2) MDIELK

The 2023 ICPC Asia Regionals Online Contest (2) MDIELK M Dirty Work 题意:总共有\(n\)个问题,对于第\(i\)个问题需要\(a_i\)分钟。你可以随便选择一个没过的题去写,写完以后马上交,你有\(p_i\)的概率会错,错了不能跳 ......
Regionals Contest Online MDIELK 2023

ARC140D 做题笔记

洛谷题目链接 ATcoder 题目链接 好题。(不过绝大部分题解全在瞎说) 看到 $n$ 个点 $n$ 条边且每个点只有一条出边很容易的想到基环树。 而最后每个连通块一定是一个基环树,那么统计连通块的数量就相当于统计基环树的数量。 既然有基环树,这种题绝对不能枚举然后求连通块数量,一定是枚举连通块求 ......
笔记 140D ARC 140

The 2nd Universal Cup. Stage 2- SPb

A. Mixed Messages dp[i][j]表示前i位,选择\(j\)个移动到一起的最小花费。 #include<bits/stdc++.h> using namespace std; #define int long long constexpr int inf = 1E9; int32_ ......
Universal Stage The 2nd Cup

The 2023 ICPC Asia Regionals Online Contest (2)

Preface 这场打的有点捞说实话,两个小时出头的时候写完6个题就开始坐牢了 K题由于我习惯性地不写数论就扔给徐神了,徐神也是很有思路写了个看着就很对的东西,但不知道为什么过不去 赛后发现K其实是个很傻逼的题,类似的思路我最近补CF的时候还遇到过,但就是没细想 虽然当时下机的时候和祁神把A题的正解 ......
Regionals Contest Online 2023 ICPC

nginx: The plain HTTP request was sent to HTTPS port

问题描述 The plain HTTP request was sent to HTTPS port 当访问用http时则报错。用https时不报错。 检查配置: server { listen 80 ssl; server_name hngj.zxynyxxx.cn; ssl_certificat ......
request nginx HTTPS plain HTTP

the solution of Mining Your Own Business

the description of problem (我看的是 PDF 里面的原题所以这里描述会和题目不一样,但是大意一致) 给定一个未必连通的无向图,问最少在几个点设置出口,可以保证任意一个点坍塌后,工人们仍然可以从出口逃生,同时问设置最少出口的方案数量。 thoughts & solution ......
solution Business Mining Your the

[CF1810G] The Maximum Prefix

题目描述 You're going to generate an array $ a $ with a length of at most $ n $ , where each $ a_{i} $ equals either $ 1 $ or $ -1 $ . You generate this a ......
Maximum Prefix 1810G 1810 The

CF1801D The way home

原题 翻译 非常好的一个题,有两种做法 方法1:flody+dp 首先我们确定一个最优行走方案:从 \(1\) 号节点赚到足够钱后通过最短路到达 \(x_1\) ,在 \(x_1\) 赚够足够钱后到达 \(x_2\) ,在 \(x_2\) 赚够足够钱后到达 \(x_3\) ,如此往复后到达终点 现在 ......
1801D 1801 home The way

CodeForces 715E Complete the Permutations

洛谷传送门 CF 传送门 最小交换次数等于 \(n - \text{环数}\)。所以题目要我们统计把 \(p, q\) 补全成排列,连边 \(p_i \to q_i\),环数 \(= i\) 的方案数。 考虑把边根据 \(p_i, q_i\) 的是否已知状态分成四类: \(p \to q\) \(p ......
Permutations CodeForces Complete 715E 715

CF1710D Recover the Tree

题目链接 一个比较显然的思路就是:我们按照右端点从小到大的顺序(右端点相同按左端点从大到小)去考虑每个好的区间。 由于是连通性问题,不难想到用并查集去实时维护连通性。 根据定义,一个好的区间必定对应了一个连通块;我们考虑的是好的区间,所以当前并查集中的每个连通块必定都是一个区间。而在加入某个点前,这 ......
Recover 1710D 1710 Tree the

git pull代码时提示:Your local changes to the following files would be overwritten by merge

内容来自对 chatgpt 的咨询 这个错误提示意味着你在执行git pull命令时,Git发现你当前工作目录中的一些文件与远程仓库的变更产生了冲突。这可能是因为你在本地修改了一些文件,而远程仓库也有更新。Git不允许在有未提交的本地修改时直接执行git pull,以防止可能的冲突。 要解决这个问题 ......
overwritten following changes 代码 files

UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.解决办法

87iuiu由于ii from torchvision import models # 旧版本的写法,将在未来的torchvision 0.15版本中被Deprecated model_old = models.resnet50(pretrained=True) # deprecated model ......

CF1862G The Great Equalizer

题目链接 先不考虑修改操作。 直接模拟题目意思,可以发现最后留下的一定是最小的数字(因为相同的数每次会保留第一个)。我当时是顺着这个思路做的题目,现在想想反过来想好像会让问题变得更简单,即认为每次保留最后一个相同的数字。 那么现在每次留下的就是最后一个数字,显然每次操作会让这个数字加一,只需要考虑一 ......
Equalizer 1862G Great 1862 The

题解 ARC165F【Make Adjacent】

区间排序问题,主席树优化建图,最小字典序拓扑排序(priority_queue) problem 给定一个长度为 \(n*2\) 的序列,其中每种元素恰好出现了 2 次。 允许每次选择任意两个相邻的元素交换。 那么必定存在一个最小 \(k\):使得 \(k\) 次交换以后所有相同的元素都是相邻的。 ......
题解 Adjacent 165F Make ARC

[ARC165D] Substring Comparison

Problem StatementFor an integer sequence $X=(X_1,X_2,\dots,X_n)$, let $X[L,R]$ denote the integer sequence $(X_L,X_{L+1},\dots,X_{R})$. You are given ......
Comparison Substring 165D ARC 165

CF842A Kirill And The Game

如果考虑 \([x,y]\) 中什么位置能乘到 \([l,r]\) 就比较麻烦,简单的做法是考虑 \(l\) 和 \(r\) 对应到 \([x,y]\) 中的位置。左边界至少是 \(\frac{l-1}{k}+1\),右边界至多是 \(\frac{r}{k}\),判断一下与 \([x,y]\) 是否 ......
Kirill 842A Game 842 And

How to use a shell script to check whether a command had been installed in the Linux server All In One

How to use a shell script to check whether a command had been installed in the Linux server All In One shell script error [: :需要整数表达式 / [: -eq:需要一元表达... ......
installed command whether script server

模型转onnx遇到问题,报错 1. _thnn_fused_lstm_cell , 2._thnn_fused_gru_cell, 3. Exporting the operator numpy_T to ONNX opset version 11 is not supported.

目录GRULSTMExporting the operator numpy_T to ONNX opset version 11 is not supported RuntimeError: Exporting the operator _thnn_fused_lstm_cell to ONNX o ......

currently, chromedriver 114.0.5735.90 is recommended for chrome 114.*, so it is advised to delete the driver in PATH and retry

报错原因是驱动和浏览器不匹配 解决办法 1.下载低版本的谷歌浏览器 本次使用的是114 下载地址: https://downzen.com/en/windows/google-chrome/download/11405735199/ 2.下载谷歌浏览器的插件 https://registry.npm ......