当前位置:网站首页>第十一周ACM训练报告
第十一周ACM训练报告
2022-07-21 05:15:00 【Eloi0424】
个人博客:Eloi-还在前进.
目录
21.12.13 Monday
21.12.14 Tuesday
21.12.15 Wednesday
21.12.16 Thursday
- Codeforces Round #761 (Div. 2)
- C. Paprika and Permutation
—简单的贪心—
题意:给你一个数列要你通过mod x 操作将其变为n的全排列
我们可以考虑贪心算法
1-n的数就不要动它了,当然如果有重复的也入优先队列
剩下的入优先队列
分析易知:越大的数肯定比越小的数更好转化,具有线性关系
所以之后就判断从1-n中不存在的数能否由队列里的top转化即可
- C. Paprika and Permutation
21.12.17 Friday
- Educational Codeforces Round 119 (Rated for Div. 2)(VP)
- E. Replace the Numbers:
题意:q 组操作,有两种 1.向数组末尾压入一个数x
2.将数组中的x 全部变为y
思路:由于操作2具有无后效性,我们可以逆向思维,反着处理
询问操作二就变成了——“之后要压入x时我压入y”
可以设计一个flag数组标记对应的——要压入x时我压入谁
一开始都是压入自己
注意这里操作二是:flag[Q[i].a]=flag[Q[i].b];
而不是:flag[Q[i].a]=Q[i].b;
避免比如我要压入4,但之前规定了要压入4时我压入3
但之前的之前又规定了要压入3时我压入2
- E. Replace the Numbers:
21.12.18 Saturday
- Codeforces Round #581 (Div. 2)
- C. Anna, Svyatoslav and Maps
----全源最短路 floyed算法-----
题意:给你一个有向图,一个路径序列,
让你找出一个节点序列,
它的最短路径序列就是上述路径序列
思路:对给定路径序列中,第二到第m-1各个节点判断
其是否不可替代
1.当判断该点之前的第一个不可替代点
到判断点下一个点的最短路径就是该路径时可替代
2.当判断该点之前的第一个不可替代点
到判断点下一个点的最短路径不是该路径时不可替代
可替代的删去
输出结果即可
- C. Anna, Svyatoslav and Maps
21.12.19 Sunday
边栏推荐
- Using UUID as MySQL primary key, my boss broke up
- What is the difference between embedded hardware and software in embedded development?
- In depth analysis of ArrayList source code, from the most basic capacity expansion principle, to the magic iterator and fast fail mechanism, you have everything you want!!!
- 016:简单计算器
- XML详解
- Super detailed dry goods: appium+pytest realizes app concurrent testing
- 01背包面试题系列(一)
- Online JVM memory problem location
- Further learning of 02 selenium (control browser window +)
- This Bluetooth chip giant aims at the WiFi SOC market and launches a low-power WiFi MCU product line
猜你喜欢
Yolov4 (Darknet version) post processing: display confidence and save the contents of the detection box locally
01-自动化测试基础--(selenium八股文部分+环境配置+八大定位)
归并排序
Let you know the current situation and future development trend of wireless charging technology
流批一体?实时数据处理场景化应用实例~
62. 不同路径
快速排序
Heap - principle to application - heap sorting, priority queue
第三周ACM训练报告
437. 路径总和 III
随机推荐
Do you think sub database and sub table are really suitable for your system? Talk about how to select sub databases, sub tables and newsql
概率论-方差和协方差、相关系数
西瓜书第三章-线性模型
Using two templates (recursive method and iterative method) to complete four traversal ways of binary tree
线性回归大结局(岭(Ridge)、 Lasso回归原理、公式推导),你想要的这里都有
组合学总结
62. 不同路径
Chat about matter protocol (original chip protocol)
Characteristics and differences between PCB and integrated circuit
205. 同构字符串
02-selenium的进一步学习(控制浏览器窗口+)
Automated test model of 03 selenium
Why is Le Xin in a hurry to release esp32-c3 when there are few words
What are the functions and application industries of testing equipment development?
地产巨头,数据一体化建设项目方案(拿走不谢)
堆-原理到應用——堆排序、優先級隊列
543. 二叉树的直径
堪比“神仙打架”的开源数据可视化社群,你见过吗?
Pytorch2onnx2Tensorflow的环境准备win10
Open source data visualization tool datart new user experience tutorial for popular communities