摘要: ···cpp include typedef std::vector Vec; const int Mo = 998244353; inline void add(int &x, int y) { (x += y) = Mo && (x = Mo); } inline void dec(int &x 阅读全文
posted @ 2019-07-25 15:38 Trimsteanima 阅读(118) 评论(0) 推荐(0) 编辑
摘要: Python 环境安装 访问https://www.python.org/downloads/ 安装 使用交互式界面,在开始菜单打开Python3 IDLE即可,您可以开始以下的教程代码。 您也可以新建一个 的文件,写上Python脚本,然后在命令行中输入 运行。您还可以用IDLE打开这个文件,按F 阅读全文
posted @ 2019-07-11 20:49 Trimsteanima 阅读(231) 评论(1) 推荐(0) 编辑
摘要: 祭学会fhq treap 下次有需要再补上 先存个模板 cpp // luogu judger enable o2 include using namespace std; const int N = 1e6 + 10; int root, n, a, x, y, z, op, Size, siz[ 阅读全文
posted @ 2019-07-11 18:01 Trimsteanima 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 核心代码 Ploblem A Huffman Coding on Segment Alice wants to send an important message to Bob. Message $a=(a_1,...,a_n)$ is a sequence of positive integers 阅读全文
posted @ 2019-06-22 20:22 Trimsteanima 阅读(1150) 评论(0) 推荐(0) 编辑
摘要: ```cpp #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #in... 阅读全文
posted @ 2019-06-21 19:09 Trimsteanima 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 一看就是DP题~~(很水的一道紫题)~~ 设$dp[i][j][k]$为留下$i$个$r$族的人,死去$j$个$s$族的人,死去$k$个$p$族的人的概率(跟其他的题解有点差别,但本质相同)。 cpp include using namespace std; double dp[101][101][ 阅读全文
posted @ 2019-05-04 09:54 Trimsteanima 阅读(140) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.org/blog/IowaBattleship/latex gong shi tai quan 阅读全文
posted @ 2019-04-30 11:36 Trimsteanima 阅读(490) 评论(0) 推荐(0) 编辑
摘要: " CF 441E " Description 一共执行$k$次,每次有$p\%$把$x 2$,有$(100 p)\%$把$x + 1$。问二进制下$x$末尾期望$0$的个数。 Solution 设$f[i][j]$为执行第$i$次后$x + j$末尾期望$0$的个数 加一:$f[i + 1][j 阅读全文
posted @ 2019-04-28 08:16 Trimsteanima 阅读(222) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2019-04-22 08:40 Trimsteanima 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 题意 $n$座山组成一个环,相连的圆弧上其他山它们高那么这两座山能互相看到,求能看到的山的组数。 题解 设$left[i]$表示左边第一个比$i$高的位置,同理$right[i]$表示右边第一个比i高的位置。$count[i]$表示i到$right[i]$区间($i$不在区间内,$right[i]$ 阅读全文
posted @ 2019-04-18 15:33 Trimsteanima 阅读(145) 评论(0) 推荐(0) 编辑
Live2D