方向dfs判定是否可行,spfa跑最短路。 noip水题,wa好几次。 #include #include #include using namespace std; const int maxn = 10000 + 10; const int maxm = 200000 + 10; int g[m... ...
分类:
其他好文 时间:
2016-05-10 08:34:36
阅读次数:
173
二分图判断+二分 给一堆点、边,两两之间有一个值,让分成两个集合,让内部最大边权最小。 排序+二分+二分图判定 存个二分图模板#include <iostream>#include <functional>#include <algorithm>#include <complex>#include ...
分类:
其他好文 时间:
2016-05-01 23:05:02
阅读次数:
182
啊啊啊啊啊啊今天已经星期三了吗 那么,来一波题解吧 本题地址http://www.luogu.org/problem/show?pid=1006 传纸条 题目描述 小渊和小轩是好朋友也是同班同学,他们在一起总有谈不完的话题。一次素质拓展活动中,班上同学安排做成一个m行n列的矩阵,而小渊和小轩被安排在 ...
分类:
其他好文 时间:
2016-04-27 18:39:18
阅读次数:
122
Yup!! The problem name reects your task; just add a set of numbers. But you may feel yourselvescondescended, to write a C/C++ program just to add a se ...
分类:
其他好文 时间:
2016-04-24 21:42:28
阅读次数:
198
Before the invention of book-printing, it was very hard to make a copy of a book. All the contents hadto be re-written by hand by so called scribers. ...
分类:
其他好文 时间:
2016-04-24 21:37:07
阅读次数:
286
模拟,注意为偶数的情况 1 #include<cstdio> 2 #include<cstring> 3 #include<cstdlib> 4 #include<iostream> 5 #include<queue> 6 #include<stack> 7 #include<cmath> 8 #i ...
分类:
其他好文 时间:
2016-04-24 00:35:00
阅读次数:
347
借鉴大神思路。。。 1 #include<cstdio> 2 #include<cstring> 3 #include<cstdlib> 4 #include<iostream> 5 #include<queue> 6 #include<stack> 7 #include<cmath> 8 #inc ...
分类:
其他好文 时间:
2016-04-24 00:28:41
阅读次数:
270
描述 分析 二分. 同 POJ 2456 , 但有一点不同:start与end位置是已经确定好的,只需 要在中间n个石子中确定n-m个即可.第一个石子与a[0]即start位置 比较,结束之后还要再比较a[n+1]-a[last]>=x是否成立.(也是错误点1) 注意: 1.如上所述. 2.输入数据 ...
分类:
其他好文 时间:
2016-04-22 23:55:07
阅读次数:
172
分析一下样例就可以知道,求的实际上是从左下角到右上角的最长路 因为对于任意不在这个最长路的上的点,都可以通过经过最长路上的点的路径将这个点的价值减光 (可以用反证法证明) 之后就是一个非常NOIP的DP了 ...
分类:
其他好文 时间:
2016-04-14 20:53:22
阅读次数:
155
有多种方案,找拐点数目最简单O(n) 注意此题有相邻点价值一样,代码改变一点 1 #include <cstdio> 2 #include<iostream> 3 #include<cstdlib> 4 #include<algorithm> 5 int s,n,k,i,a,b; 6 int mai ...
分类:
其他好文 时间:
2016-04-10 23:46:01
阅读次数:
201