摘要:
哎呦喂!!看错题目啦!!还以为要用最短路, 就写了个dijkstra,呜呜呜,我就说怎么不对, 呜呜呜QAQ!!! #include<bits/stdc++.h>using namespace std; const int N = 1e4 + 7; int f[N];struct Edge{ int 阅读全文
posted @ 2022-10-30 22:24
feuerwerk
阅读(19)
评论(0)
推荐(0)
摘要:
最小生成树的板子; 使得连通块的数量减小到k即可! 数据有点水(printf("No Answer");根本没用到QAQ)。 #include<bits/stdc++.h>using namespace std;const int N = 1e3 + 7;const int M = 1e4 + 7; 阅读全文
posted @ 2022-10-30 15:04
feuerwerk
阅读(28)
评论(0)
推荐(0)
摘要:
#include<bits/stdc++.h>using namespace std;const int N = 1e5 + 7;struct Node{ int bn, ed, t;}a[N];int f[N];int find(int x){ return x == f[x] ? x : f[x 阅读全文
posted @ 2022-10-30 14:01
feuerwerk
阅读(20)
评论(0)
推荐(0)
摘要:
区间查询加单点修改 这个题目写了很久,然后写了一遍后是错的,但是我感觉我的逻辑是没有问题的; 后来又写了一遍,发现还是错了;就放在那儿了; 今天写的时候,终于把错误找出来了: change_tree中的return条件有问题(l == p); 是错的,应改为:(l == r)!!! #include 阅读全文
posted @ 2022-10-30 10:37
feuerwerk
阅读(11)
评论(0)
推荐(0)

浙公网安备 33010602011771号