哦?
追踪最近的用户名外显变动记录。
最近的文章、讨论、云剪贴板与社区记录
如果两个两个买,买奇数价偶数价之和最小的一定最优。 剩下的就只能买一个了,于是偶数价都没用了,问题变成:有一个商品 $c$,给定价格,价值是 $2$,可以买无限个;还有 $n$ 个商品 $a_i$,给定价格,价值是 $1$ ,每个只能买一个,求 $m$ 元钱最多买到多少价值的商品? 剩下的就是简单的贪心了。把所有 $a…
在讨论《大样例过水》回复:
hack ``` 3 10 5 10 6 10 7 10 ``` answer=1,但是不写那句是3
```cpp #include #define int long long using namespace std; int a[100005], b[100005], c[100005], sum[100005]; int n, m, ans; signed main() { cin >> n >> m; for (…
赛时想不出来正解,写了一个玄学复杂度的做法,最坏复杂度是$$O\left( {{n^3}} \right)$$的,然后第6、7、11~15个点用前缀和或者直接计算区间长度能优化到最坏$$O\left( {{n^2}} \right)$$。而1~7&11~15的点显然是不可能爆int的,于是我就手贱没开long long…
在讨论《求2025年csp-j/s第二轮pdf试题》回复:
@[Dark_Space](luogu://user/1129853) 谢谢 rp++
场上被T1硬控2h,看到此题直接暴力枚举全排列➕n方判断 结果在比赛用机上测n=10的数据,跑了1.18s,所以评测的时候会不会卡常啊,还想骗8pts呢,毕竟我可是老老实实写的没有瞎输出全排列啊
蒟蒻场切此题,写个题解纪念一下 一开始一直以为是神仙 dp 题,敲了两个点也没整明白,正打算暴搜骗 20 分的时候突然发现就是贪心。 考虑各个部门如果没有人数限制,那么所求的值就是每个人的最大满意度之和。一个重要的性质就是,加上人数限制之后如果仍然让每个人都选满意度最高的那个部门,最终也至多只有一个部门超限。 所以就有…
在讨论《求助一个很严峻的问题》回复:
@[1835202011qwe](luogu://user/927833) 那太好了,谢谢啦
考场上写了这么一个函数: ```cpp int maxm(int x, int y, int z) { if (x >= y && x >= z) return 1; if (y >= x && y >= z) return 2; if (z >= x && z >= y) return 3; } ``` 然后再考场环…
打的暴搜,但是WA on #26(就是hack数据),怀疑是check函数写错了,求大佬看看 ```cpp #include #include #include #include using namespace std; int t, n, is; int a[1000005], c[1000005], ch[1000…
在讨论《求CSP-J2023 T2大样例》回复:
@[lichenzhen](/user/703225) orz,感谢
在讨论《求CSP-J2023 T2大样例》回复:
附代码,肯定是哪里整错了,只过了2、3、4个点,剩余全wa,感觉这个代码应该过不了大样例的 ```cpp #include #include #include using namespace std; int lastx[100005], s[100005], n, d, flag, needs; struct nod…
开了`__int128`还是过不去 ```cpp #include using namespace std; #define int long long int exgcd(int a, int b, int &x, int &y) { if (b == 0) { x = 1; y = 0; return a; } i…
在讨论《吸氧8ms,无氧TLE,?》回复:
哦哦,感谢大佬们的解答
在讨论《吸氧8ms,无氧TLE,?》回复:
@[VastUniverse_Hory](/user/548059) 所以STL这么喜欢O2吗
RT ```cpp #include #include #include #include using namespace std; const int maxn = 5010; struct Edge { int to, next, w; } G[maxn * 2]; int head[maxn], cnt; voi…
RT ```cpp #include #include #include #include #include #include using namespace std; long t, n, p, q, f[1000005], m[3000005]; struct node { long a, b, e; } k[10…
在讨论《求助》回复:
@[Liking_Cpp_In_Luogu](/user/705620) 确实,明白了,谢
在讨论《树状数组35pts全WA》回复:
@[Rad_Forever](/user/538677) 知道了,感谢
```cpp #include #include #include #include #include #include using namespace std; int n, ans; int c[10000005]; struct node { int x, y; } a[10000005]; int lowbit…
在讨论《【灌水】顺序是不是弄反了》回复:
@[Ginger_he](/user/379058) 同感
在讨论《求助》回复:
@[Untitled_unrevised](/user/76508) 太感谢了
在讨论《【灌水】顺序是不是弄反了》回复:
@[JDS070115](/user/349725) 我说的是难度
在讨论《关于CE》回复:
@[清风雪月](/user/388857) 我的mac爆出来22个错。。