摘要: 2022牛客暑期多校训练营1 传送门 难度分布 check-in: G easy A D medium-easy C I medium J mediun-hard H hard B E F very-hard K G 给定一个数字$n$,输出$1$~$n$所有数中字典序最大的一个。 显然常规情况下字 阅读全文
posted @ 2022-07-20 16:44 wzyyy 阅读(119) 评论(0) 推荐(1)
摘要: 2021CCPC网络赛I Public Transport System 题目链接 题目中每条边边权上存在两个值,考虑将其变成一个值后进行单源最短路算法。 不难看出,一条边的边权有取决于上条边的边权,可以想到将所有可能出现的边权与上条边权情况全部表达出来。那么对于一个入度为$u$,出度为$v$的点, 阅读全文
posted @ 2022-07-14 17:50 wzyyy 阅读(78) 评论(0) 推荐(0)
摘要: 2022ICPC昆明F 题目链接 不难看出最终答案为$(sum/num)^2/4$。问题转化为在树上找到一条简单路径,使得路径点权和除以点数绝对值最大。 考虑二分,二分出平均值并在树上$dp$处理。在此清华大学赛时代码使用了预处理树后续遍历的方式解决了此题,不仅避免了树形$dp$搜索途中的$for$ 阅读全文
posted @ 2022-04-17 20:54 wzyyy 阅读(95) 评论(0) 推荐(0)
摘要: task5 Person.hpp #ifndef Person_hpp #define Person_hpp #include <iostream> #include <ostream> #include <cmath> #include <cstring> using namespace std; 阅读全文
posted @ 2021-12-15 11:08 wzyyy 阅读(53) 评论(3) 推荐(0)
摘要: 题目大意 ​ 给定你$14$张牌,判断是否已经胡牌,如果没有,依次输出打出哪些牌后听哪些牌。 题目分析 ​ 感觉我并没有说清如何胡牌,可以看看这个新手打麻将,胡牌规则太难了?直接套用胡牌公式就行了 - 知乎 (zhihu.com) ​ 题意可以说是简单而暴力......难点就在于如何判断胡牌。胡牌实 阅读全文
posted @ 2021-12-06 16:49 wzyyy 阅读(59) 评论(0) 推荐(0)
摘要: 任务三 task2.cpp #include <iostream> #include <typeinfo> // definitation of Graph class Graph { public: void draw() { std::cout << "Graph::draw() : just 阅读全文
posted @ 2021-11-29 16:10 wzyyy 阅读(41) 评论(3) 推荐(0)
摘要: vector_int.hpp #ifndef vector_int_hpp #define vector_int_hpp #include <cstdio> #include <iostream> using namespace std; class Vector_int { private: in 阅读全文
posted @ 2021-11-10 20:19 wzyyy 阅读(54) 评论(2) 推荐(0)
摘要: ###info.hpp #ifndef info_hpp #define info_hpp #include<iostream> #include<vector> #include<iomanip> using namespace std; class info { private: string 阅读全文
posted @ 2021-10-30 18:58 wzyyy 阅读(55) 评论(3) 推荐(0)
摘要: 实验结论 实验任务3 Complex.hpp源码 #ifndef Complex_hpp #define Complex_hpp #include <iostream> #include <cmath> using namespace std; class Complex { public: Com 阅读全文
posted @ 2021-10-20 16:12 wzyyy 阅读(110) 评论(4) 推荐(0)
摘要: 传送门 A ​ 口水题,在保证所有数互不相同的前提下显然排序可以让和同样互不相同。 B 题目大意 ​ 给定一个括号序列,每次操作我们可以从中选出一个长度为$2x$的子序列,满足前$x$个为左括号,后$x$个括号为右括号;求最小操作次数并输出操作内容。 题目分析 ​ 在删除时只需要考虑括号的位置,而且 阅读全文
posted @ 2021-09-09 20:10 wzyyy 阅读(51) 评论(0) 推荐(0)