11 2020 档案

摘要:#include<iostream> #include<algorithm> #include<cstring> using namespace std; /* dijkstra O(n^2+m) +O(n) 求出S->D的所有最短路,统计数目,统计权值和 输出最短路数目和最大权值和即可 两种写法, 阅读全文
posted @ 2020-11-27 22:34 30天CF上蓝!!! 阅读(82) 评论(0) 推荐(0)
摘要:###拉链法 ###字符串前缀hash $ s="ABCDDDC"\ P=131 (or) 13331,M=2^(64)\ c++中unsigned int 溢出相当于自动对2^(64)取模\ h[0]=0;\ h[1]="A"的hash值\ h[2]="AB"的hash值\ h[3]="ABC"的 阅读全文
posted @ 2020-11-24 22:23 30天CF上蓝!!! 阅读(200) 评论(0) 推荐(0)
摘要:###map,Hash表,unordered_map更优 int n; map<int,int>Hash; int query(int x) { if(Hash.count(x)==0) Hash[x]=++n; return Hash[x]; } int main() { for(int i=0; 阅读全文
posted @ 2020-11-24 20:25 30天CF上蓝!!! 阅读(82) 评论(0) 推荐(0)
摘要:CodeForces - 1354B A - Ternary String $ 法一:dp\ 线性dp的思路,找到距离每个位置最近a..b..c的序列的长度,取最小值,如果有元素没有出现过输出0 $ #include<iostream> #include<cstring> using namespa 阅读全文
posted @ 2020-11-20 20:08 30天CF上蓝!!! 阅读(110) 评论(0) 推荐(0)
摘要:##1.Technocup 2021 - Elimination Round 1 A New Technique #include<iostream> #include<algorithm> #include<cstring> #include<vector> using namespace std 阅读全文
posted @ 2020-11-17 21:36 30天CF上蓝!!! 阅读(361) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2020-11-01 20:26 30天CF上蓝!!! 阅读(110) 评论(0) 推荐(0)
摘要:比赛链接:https://codeforces.com/contest/1436 ##A.Reorder ##题解 经过模拟计算,观察到 \(\sum_{i=1}^n \sum_{j=i}^n \frac{a_j}{j}=\sum_{i=1}^n a_i\) 判断每个n个数的和sum与m是否相等即可 阅读全文
posted @ 2020-11-01 17:26 30天CF上蓝!!! 阅读(133) 评论(0) 推荐(0)