题目链接:282E Sausage Maximization
题目大意:给定一个序列A,要求从中选取一个前缀,一个后缀,可以为空,当时不能重叠,亦或和最大。
解题思路:预处理出前缀后缀亦或和,然后在字典树中维护,每次添加并查询,过程中维护ans。
#include
#include
#include
#include
using namespace std;
typede...
分类:
其他好文 时间:
2014-10-31 00:00:38
阅读次数:
398
题意 给你n个点的坐标 求第1个点到第2个点的所有路径中两点间最大距离的最小值
很水的floyd咯
#include
#include
#include
#include
using namespace std;
const int N=205;
double d[N][N];
int x[N],y[N],n;
void floyd()
{
for(int k=1;k<=n;...
分类:
其他好文 时间:
2014-10-30 23:59:16
阅读次数:
406
namespace ConsoleApplication1 { ??? class Program ??? { ??????? static void Main(string[] args) ??????? { ??????????? SystemInfo info = new SystemInfo(); ??????...
分类:
其他好文 时间:
2014-10-30 22:50:13
阅读次数:
445
#include
#include
#include
using namespace std;
struct BinTree {
int data;
struct BinTree *left;
struct BinTree *right;
};
struct BinPost {
BinTree *pTree;
bool isFirst;
};
...
分类:
其他好文 时间:
2014-10-30 22:45:09
阅读次数:
207
HDU 1533 Going Home
题目链接
题意:就是一个H要对应一个m,使得总曼哈顿距离最小
思路:KM完美匹配,由于是要最小,所以边权建负数来处理即可
代码:
#include
#include
#include
#include
using namespace std;
const int MAXNODE = 105;
typedef int ...
分类:
其他好文 时间:
2014-10-30 22:37:26
阅读次数:
242
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ConsoleAppEF{ class Progra...
分类:
其他好文 时间:
2014-10-30 22:27:34
阅读次数:
156
Uva 1069 Always an Integer ( 数学 )#include #include #include #include using namespace std;typedef long long LL;#define MAXN 105#define CLR( a, b ) mems...
分类:
其他好文 时间:
2014-10-30 22:25:01
阅读次数:
196
Version 11.1 Actions As SYS Note:USERENV is an Oracle provided namespace ...
分类:
数据库 时间:
2014-10-30 22:11:52
阅读次数:
381
直接上递归版gcd模板,直接while的话效率更高~ 1 #include 2 #include 3 using namespace std; 4 5 int gcd(int a, int b) { 6 return a % b ? gcd(b, a % b) : b; 7 } 8 ...
分类:
编程语言 时间:
2014-10-30 20:53:47
阅读次数:
264
转个图。或者打表找的规律是 g[n] = 3*g[n-1] - g[n-2];构造个 3 -1 的矩阵然后搞下就好了。 1 0 #include #include #include #include typedef long long LL;using namespace std;LL mod...
分类:
其他好文 时间:
2014-10-30 20:47:17
阅读次数:
245