摘要: 常用板子 基本模板 #include<bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; template<class T1,class T2>T1 ksm(T1 a,T2 阅读全文
posted @ 2021-12-01 14:44 dreaming2019 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 提供string和所有数字类型的输入输出 其中输入方式每样提供两种 读入char[]可以使用 char s[100]; strcpy(s,reads().c_str()); 来解决 代码: inline string reads()//相当于cin { string s=""; char c=get 阅读全文
posted @ 2020-09-01 11:36 dreaming2019 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 手动O2比赛不能用,平时玩玩就好 #pragma GCC optimize (2) #pragma G++ optimize (2) 阅读全文
posted @ 2017-08-24 20:05 dreaming2019 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 作为一名OIer,比赛时,对拍是必须的 不对拍,有时可以悔恨终身 首先,对拍的程序 一个是要交的程序 另一个可以是暴力、搜索等,可以比较慢,但是必须正确 下面是C++版对拍程序(C++ & cmd) 注意:所有程序不用加文件输入输出 #include<cstdio> #include<cstdlib 阅读全文
posted @ 2017-07-11 19:48 dreaming2019 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 记录各种算法及数据结构板子 持续更新中... 算法 树链剖分 void init(long root) { cnt=0; dep[root]=0; } void dfs1(long now) { size[now]=1; son[now]=0; for(auto i:mp[now]) if(i!=f 阅读全文
posted @ 2020-06-08 20:40 dreaming2019 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 杭州电子科技大学计算机学院Debug杯程序设计竞赛 = 难得ak了,来写一波题解 (感觉会是很长的题解QAQ) 1001.字数补丁 题意 用若干"zsbd"来补全原串使得其大于等于指定长度 题解 暴力模拟,手速题 代码 1004.小C的翻转难题 题意 定义数列的魅力值为$\sum^{n 1}_{i= 阅读全文
posted @ 2020-04-19 19:41 dreaming2019 阅读(492) 评论(0) 推荐(0) 编辑
摘要: Codeforces Round 631 (Div. 2) Thanks, Denis aramis Shitov! = 自闭了,惨案现场,比赛写不出C,st后A掉了 A. Dreamoon and Ranking Collection 题意 给出一串$n$个数字,可以自行加入$m$个数字,问可以得 阅读全文
posted @ 2020-04-04 15:25 dreaming2019 阅读(165) 评论(0) 推荐(0) 编辑
摘要: Codeforces Round 627 (Div. 3) = 难道这会是我第一场能补完题的cf场?虽然是div3 A. Yet Another Tetris Problem 题意 给一个俄罗斯方块的残局,每次可以放一个高2宽1的块,问能否全部消除 题解 检测一下所有数的奇偶性,全部相同就可以消除 阅读全文
posted @ 2020-03-13 10:27 dreaming2019 阅读(204) 评论(0) 推荐(0) 编辑
摘要: Educational Codeforces Round 83 (Rated for Div. 2) = A. Two Regular Polygons 题意 给出一个正$n$边形,问能否使用这$n$个点重新构成正$m$边形 题解 正多边形转正多边形,直接判断点能不能均分就好了 代码 B. Bogo 阅读全文
posted @ 2020-03-10 21:20 dreaming2019 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Codeforces Round 626 (Div. 2, based on Moscow Open Olympiad in Informatics) = A. Even Subset Sum Problem 题意 给出一串数,找到其中的一些数使得他们的和为偶数 题解 水题,找到一个偶数或者两个奇数 阅读全文
posted @ 2020-03-08 09:31 dreaming2019 阅读(219) 评论(1) 推荐(0) 编辑
摘要: Codeforces Round #622 (Div. 2) A. Fast Food Restaurant 题意 有三种食物,每个客人每样最多拿一个,每个客人拿的组合不能相同,问最多能供应多少个客人 题解 每样最多拿一个,一共有7种取法:a,b,c,ab,ac,bc,abca,b,c,ab,ac, 阅读全文
posted @ 2020-02-24 11:25 dreaming2019 阅读(127) 评论(1) 推荐(0) 编辑
摘要: Codeforces Round #620 (Div. 2) A. Two Rabbits 题意 两只兔子相向而跳,一只一次跳距离a,另一只一次跳距离b,每次同时跳,问是否可能到同一位置 题解 每次跳相对距离减少Δ=(a+b)\Delta=(a+b)Δ=(a+b),如果总距离是Δ\DeltaΔ的倍数 阅读全文
posted @ 2020-02-16 11:59 dreaming2019 阅读(116) 评论(0) 推荐(0) 编辑