increasing decreasing 1864a and
Atcoder Regular Contest 154 E - Reverse and Inversion
只要你发现是诈骗题就好办了。不要像我那样傻傻地瞪一个小时然后才发现那俩 sigma 里的东西相减是有性质的。 先考虑计算单个 $f(p)$,一眼的树状数组……吗?考虑最终答案式子里 $i$ 的系数:$\sum\limits_{jp_i]-\sum\limits_{j>i}[p_jp_i]+\sum\ ......
CF1846E2 Rudolf and Snowflakes (hard version) 题解
### Statement $T$ 次给定整数 $n$,判断是否存在 $q, k \ge 2$ 使得 $1 + q + q^2 + \cdots + q^k = n$。 $1 \le T \le {10^4}$,$1 \le n \le {10}^{18}$。 ### Solution 考虑弱化问题 ......
Measuring and Narrowing the Compositionality Gap in Language Models
[TOC] > [Press O., Zhang M., Min S., Schmidt L., Smith N. A. and Lewis M. Measuring and narrowing the compositionality gap in language models. arXiv p ......
Classical Management: emphasized rationality and making organizations and workers as efficient as possible
Classical approach: First studies of management, which emphasized: * rationality * making organizations and workers as efficient as possible **Max Web ......
AT_arc101_d [ARC101F] Robots and Exits 题解--zhengjun
思路不错。 首先考虑把每个机器人转化为 $(a_i,b_i)$ 两个参数。 表示向左 $a_i$ 步会进入左边的出口,向右 $b_i$ 会进入右边的出口。 > 注:此时其他只能进入唯一的出口的机器人不影响答案,不考虑。 记 $c_i=0/1$ 表示 $i$ 号机器人是进入左边还是右边出口。 然后考虑 ......
CF1229F Mateusz and Escape Room
# CF1229F Mateusz and Escape Room 很好的题目。 对于此类在环上的问题,一个经典的思路是断环成链。我们先形式化的描述题意,即给 $i$ 向 $i + 1$ 定一个流量 $x_i$(可能为负)。限制则为 $$ \forall i, a_i + x_{i - 1} - x ......
DNA Assembly and Cloning | Gibson Assembly | Golden Gate Assembly
问题很简单,我有一段目标oligos(常见的就是gRNA,shRNA),如何最高效精准的克隆到我的目标质粒Plasmid里。 之前的CRISRP KO gRNA用的是Golden Gate Assembly NEBridge® Golden Gate Assembly Kit (BsmBI-v2) ......
格雷码 && CF1848F. Vika and Wiki 题解
## 格雷码 && CF1848F. Vika and Wiki 题解 本来有个GitHub上的Hexo博客的,但是我用起来不太熟练……先在博客园里写了后到时候转移过去吧。 ### 前置知识:格雷码(了解的读者可以跳过) 格雷码是所有k-bit(含k个二进制位)的数的一个排列,使得两个循环相邻(即两 ......
HDU Hide-And-Seek Game
# HDU Hide-And-Seek Game ## 题意 有 $n$ 个位置,给定 $k$,两人轮流操作。 1.选择长度小于等于 $k$ 的非空位置删除。 2.选择连续 $k$ 个非空位置删除,要求删除出后所在的连续段变为非空的个连续段。 无法操作者输,为谁必胜。 ## 题解 不是很会博弈论,但 ......
CF633G Yash And Trees
简单题。 先把树拍扁成序列,在 dfn 序上区间修改区间查询。 由于时限 4s,我们可以整点怪的,比如 `bitset`。 把区间内的数有/没有表示成 $01$ 序列,考虑到区间加取模相当于区间内的数全部**循环右移**,用 `bitset` 可以做到 $O(\frac m \omega)$。 然后 ......
AGC034F RNG and XOR
类似随机游走,令 $f_i$ 为第一次操作到 $i$ 的期望操作次数,$p_i$ 为每次操作数为 $i$ 个概率,显然有: $$f_i=\begin{cases}0&i=0\\1+\sum\limits_{j\;\text{xor}\; k\ =\ i}p_jf_k &i\neq 0\end{cas ......
CF1004F Sonya and Bitwise OR
考虑只有一次询问的时候怎么做。 显然的 cdq 分治,每次分治区间 $[l,r]$,统计跨过 $p=\lfloor\frac{l+r}{2}\rfloor$ 的区间的个数。可以枚举区间左端点,由于右端点右移时区间或单调非降,可以双指针维护。 充分发掘题目条件,由于是区间或,还有一个很套路的性质:一个 ......
CF98E Help Shrek and Donkey
第一次做这种非合作博弈均衡的题。 显然,当双方均有牌的情况下,先手是不可能直接指定桌牌的:正确的概率为 $\frac{1}{m+1}$,错误的概率为 $\frac{m}{m+1}$,显然 $\frac{m}{m+1}\ge\frac{1}{m+1}$。 于是先手指定桌牌的情况只能是 $n=0$ 或 ......
CF449D Jzzhu and Numbers
有一个很蠢但是很好写的做法。 就是你先令 $t_i$ 为与起来恰好为 $i$ 的方案数,然后 $g_i$ 为与起来子集中有 $i$ 的方案数。 然后 $g_S=\sum\limits_{T\subseteq S}t_T$,反演一下变成 $t_{S}=\sum\limits_{T\subseteq S ......
CF1770F Koxia and Sequence
#### 题意 给定非负整数 $n,x,y$,对于所有满足 $\sum\limits_{i=1}^{n}a_i=x$ 并且 $\text{OR}_{i=1}^{n}a_i=y$ 的 $\{a_n\}$,求 $\bigoplus\limits_{i=1}^{n}a_i$ 的异或和。 $n\le 2^{ ......
CF1083F The Fair Nut and Amusing Xor
#### 简要题意: 给你两个序列 $a,b$,一次操作可以将 $a$ 的某一个长度为 $k$ 的子区间全部异或上任意值,$f(a,b)$ 为使得 $a$ 和 $b$ 相同的最少的操作数量。 支持单点修改 $a,b$,并在开头和每次修改后输出 $f(a,b)$ 的值。 $n,k,q\le 2\tim ......
CF1361E James and the Chase
#### Description 给定一个有 $n$ 个点 $m$ 条边的**有向强连通图**。称一个点是**好的**当且仅当它到其他点都有且只有一条**简单路径**。如果好的点至少有 $20\%$ 则输出所有好的点,否则输出 `-1`。 $\sum n\leq 10^5,\sum m\leq 2\ ......
Your project does not reference ".NETFramework,Version=xxx" framework. Add a reference to ".NETFramework,..." property of your project file and then re-run NuGet restore.
错误:Your project does not reference ".NETFramework,Version=v4.6.1" framework. Add a reference to ".NETFramework,Version=v4.6.1" in the "TargetFramework ......
arcgis注册postgresql失败。postgres be sure the databse client software is installed and configured correct
解决: 将PostgreSQL\9.1\bin目录下的Libpq.dll,Libeay32.dll, Libintl-8.dll, Ssleay32.dll复制一份放在ArcGIS Server安装目录的Server\bin***意:这里拷贝的文件需要都是64位的。 重启arcgis server服 ......
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
###问题提示: ` NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and runn ......
Codeforces 1621H - Trains and Airplanes
这能 3500? 对于一组在 $u$ 上的询问,考虑每种线路 $x$,假设 $1\to u$ 路径上线路 $x$ 的长度为 $len$,那么不难发现收罚款的次数只有两种可能:$\lfloor\dfrac{len}{T}\rfloor$ 或者 $\lfloor\dfrac{len}{T}\rfloor ......
Perkins Engines: Reliable Power in Harsh Environments and High-Strength Operations
Perkins Engines: Reliable Power in Harsh Environments and High-Strength OperationsHello everyone! Today I would like to share with you a powerful engi ......
950. Reveal Cards In Increasing Order (Medium)
Description 950. Reveal Cards In Increasing Order (Medium) You are given an integer array deck. There is a deck of cards where every card has a unique ......
发布-订阅(Publish-and-Subscribe)模型
发布-订阅(Publish-and-Subscribe)模型是一种消息传递模式,用于在软件系统中实现异步通信和解耦。它基于发布者(发布消息的实体)和订阅者(接收和处理消息的实体)之间的解耦原则。 在发布-订阅模型中,发布者和订阅者之间不直接交互,而是通过一个称为消息代理或消息中间件的组件来进行通信。 ......
CF1842G Tenzing and Random Operations 思考
借鉴了一下 namelessgugugu 的想法,妙妙题。 [link](https://www.luogu.com.cn/blog/namelessgugugu/solution-cf1842g) 这个神奇工具的构造确实挺妙的,非常好的思维题,在此记录一下 ### 代码 ```cpp #inclu ......
cpp generate uuid via rand() and test speed which is 4 times+ faster than libuuid
// main.cpp #include <algorithm> #include <chrono> #include <cstdio> #include <cstdlib> #include <cstdint> #include <ctime> #include <fstream> #includ ......
Codeforces 1172F - Nauuo and Bug
是 Ynoi 捏。 建一棵线段树,线段树上每个节点维护一个长度为 $len$ 的 DP 数组 $f_i$ 表示 $v$ 最少需要多少才能使得从左往右将 $v$ 与区间中的数进行图中的相加操作后会减掉至少 $i$ 次 $p$。 如果我们能预处理出 $f_i$,那么查询是容易的,直接找到对应的区间然后 ......
Linux系统Apache添加监听端口后无法启动服务并报错:Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xeu httpd.service" for details.
导言:这是SE Linux安全机制导致的。 解决方法: 1.查看当前httpd端口 # semanage port -l|grep http 2.将对应端口加入SE Linux,以8068为例 # semanage port -a -t http_port_t -p tcp 8068 3.再次查看 ......
linux SSH client and terminal termius
介绍一款SSH终端神器,termius 优美的界面,高效的性能,免费版本足够我们使用。支持 mac , windows 双平台! 官网:https://www.termius.com/ 下载地址:https://termius.com/download/ 主界面: ![image](https:// ......