天梯赛经验分享-李振浩

  • author: 李振浩
  • date: 2020-11-21 20:44:40

    注意事项

  1. 不要读题,直接看数据,找思路。

  2. 先特殊 在一般

  3. 事先配置好环境

    • dev / codeblocks 主题
    • freopen(“1.txt”, ‘r’, stdin)
    • 不要使用<bits/stdc++.h> 变异很慢
  4. 尽量不要使用cin, cout … 用scanf printf

做题经验

  1. pair<T,T>自带排序

  2. dis数组 特殊判断

  3. 链表存储 h[N], tot, struct Edge{int to,nxt,w,….}

    综合 :https://pintia.cn/problem-sets/994805046380707840/problems/994805051153825792

  4. 不要使用map 包括unordered_map 复杂度很玄学

    csp 认证:http://118.190.20.162/view.page?gpid=T104

  5. 树形化处理dfs 找出口

  6. +1 -1 注意细节

    https://pintia.cn/problem-sets/994805046380707840/problems/994805069361299456

  7. 树形dfs 搜索时候 设置额外标记字段 fa节点 or last 边