【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(2)
比赛链接本文发布于博客园,会跟随补题进度实时更新,若您在其他平台阅读到此文,请前往博客园获取更好的阅读体验。
跳转链接:https://www.cnblogs.com/TianTianChaoFangDe/p/18773190
开题 + 补题情况
除了 AK 题都补完了,还是学到了很多东西,以及很多平时比赛注意不到的点。
总结
这场太唐了,四个签到题做得依托答辩,罚时控制得一点也不好,之后还是应该三思后再交题,没想清楚前不要写代码,不然堆shi!
然后是补的题吧,这场题目质量挺高的(除了某个测评机问题,屮!)。
1006 属于是见识少了,很经典的博弈手法。
1001 可以迁移线性基的思想,按位考虑,位运算的题都尽可能地考虑按位考虑。
1007 DP 好题了属于是,DP 很重要的就是如何找出一个无后效性的状态,这个题就是一个很好的典范,通过扩展状态来避免乘法的后结合而导致难以维护,这题还用了自动机的想法来减少计算次数。
1008 又是对问题的转化没转化好,这个只要转化出每个点只和三个刷子的顺序就很容易想到拓扑了。
1010 很好的数据结构题,顺便复习了一下离散数学函数的相关知识,同时也体现出线段树的一个重要特点,那就是满足结合律,以及使用了前缀和来优化复杂度,通过自己定义逆运算来达成使用前缀和进行区间查询。
1002 - 学历史导致的
签到题,由于数据范围只有几十,所以直接枚举暴搜就行。
点击查看代码#include #define inf 2e18#define int long longconst int N = 2e5 + 9;std::string a[] = {"jia", "yi", "bing", "ding", "wu", "ji", "geng", "xin", "ren", "gui"};std::string b[] = {"zi", "chou", "yin", "mao", "chen", "si", "wu", "wei", "shen", "you", "xu", "hai"};void solve(){ std::string s;std::cin >> s; for(int i = 1984;i > k; int x; if(k.size() > 2) { x = 100; } else { x = toint(k); } std::string tmp = s; for(int i = 1;i < x;i ++) { s += tmp; } std::vector dp(27, 0); auto getint = [](const char c) -> int { return c - 'a' + 1; }; int ans = 0; for(auto &i : s) { int ix = getint(i); for(int j = 0;j < ix;j ++) { dp = std::max(dp, dp + 1); } ans = std::max(ans, dp); } std::coutn; std::vector a(n); for(auto &i : a) { std::cin >> i; } std::vector cnt(N + 9, 0), all(N + 9, 0); std::vector vis(N + 9, 0); for(int i = 0;i < n;i ++) { cnt] ++; } int ans = 0; int sum = 0; vis = true; for(int i = n - 1;i >= 0;i --) { if(a == 0) { cnt] --; continue; } if(!cnt)break; int ix; for(int j = i;j >= 0 && a != 0;j --) { cnt] --; ix = j; } for(int j = i;j >= 0 && a != 0;j --) { if(a && cnt]) { all] = std::max(all], sum); } sum += !vis]; vis] = true; } i = ix; } for(int i = 1;i > k; int ans = 0; if(k & 1) { std::couty >> z; if((x + 2 * y) % 4 == 0) { std::coutn >> m; std::vector in(n * 3 + 1, 0); std::vector g(n * 3 + 1); bool dk = true; for(int i = 1;i > x >> y >> c; int p = (y - 1) / 2 + 1, q = 2 * n - x + 1, r = 2 * n + x - y / 2; if(!dk)continue; if(c != p && c != q && c != r) { dk = false; continue; } if(c == p) { g.push_back(c); g.push_back(c); } else if(c == q) { g.push_back(c); g.push_back(c); } else { g.push_back(c); g.push_back(c); } in += 2; } if(!dk) { std::coutbool { std::queue q; for(int i = 1;im >> k; std::vector a(n + 1, std::vector(m + 1)); for(int i = 1;ia; } } std::vector dp( n + 1, std::vector( m + 1, std::array{})); auto getdigit = [&](int x, int y, int z) -> int { return (x * k + y) * k + z; }; int mx = k * k * k; for(int i = 0;i < k;i ++) { for(int j = 0;j < k;j ++) { for(int p = 0;p < k;p ++) { for(char q = '0';q
页:
[1]