#include "stdio.h" #include "stdlib.h" #include "io.h" #include "math.h" #include "time.h" #define OK 1#define ERROR 0#define TRUE 1#define FALSE 0#de ...
分类:
编程语言 时间:
2017-10-08 15:35:33
阅读次数:
217
题目链接:https://hihocoder.com/problemset/problem/1334 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Given N words from the t ...
分类:
其他好文 时间:
2017-10-07 14:54:55
阅读次数:
244
网络流五·最大权闭合子图 HihoCoder - 1398 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int maxv = 410; 4 const int maxe = 40210; 5 const int inf = 0x ...
分类:
其他好文 时间:
2017-10-06 17:32:10
阅读次数:
101
https://vjudge.net/problem/UVA-10305 目前没学dfs做法,用的队列做法,每次找到一个入度为零的点出队后更新其他点,再加入入度为零的点直到查找完毕,这个题目显然一定有解不必考虑无解的情况。 ...
分类:
编程语言 时间:
2017-10-06 15:54:24
阅读次数:
112
网络流四·最小路径覆盖 HihoCoder - 1394 每个点拆成两个点限流为1. 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int maxv = 1010; 4 const int maxe = 20010; 5 cons ...
分类:
其他好文 时间:
2017-10-06 11:40:11
阅读次数:
250
网络流三·二分图多重匹配 HihoCoder - 1393 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int maxv = 210; 4 const int maxe = 10210; 5 const int inf = 0x ...
分类:
其他好文 时间:
2017-10-06 11:33:49
阅读次数:
146
题意: 首先定义一个序列为Beautiful为:对 2<=i<=n-1 : a[i-1]+a[i+1] >= 2*a[i] 给定n个数,问这些数的所有排列为Beautiful的有多少个 题解: 由 a[i-1]+a[i+1] >= 2*a[i],知 a[i+1]-a[i] >= a[i]-a[i-1 ...
分类:
其他好文 时间:
2017-10-06 10:37:01
阅读次数:
123
这题不是求最小字典序。。。撕烤了半个小时才发现不对劲T T 这题是能让小的尽量前就尽量前,无论字典序...比如1能在2前面就一定要在2前面... 显然是要先拓扑排序,让小的尽量前转化成让大的尽量往后丢,这样实际上就跟字典序无关了。于是建反向图,用堆维护一下入度为0的最大值来弹出就好了。 以后拓扑排序 ...
分类:
编程语言 时间:
2017-10-05 19:10:34
阅读次数:
168
#1602 : 本质不同的回文子串的数量 #1602 : 本质不同的回文子串的数量 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 给定一个字符串S,请统计S的所有子串中,有多少个本质不同的回文字符串? 注意如果两个位置不同的子串满足长度相同且对应字符也都相同,则认为这 ...
分类:
其他好文 时间:
2017-10-05 15:40:34
阅读次数:
900