struct typedef and

[ABC310G] Takahashi And Pass-The-Ball Game

Problem StatementThere are $N$ Takahashi. The $i$-th Takahashi has an integer $A_i$ and $B_i$ balls. An integer $x$ between $1$ and $K$, inclusive, wi ......
Pass-The-Ball Takahashi 310G Pass Ball

Ice and Fire

Ice and Fire time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Little09 and his friends are ......
Fire Ice and

Linux中time命令输出的Real time, User time and Sys time

在运行的程序之前加 time 最后得出三个时间 real、 user、 sys, real是程序的实际运行时间,sys是内核态的时间,user是用户态的时间,单核情况,real远远大于user和sys之和。 real,从程序开始到程序执行结束时所消耗的时间,包括CPU的用时和所有延迟程序执行的因素的 ......
time 命令 Linux Real User

pip install flask 时,总包blinker uninstall 失败(ERROR: Cannot uninstall 'blinker'. It is a distutils installed project and thus we cannot ...)

今天用pip install flask时,总因为uninstall blinker失败,报错如下: ``` ERROR: Cannot uninstall 'blinker'. It is a distutils installed project and thus we cannot accur ......
uninstall 总包 blinker distutils installed

Atcoder Regular Contest 154 E - Reverse and Inversion

只要你发现是诈骗题就好办了。不要像我那样傻傻地瞪一个小时然后才发现那俩 sigma 里的东西相减是有性质的。 先考虑计算单个 $f(p)$,一眼的树状数组……吗?考虑最终答案式子里 $i$ 的系数:$\sum\limits_{jp_i]-\sum\limits_{j>i}[p_jp_i]+\sum\ ......
Inversion Atcoder Regular Contest Reverse

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 考虑弱化问题 ......
题解 Snowflakes version Rudolf 1846E

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$ 号机器人是进入左边还是右边出口。 然后考虑 ......
题解 101 zhengjun AT_arc Robots

结构体定义 typedef struct 用法详解和用法小结

typedef是类型定义的意思。typedef struct 是为了使用这个结构体方便。 具体区别在于: 若struct node {}这样来定义结构体的话。在申请node 的变量时,需要这样写,struct node n; 若用typedef,可以这样写,typedef struct node{} ......
小结 typedef 结构 struct

实例讲解c语言结构体大小 sizeof(struct A)

约定为32位系统,即char 1字节、short 2字节、int 4字节 该问题总结为两条规律: 1,每个结构体成员的起始地址为该成员大小的整数倍,即int型成员的其实地址只能为0、4、8等 2,结构体的大小为其中最大成员大小的整数倍 #include <stdio.h>#include <stdl ......
实例 大小 语言 结构 sizeof

CF1229F Mateusz and Escape Room

# CF1229F Mateusz and Escape Room 很好的题目。 对于此类在环上的问题,一个经典的思路是断环成链。我们先形式化的描述题意,即给 $i$ 向 $i + 1$ 定一个流量 $x_i$(可能为负)。限制则为 $$ \forall i, a_i + x_{i - 1} - x ......
Mateusz Escape 1229F 1229 Room

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) ......
Assembly Cloning Gibson Golden Gate

格雷码 && CF1848F. Vika and Wiki 题解

## 格雷码 && CF1848F. Vika and Wiki 题解 本来有个GitHub上的Hexo博客的,但是我用起来不太熟练……先在博客园里写了后到时候转移过去吧。 ### 前置知识:格雷码(了解的读者可以跳过) 格雷码是所有k-bit(含k个二进制位)的数的一个排列,使得两个循环相邻(即两 ......
格雷码 题解 amp 1848 Vika

HDU Hide-And-Seek Game

# HDU Hide-And-Seek Game ## 题意 有 $n$ 个位置,给定 $k$,两人轮流操作。 1.选择长度小于等于 $k$ 的非空位置删除。 2.选择连续 $k$ 个非空位置删除,要求删除出后所在的连续段变为非空的个连续段。 无法操作者输,为谁必胜。 ## 题解 不是很会博弈论,但 ......
Hide-And-Seek Game Hide Seek HDU

CF633G Yash And Trees

简单题。 先把树拍扁成序列,在 dfn 序上区间修改区间查询。 由于时限 4s,我们可以整点怪的,比如 `bitset`。 把区间内的数有/没有表示成 $01$ 序列,考虑到区间加取模相当于区间内的数全部**循环右移**,用 `bitset` 可以做到 $O(\frac m \omega)$。 然后 ......
Trees 633G Yash 633 And

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 ......
034F AGC 034 RNG and

CF1004F Sonya and Bitwise OR

考虑只有一次询问的时候怎么做。 显然的 cdq 分治,每次分治区间 $[l,r]$,统计跨过 $p=\lfloor\frac{l+r}{2}\rfloor$ 的区间的个数。可以枚举区间左端点,由于右端点右移时区间或单调非降,可以双指针维护。 充分发掘题目条件,由于是区间或,还有一个很套路的性质:一个 ......
Bitwise 1004F Sonya 1004 and

CF98E Help Shrek and Donkey

第一次做这种非合作博弈均衡的题。 显然,当双方均有牌的情况下,先手是不可能直接指定桌牌的:正确的概率为 $\frac{1}{m+1}$,错误的概率为 $\frac{m}{m+1}$,显然 $\frac{m}{m+1}\ge\frac{1}{m+1}$。 于是先手指定桌牌的情况只能是 $n=0$ 或 ......
Donkey Shrek Help 98E and

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 ......
Numbers Jzzhu 449D 449 and

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^{ ......
Sequence 1770F Koxia 1770 and

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 ......
Amusing 1083F 1083 Fair The

CF1361E James and the Chase

#### Description 给定一个有 $n$ 个点 $m$ 条边的**有向强连通图**。称一个点是**好的**当且仅当它到其他点都有且只有一条**简单路径**。如果好的点至少有 $20\%$ 则输出所有好的点,否则输出 `-1`。 $\sum n\leq 10^5,\sum m\leq 2\ ......
1361E James Chase 1361 and

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 ......
Codeforces Airplanes Trains 1621H 1621

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 ......

发布-订阅(Publish-and-Subscribe)模型

发布-订阅(Publish-and-Subscribe)模型是一种消息传递模式,用于在软件系统中实现异步通信和解耦。它基于发布者(发布消息的实体)和订阅者(接收和处理消息的实体)之间的解耦原则。 在发布-订阅模型中,发布者和订阅者之间不直接交互,而是通过一个称为消息代理或消息中间件的组件来进行通信。 ......

CF1842G Tenzing and Random Operations 思考

借鉴了一下 namelessgugugu 的想法,妙妙题。 [link](https://www.luogu.com.cn/blog/namelessgugugu/solution-cf1842g) 这个神奇工具的构造确实挺妙的,非常好的思维题,在此记录一下 ### 代码 ```cpp #inclu ......
Operations Tenzing Random 1842G 1842