fedor game and new
Atcoder ARC058E Iroha and Haiku
题目中的式子转化一下即存在一位 $i$ 使得到 $i$ 时的后缀和存在 $X + Y + Z, Y + Z, Z$,再发现 $X + Y + Z\le 17$,考虑状压。 设 $f_{i, j}$ 为填了 $i$ 个数当前后缀和中存在的数的状态为 $j$(只存 $0\sim X + Y + Z$ 的 ......
Atcoder ARC058B Iroha and a Grid
考虑从第 $b$ 列与第 $b + 1$ 之间分开这个矩阵,钦定 $(i, b)$ 下一步必须走到 $(i, b + 1)$,可以发现这样是不会漏算或算重的。 于是就可以用乘法原理算出这个 $i$ 的贡献:$\binom{(i - 1) + (b - 1)}{i - 1}\times \binom{ ......
games101作业1
# games101 HomeWork 1 **说起来我自己写games101的作业也是曲曲折折,虚拟机很卡就拿VS配环境,Windows不会配环境,就装Linux,现在装上了Linux,却因为没有经验把Windows格式化了(我是真的沙比),好在还是开始做了,也挺顺利的,所以再来记录一下作业。** ......
CodeForces 1776C Library game
[洛谷传送门](https://www.luogu.com.cn/problem/CF1776C "洛谷传送门") [CF 传送门](https://codeforces.com/problemset/problem/1776/C "CF 传送门") orz p_b_p_b。 下文令 $a_i$ 为 ......
chinese game
# 0.0.0版本震撼来袭 代码: ```cpp #include #include #include using namespace std; int px=10,py=5,ma=0; string jie[100005]={"这是墙壁,你不能通过","这是地面,上面似乎布满了灰尘"}; stri ......
new的执行过程
## 构造函数本身就是个函数,也可以不记这个名字。重要的是`new`这其中的过程 ```JS function fn(name,age){ this.name = name this.age = age } ``` 1.new fn(),创建一个对象 ```JS const obj = new fn ......
[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 ......
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 ......
Linux中time命令输出的Real time, User time and Sys time
在运行的程序之前加 time 最后得出三个时间 real、 user、 sys, real是程序的实际运行时间,sys是内核态的时间,user是用户态的时间,单核情况,real远远大于user和sys之和。 real,从程序开始到程序执行结束时所消耗的时间,包括CPU的用时和所有延迟程序执行的因素的 ......
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 ......
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$ 号机器人是进入左边还是右边出口。 然后考虑 ......
new/delete/malloc/free
new/delete new和delete是C++中的运算符,不是库函数,不需要库的支持。 new的工作机理 string *sp=new string("a value");//一个new表达式 new表达式调用一个operator new(或者operator new[])的标准库函数,该函数分 ......
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个二进制位)的数的一个排列,使得两个循环相邻(即两 ......
[LeetCode] 2297. Jump Game VIII
You are given a 0-indexed integer array nums of length n. You are initially standing at index 0. You can jump from index i to index j where i < j if: ......
HDU Hide-And-Seek Game
# HDU Hide-And-Seek Game ## 题意 有 $n$ 个位置,给定 $k$,两人轮流操作。 1.选择长度小于等于 $k$ 的非空位置删除。 2.选择连续 $k$ 个非空位置删除,要求删除出后所在的连续段变为非空的个连续段。 无法操作者输,为谁必胜。 ## 题解 不是很会博弈论,但 ......
最能超的mATX主板 内存冲上8000MHz!技嘉魔鹰B760M GAMING AC评测
一、前言:技嘉推出魔鹰B760M主板 支持DDR5-8000高频内存 现如今,DDR5内存已经全面普及开来,价格平民化,容量、频率、延迟等规格越发成熟。 但在以往,想要发挥出内存的最佳性能,第一选择是高端的Intel Z系列或者AMD X系列主板,毕竟用料更足、规格更全,但代价也很明显,就是价格更高 ......
CF633G Yash And Trees
简单题。 先把树拍扁成序列,在 dfn 序上区间修改区间查询。 由于时限 4s,我们可以整点怪的,比如 `bitset`。 把区间内的数有/没有表示成 $01$ 序列,考虑到区间加取模相当于区间内的数全部**循环右移**,用 `bitset` 可以做到 $O(\frac m \omega)$。 然后 ......
CF730I Olympiad in Programming and Sports
想复杂了…… 这种分到两边的问题,考虑建立费用流模型,建立两个点 $A,B$ 表示分到 $A$ 的数或者分到 $B$ 的数: - $S\to A$,流量 $p$,费用 $0$。 - $S\to B$,流量 $s$,费用 $0$。 - $A\to i\in[1,n]$,流量 $1$,费用 $a_i$。 ......
CF755G PolandBall and Many Other Balls
列出转移方程就是傻鸟题了,具体地,令 $f_{i,j}$ 为前 $i$ 球取出 $j$ 组的方案数,有: $$f_{i,j}=f_{i-1,j-1}+f_{i-1,j}+f_{i-2,j-1}$$ 列出 $f_{i}$ 的 GF $F_i(x)$: $$F_i(x)=F_{i-1}(1+x)+F_{ ......
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 ......