![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM训练
文章平均质量分 89
Bug_Programmer
人一能之,己百之;人十能之,己千之。果能此道矣,虽愚,必明;虽柔,必强。–《礼记》
展开
-
CodeForces - 998D - Roman Digits(打表 找规律)(本来应该是推公式的题吧)
题目链接:http://codeforces.com/problemset/problem/998/D题目:Let's introduce a number system which is based on a roman digits. There are digits I, V, X, L which correspond to the numbers 1, 5, 10 and 5...原创 2018-07-28 20:50:03 · 3157 阅读 · 0 评论 -
基础二分讲解
参考资料:算法竞赛进阶指南前言:(摘自算法竞赛进阶指南)二分法是一种随处可见,却非常精妙的算法,经常能为我们打开解决问题的突破口。二分的基础的用法是在单调序列或单调函数中进行查找。因此当问题的答案具有单调性时,就可以通过二分把求解转化为判定(根据复杂度理论,判定的难度小于求解),这使得二分的运用范围变得更广泛,进一步地,我们还可以扩展到通过三分法去解决单峰函数的极值以及相关问题。...原创 2019-02-14 16:20:49 · 500 阅读 · 0 评论 -
HDU - 6581 Vacation (三种方法) HDU多校第一场1004
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6581题目:Tom and Jerry are going on a vacation. They are now driving on a one-way road and several cars are in front of them. To be more specific, th...原创 2019-07-23 21:26:09 · 246 阅读 · 0 评论 -
The Preliminary Contest for ICPC Asia Nanjing 2019 南京网络赛 B题 super_log
题目链接:https://nanti.jisuanke.com/t/41299题目:In Complexity theory, some functions are nearlyO(1)O(1), but it is greater thenO(1)O(1). For example, the complexity of a typical disjoint set isO(nα...原创 2019-09-01 19:46:41 · 220 阅读 · 0 评论 -
The Preliminary Contest for ICPC Asia Nanjing 2019 南京网络赛 A题 The beautiful values of the palace
题目链接:点击前往题目:Here is a square matrix of n∗nn * nn∗n, each lattice has its value (nnn must be odd), and the center value is n∗nn * nn∗n. Its spiral decline along the center of the square matrix (the ...原创 2019-09-01 23:54:36 · 509 阅读 · 1 评论 -
[2018北京ICPC网络赛G] HihoCoder - 1834 The Mole 随机数据、分块、计算几何
题目链接:点击前往题目: 时间限制:3000ms 单点时限:3000ms 内存限制:256MB 描述Mr. Mole has built some tunnels in his little manor. For convenience, you can regard one tunnel as a segment on 2d plane. ...原创 2019-09-03 13:30:08 · 186 阅读 · 1 评论 -
The Preliminary Contest for ICPC Asia Nanjing 2019 南京网络赛 D题 Robots
题目链接:点击前往题目:Given a directed graph with no loops which starts at node 111 and ends at node nnn.There is a robot who starts at 111, and will go to one of adjacent nodes or stand still with equal pr...原创 2019-09-03 22:25:56 · 176 阅读 · 2 评论 -
[2018北京ICPC网络赛H] HihoCoder - 1835 K-Dimensional Foil II(点到平面的距离)
题目链接:点击前往题目: 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述"K-Dimensional Foil" is a dimensional weapon. Its function is quite easy: It can ascend a region in 3D space to K (K≥3) di...原创 2019-09-06 00:09:46 · 204 阅读 · 0 评论 -
2019 ICPC南昌网络赛 H题 The Nth Item 广义Fibonacci循环节 或 分块打表
题目链接:https://nanti.jisuanke.com/t/41355题目:原创 2019-09-10 19:48:42 · 147 阅读 · 0 评论 -
G Colorful String (The Preliminary Contest for ICPC Asia Xuzhou 2019 徐州网络赛)(双向链表优化Manacher 或 回文树)
题目链接:徐州网络赛G Colorful String题目:The value of a string sss is equal to the number of different letters which appear in this string. Your task is to calculate the total value of all the palindrome sub...原创 2019-09-11 13:37:05 · 243 阅读 · 0 评论 -
CodeForces - 750E New Year and Old Subsequence 线段树优化DP/线段树维护矩阵
题目链接:点击前往题目:A string t is called nice if a string “2017” occurs in t as a subsequence but a string “2016” doesn’t occur in t as a subsequence. For example, strings “203434107” and “9220617” are ni...原创 2019-09-12 16:52:08 · 179 阅读 · 0 评论 -
double向上取整 避免精度误差
题目HDU - 5035代码:#include <cstdio>#include <algorithm>using namespace std;const int MAXN = 100000 + 100;const double EPS = 1e-8;int a[MAXN], b[MAXN];int main() { int T, cas...原创 2019-09-16 20:52:22 · 476 阅读 · 0 评论 -
Gym - 101972I - Secret Project (组合数学 思维)
题目链接:https://cn.vjudge.net/contest/275218#problem/I题目:There are n students working on a secret project, this project is very important and unique, so they decided to keep it safe, and protect it...原创 2018-12-16 20:34:20 · 267 阅读 · 0 评论 -
Gym - 101972J - Even Numbers (二分或者找规律)
题目链接:http://codeforces.com/gym/101972/problem/J题目:Yousef loves playing with functions in his free time. Today, he invents the following function:Yousef will give you a list of queries, and y...原创 2018-12-16 20:23:18 · 458 阅读 · 0 评论 -
牛客网暑期ACM多校训练营(第三场)- E - Sort String (KMP next数组寻找字符串循环节)(和另一种方法)
题目链接:链接:https://www.nowcoder.com/acm/contest/141/E来源:牛客网题目:时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288KSpecial Judge, 64bit IO Format: %lld题目描述Eddy likes to play with string which i...原创 2018-07-28 21:34:58 · 3101 阅读 · 0 评论 -
CodeForces - 1008D - Pave the Parallelepiped (容斥原理+重复组合公式+状态压缩+思维)
题目链接:http://codeforces.com/problemset/problem/1008/D前置知识:1.容斥原理:(见百度百科)https://baike.baidu.com/item/%E5%AE%B9%E6%96%A5%E5%8E%9F%E7%90%86/10146840?fr=aladdin2.重复组合公式(刘汝佳—算法竞赛入门经典)有n个不同元素,每个...原创 2018-07-26 10:10:10 · 3395 阅读 · 1 评论 -
CodeForces - 1025B Weakened Common Divisor (思维 对GCD LCM及素因子的理解)
题目链接:http://codeforces.com/problemset/problem/1025/B题目:During the research on properties of the greatest common divisor (GCD) of a set of numbers, Ildar, a famous mathematician, introduced a bra...原创 2018-08-21 16:00:47 · 3116 阅读 · 1 评论 -
CodeForces - 1025C Plasticine zebra (思维)
题目链接:http://codeforces.com/problemset/problem/1025/C题目:Is there anything better than going to the zoo after a tiresome week at work? No wonder Grisha feels the same while spending the entire wee...原创 2018-08-21 16:13:49 · 3083 阅读 · 1 评论 -
线段树进阶总结(重要)(各种题型练习题和题号)
前言:线段树这种数据结构是真的灵活,可以说只要是满足区间合并的信息都可以用线段树来维护。线段树可以分为区间树(叶子节点是区间)和点树(叶子节点是点),很多时候我们用的其实都是点树,但是区间树也有很大的作用。个人感觉线段树的精髓就是区间信息的合并和区间标记的下推。线段树的内容很多,需要学的的东西也真的事很多,一定要灵活掌握这种思想不能死板~~一些题型和题号:(好多啊!!!)(感谢SYT学...原创 2018-08-21 16:43:07 · 5525 阅读 · 4 评论 -
裴蜀定理 例题 牛客 Wannafly挑战赛22 A 计数器
裴蜀定理:裴蜀定理(或贝祖定理,Bézout's identity)得名于法国数学家艾蒂安·裴蜀,说明了对任何整数a、b和它们的最大公约数d,关于未知数x和y的线性不定方程(称为裴蜀等式):若a,b是整数,且GCD(a,b)=d,那么对于任意的整数x,y,ax+by都一定是d的倍数,特别地,一定存在整数x,y,使ax+by=d成立。它的一个重要推论是:a,b互质的充要条件是存在整数x,y使...原创 2018-08-21 17:52:52 · 3182 阅读 · 0 评论 -
POJ - 2965 The Pilots Brothers' refrigerator (三种方法)(状压BFS 状压DFS 思维)
题目链接:http://poj.org/problem?id=2965题目:The game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a refrigerator.There are 16 handles on the refriger...原创 2018-08-29 10:39:05 · 4004 阅读 · 1 评论 -
HihoCoder - 1151 骨牌覆盖问题·二 (矩阵快速幂 或 公式(很难想0.0 附详细推导步骤))
题目链接:https://hihocoder.com/problemset/problem/1151题目:时间限制:10000ms单点时限:1000ms内存限制:256MB描述上一周我们研究了2xN的骨牌问题,这一周我们不妨加大一下难度,研究一下3xN的骨牌问题?所以我们的题目是:对于3xN的棋盘,使用1x2的骨牌去覆盖一共有多少种不同的覆盖方法呢?首先我们可以肯定...原创 2018-09-03 20:31:48 · 3221 阅读 · 2 评论 -
洛谷 P1337 [JSOI2004]平衡点 / 吊打XXX (非酋慎用的模拟退火.....惨)
题目链接:https://www.luogu.org/problemnew/show/P1337题目:题目描述如图:有n个重物,每个重物系在一条足够长的绳子上。每条绳子自上而下穿过桌面上的洞,然后系在一起。图中X处就是公共的绳结。假设绳子是完全弹性的(不会造成能量损失),桌子足够高(因而重物不会垂到地上),且忽略所有的摩擦。问绳结X最终平衡于何处。注意:桌面上的洞都比绳结X...原创 2018-09-18 20:18:59 · 2065 阅读 · 2 评论 -
POJ - 2155 Matrix (二维树状数组变形 思维)
题目链接:http://poj.org/problem?id=2155题目:Given an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the number in the i-th row and j-th column. Initially we have A[i, j] = 0 (1 <= i,...原创 2018-09-30 21:42:35 · 2172 阅读 · 0 评论 -
CodeForces - 320D Psychos in a Line (思维 单调栈)
题目链接:http://codeforces.com/problemset/problem/320/D题目:There are n psychos standing in a line. Each psycho is assigned a unique integer from 1 to n. At each step every psycho who has an id greate...原创 2018-12-10 12:10:56 · 262 阅读 · 0 评论 -
2019上海网络赛D Counting Sequences I (dfs暴力)
题目链接:点击前往题目:题目大意:有T(1≤T≤300)T(1\leq T \leq 300)T(1≤T≤300)组测试,每组给定n(2≤n≤3000)n (2\leq n \leq 3000)n(2≤n≤3000),询问满足∑i=1nai=∏i=1nai\sum_{i=1}^{n}a_i=\prod_{i=1}^{n}a_i∑i=1nai=∏i=1nai的长度为n的序列有多...原创 2019-09-17 18:32:50 · 261 阅读 · 0 评论