摘要:
链表写法:新增加一个头结点来使插入操作统一。 1 #include 2 #include 3 #include 4 using namespace std; 5 6 const int N = 100001; 7 char text[N]; 8 char str[N]; 9 int next... 阅读全文
摘要:
非常经典的差分约束系统的建模。求最小值需要转化为求最长路。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 const int INF = 99999999; 8 const int N = 50... 阅读全文
摘要:
差分约束第一题,想明白以后就可以建图了。由于此题数据特殊,队列优化的spfa会超时,可以改成用栈来优化。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 const int INF = 99999... 阅读全文
摘要:
“反转类问题”需要注意的是pushdown懒标记的时候要用异或(或者++%2)而不是赋值,因为它是和奇偶性有关系的。 1 #include 2 #include 3 #include 4 using namespace std; 5 6 const int N = 100001;... 阅读全文