Codeforces Round #401 (Div. 2)C. Alyona and Spreadsheet

Codeforces Round #401 (Div. 2)C. Alyona and Spreadsheet

看代码 
一种新的思想 dp
以每行

#include
using namespace std;
const int MAXN=100010;
int n,m,a[MAXN],last[MAXN],h[MAXN],k;
int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=m;++i)
	{
		scanf("%d",&last[i]);
		a[i]=1;
	}
	h[1]=1;
	for(int i=2;i<=n;++i)
	{
		h[i]=MAXN;
		for(int j=1;j<=m;++j)
		{
			int t;
			scanf("%d",&t);
			if(t




你可能感兴趣的:(coderforce)