随笔分类 - kuangbin
摘要:题意:给你一些字符串$s_0, ...,s_{n-1}$,求一个串S,S要把$s_0$到$s_{n-1}$都包括进来,输出S的最短长度 包括的意思是:对于串$s_i,i=0,...,n, s_i$和$S$的最长公共子序列为$s_i$ 一开始的想法是这样的:从前向后遍历每个串,对于每一个串$s_i$,
阅读全文
摘要:HDU 3533 **题意:**给定一个网格(n + 1 行,m + 1列,0~n,0~m),小明站在(0, 0)点,要到达(n, m)点,现在在一些网格处安置了炮台,炮台向固定的方向(NSWE)并且每隔一段时间发射炮弹,小明初始时有一定的HP,小明可以做以下5种操作: 向N、S、W、E移动一格 站
阅读全文
摘要:#include<iostream> #include<vector> #include<queue> #include<cstring> using namespace std; const int N = 110; char os[] = {'N', 'S', 'W', 'E'}; int dx
阅读全文
摘要:Problem Description Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid
阅读全文
摘要:Description Farmer John knows that an intellectually satisfied cow is a happy cow who will give more milk. He has arranged a brainy activity for cows
阅读全文