摘要: 思想: 将其字符式的读入 + 位运算加速; 注意 x=0;在搞 数字时 每一个那个啥 要 () template<class T>void read(T &x) { x=0;int f=0;char ch=getchar(); while(ch<'0'||ch>'9') {f|=(ch=='-'); 阅读全文
posted @ 2021-11-27 21:19 VxiaohuanV 阅读(20) 评论(0) 推荐(0)
摘要: 思想:并查集 注意:有2个地方要用到 并查集 不然会时间超时; 代码:(可能有错误) #include <bits/stdc++.h> using namespace std; #define ri register int #define M 2000005 ///// attention M i 阅读全文
posted @ 2021-11-27 20:36 VxiaohuanV 阅读(64) 评论(0) 推荐(0)
摘要: 思想: 模拟+枚举 以T为单位的枚举一定会超时; 若以m为单位 比较复杂 以 n 为单位 且为外侧循环, 以它的订单为内层循环(sort一下) #include <bits/stdc++.h> using namespace std; #define ri register int #define 阅读全文
posted @ 2021-11-27 18:56 VxiaohuanV 阅读(51) 评论(0) 推荐(0)