Always smile and dream.
追踪最近的用户名外显变动记录。
最近的文章、讨论、云剪贴板与社区记录
考虑部分分, 即 $1\le a[i][j]\le 2$ , 可以 $-1$ 转化为 $0\le a[i][j]\le 1$ 考虑 $0\le a[i][j]\le 1$ , 把 $a$ 数组的每一行看作一个二进制数, 此时两行取 $max$ 等于 $or$ , 取 $min$ 等于 $and$ , 可以使用 $bit…
## 蒟蒻的第一篇题解, 多多支持!!! 由于答案具有单调性, 可以二分答案. 考虑 $check$ 函数, 一个明显的性质是不能通过折扣活动买到(无折扣活动或零花钱不够)的物品放到最后买最优, 因为在不考虑折扣活动时越往后零钱越多. 同理推知, 对于每种物品, 由于在不考虑其他玩具时越往后零钱越多, 故在时间在 $m…
在讨论《如果你写的很对但是还是44pts》回复:
完了,我也眼瞎
求调 ```cpp #include using namespace std; int n, tmp; int main() { ios::sync_with_stdio(0); cin.tie(0), cout.tie(0); cin >> n; // n != 1,2,5 if (n == 1 || n == 2…
在讨论《代码复杂度分析》回复:
注:nxt是KMP里的最大自匹配长度
```cpp f[0] = 0, f[1] = 1; if (f[1] >= k) ans = (ans + 1) % mod; for (int i = 2; i = k) ans = (ans + 1) % mod; } ``` rt
在讨论《为什么数组开小了也会显示wa?》回复:
@[Naoxiaoyu](/user/1011279) 经我校rzc大佬研究表明,数组向后越界约1000个int左右编译器不会提示RE
```cpp #include #define p u / v using namespace std; int n, m, q, u, v, t, a[100010]; queue A, B, C; int main() { scanf("%d%d%d%d%d%d", &n, &m, &q, &u, &v, &t);…
在讨论《自己也不知道是什么写法的lca(得30pts)》回复:
谢谢 。
```c++ #include using namespace std; const int M = 500010; int n, m, s, fa[22][M], dep[M]; vector v[M]; void dfs(int x, int pre) { fa[0][x] = pre, dep[x] = dep[…
在讨论《求助一个小问题》回复:
@[AC_NOIP_AK_IOI](/user/932933) 当前最小值为0显然是初始状态,可以特判啊……
在讨论《求助一个小问题》回复:
@[AC_NOIP_AK_IOI](/user/932933) 这难道不是对于每次操作a[x]+=y以后直接和原最小值比较,如果比原最小值小,就更新最小值吗?
代码: ```C++ #include using namespace std; int n, pre[100010], Next[100010], m; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n; pre[0] =…
在讨论《找规律!》回复:
纯手画图,画到第5个已经很极限了
在讨论《找规律!》回复:
@[QAQ_](/user/206927) ……好多啊……太强了
在讨论《找规律!》回复:
@[OPTIM](/user/232067) 是什么是什么快告诉我
各位巨佬给看看,弱化版代码: ```cpp #include using namespace std; typedef long long ll; int n, p[1310], pos[1310],d[1310], tot; int main() { cin >> n; for (int i = 1; i i+1)…
在讨论《为什么洛谷月赛结束后换了道题……》回复:
@[xht](/user/100544) 感谢[xht](/user/100544)大佬
在讨论《(更新作弊名单)【LGR-144-Div.2】ZSHOI Round 1 赛后总结帖》回复:
为什么T2现在变加强版了……
诸位,有谁知道为什么昨天的月赛在比赛结束后(刚看到)第一题和第二题换了????????  第二题还变成了数据加强版……  问题解决,感谢巨佬
在讨论《为什么我的sort没有用》回复:
……
在讨论《为什么我的sort没有用》回复:
@[ダ月](/user/511271) 读入可以是负整数
```C++ #include using namespace std; typedef long long ll; const int M=1e5+5; int n; struct node{ int id; ll d; }a[M]; bool cmp(node a,node b){ return a.d<b.d;…