摘要: 原题链接 题解 1.设 \(f(i)\) 为 \([0,i]\) 区间内该有多少个数属于整数集 \(Z\) 则对于每一对输入的 \(x,y,c\) 都有 \(f[y]-f[x-1]>=c\) 而且 \(0<=f[i]-f[i-1]<=1\) 差分约束由此得来 又因为下标从零开始,而且我们需要建立超级 阅读全文
posted @ 2024-04-08 16:24 纯粹的 阅读(45) 评论(2) 推荐(1)
摘要: 原题链接 题解 本质上是做题,所以观察题目数据,很小,直接暴力遍历所有点走单源最短路 code #include<bits/stdc++.h> using namespace std; struct node { int x,val; bool operator<(const node&b) con 阅读全文
posted @ 2024-04-08 14:44 纯粹的 阅读(25) 评论(0) 推荐(0)
摘要: 原题链接 题解 令 \(f(x)\) 代表所有课的发布时间都小于等于x时的不愉快值之和,x越小,AB消耗越大,x越大,C消耗越大,所以感性的想象 \(f(x)\) 是一个下凹函数 然后就可以快乐三分了 code #define ll unsigned long long #include<bits/ 阅读全文
posted @ 2024-04-08 13:48 纯粹的 阅读(28) 评论(0) 推荐(0)