天梯赛经验分享-李振浩
不要读题,直接看数据,找思路。
先特殊 在一般
事先配置好环境
- dev / codeblocks 主题
- freopen(“1.txt”, ‘r’, stdin)
- 不要使用<bits/stdc++.h> 变异很慢
尽量不要使用cin, cout … 用scanf printf
做题经验
pair<T,T>自带排序
dis数组 特殊判断
链表存储 h[N], tot, struct Edge{int to,nxt,w,….}
综合 :https://pintia.cn/problem-sets/994805046380707840/problems/994805051153825792
不要使用map 包括unordered_map 复杂度很玄学
树形化处理dfs 找出口
+1 -1 注意细节
https://pintia.cn/problem-sets/994805046380707840/problems/994805069361299456
树形dfs 搜索时候 设置额外标记字段 fa节点 or last 边