- 博客(33)
- 问答 (3)
- 收藏
- 关注
原创 hihocoder 1122最大二分匹配匈牙利算法
#include <cstdio>#include <iostream>#include <algorithm>#include <queue>#include <cmath>#include <cstring>#include <stack>#include <set>#include <map>#include <vector>using namespace std;#def
2015-07-31 22:29:06 555
原创 uva3942 字典树加dp
#include <cstdio>#include <iostream>#include <algorithm>#include <queue>#include <cmath>#include <cstring>#include <stack>#include <set>#include <map>#include <vector>using namespace std;#def
2015-07-31 21:30:39 550
原创 hdu1251 字典树
#include <cstdio>#include <iostream>#include <algorithm>#include <queue>#include <cmath>#include <cstring>#include <stack>#include <set>#include <map>#include <vector>using namespace std;#def
2015-07-31 15:45:34 596
原创 poj 1274最大匹配匈牙利算法
#include <cstdio>#include <iostream>#include <algorithm>#include <queue>#include <cmath>#include <cstring>#include <stack>#include <set>#include <map>#include <vector>using namespace std;#def
2015-07-30 23:48:31 485
原创 hdu2063 最大匹配数(匈牙利算法)
#include <cstdio>#include <iostream>#include <algorithm>#include <queue>#include <cmath>#include <cstring>#include <stack>#include <set>#include <map>#include <vector>using namespace std;#def
2015-07-29 15:14:04 446
原创 hihocoder#1078 线段树的区间修改
“`include include using namespace std;define LL long longconst int maxn = 1000005; struct lin{ LL s[maxn<<1]; LL m[maxn<<1]; void init(int l,int r,int k){ if(l == r){
2015-07-28 22:04:17 404
原创 hihocoder1077 线段树
#include <cstdio>#include <iostream>#include <algorithm>#include <queue>#include <cmath>#include <cstring>#include <stack>#include <set>#include <map>#include <vector>using namespace std;#def
2015-07-28 10:00:41 751
原创 hdu 1030 数学题加观察
#include #include #include #include #include #include #include #include #include #include using namespace std;#define INF 0x7fffffff#define LL long long#define MAX(a,b) ((a)>(b))?(a):(b)
2015-07-27 16:57:58 583
原创 hdu 1532 最大流
#include #include #include #include #include #include #include #include #include #include using namespace std;#define INF 0x4fffffff#define LL long long#define MAX(a,b) ((a)>(b))?(a):(b)
2015-07-27 15:44:11 547
原创 hihocoder1040 矩形判断
#include #include #include #include #include #include #include #include #include #include using namespace std;#define INF 0x7fffffff#define LL long long#define MAX(a,b) ((a)>(b))?(a):(b)
2015-07-27 11:01:09 680
原创 hihocoder 挑战赛13A 组合数学中的帕斯卡公式
#include #include #include #include #include #include #include #include #include #include using namespace std;#define INF 0x7fffffff#define MOD 1000000007#define LL long long#define MAX
2015-07-27 09:18:24 2004 2
原创 hdu 1025 LIS nlogn复杂度
#include #include #include #include #include #include #include #include #include #include using namespace std;#define INF 0x4fffffff#define LL long long#define MAX(a,b) ((a)>(b))?(a):(b)
2015-07-26 15:35:41 585
原创 BC一周年B
#include #include #include #include #include #include #include #include #include #include using namespace std;#define INF 0x4fffffff#define LL long long#define MAX(a,b) ((a)>(b))?(a):(b)
2015-07-25 23:22:01 448
原创 BC一周年A
#include #include #include #include #include #include #include #include #include #include using namespace std;#define INF 0x4fffffff#define LL long long#define MAX(a,b) ((a)>(b))?(a):(b)
2015-07-25 23:21:20 483
原创 hdu 1024 dp滚动数组
#include #include #include #include #include #include #include #include #include #include using namespace std;#define INF 0x7fffffff#define LL long long#define MAX(a,b) ((a)>(b))?(a):(b)
2015-07-25 14:57:24 510
原创 hdu 1023 卡特兰数
import java.math.BigInteger;import java.util.Scanner;public class Main{ public static void main(String args[]){ Scanner in = new Scanner(System.in); BigInteger[] a = new BigInte
2015-07-24 23:11:31 481
原创 spfa 最短路径
#include using namespace std;int n,m;int spfa_bfs(){ int d[100] = {0}; int c[100] = {0}; int vis[100] = {0}; for(int i = 0;i < n;i++){ d[i] = INF; } d[s] = 0; queue que; que.push(s); c
2015-07-24 09:52:54 531
原创 DAG最短路算法
#include #include #include #include #include using namespace std;#define INF 1000000int d[100]; queue que; vector vec[1000];vector w[1000];int n,m;int F[1000];int topu_rudu(){ sta
2015-07-22 18:59:50 1716
原创 多校#2 B
#include #include #include #include #include using namespace std;int n,k;int a[100005];int main(){ int t; cin >> t; while(t--){ cin >> n >> k; for(int i = 1;i <= n ;i++){ scanf("
2015-07-21 19:20:30 616
原创 多校#1 A
#include #include #include #include #include #include #include using namespace std;#define INF 1000000007vector vec[10005];int n;int fun(){ for(int i = 1;i <= 10000;i++){ int d = floor(
2015-07-21 19:19:05 341
原创 hdu 1011 树型dp
#include #include #include #include using namespace std;int n,m;int vis[105];int dp[105][105];vector vec[105];vector G[105];int c[105];int p[105];void dfs(int x){ vis[x] = 1; int si = G
2015-07-21 09:26:09 626 1
原创 拓扑排序的两种实现--基于dfs和基于入度
#include #include #include #include #include #include #include using namespace std;int n;vector vec[100];int vis[100];struct node{ int n; int t; bool operator < (const node& a)con
2015-07-20 14:34:01 2040
原创 hdu 1010 启发式搜索+奇偶剪枝
#include #include #include #include using namespace std;#define INF 10000000int n,m,t;struct point{ int x,y;};point p;int vis[10][10];int vs[10][10];char a[10][10];int v[4][2] = {0,1,1
2015-07-20 09:18:15 681
原创 hdu 1007最接近点对问题 nlogn复杂度
#include #include #include #include using namespace std;#define INF 100000000int n;struct point{ double x,y; bool operator < (const point & a)const{ if(a.x == x){ return y < a.y; }
2015-07-19 21:07:44 668
原创 hdu 2035 反复平方法
#include #include #include using namespace std;int fun(int a,int b){ int c = 0; int d = 1; stack st; while(b){ st.push(b & 1); b >>= 1l; } while(!st.empty()){ int t = st.top(); st.p
2015-07-19 16:13:22 688
原创 hdu 5285
#include #include #include #include using namespace std;int n,m;vector vec[100005];int color[100005];int ans = 0;int bfs(int s){ queue que; int wri = 0; int bla = 0; que.pus
2015-07-19 08:53:03 741
原创 hdu1576 mod 运算的逆元
Problem Description要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。 Input数据的第一行是一个T,表示有T组数据。每组数据有两个数n(0 Output对应每组数据输出(A/B)%9973。 Sample Input21000
2015-07-18 17:45:05 1056
原创 hdu 1573 同余定理
#include #include #include using namespace std;long long n,m;long long int a[100];long long int b[100];int gcd(int a,int b){ return b == 0? a: gcd(b,a%b);}int main(){ int t; scanf("%d",&t
2015-07-18 17:12:07 499
原创 计蒜客第一场A
#include #include #include using namespace std;char str[10000008]; int main(){ char c ; int status = 0; strcpy(str,"0k"); int flag = 0; int s = 0; int len = 2; while((c = getchar())!=
2015-07-18 15:14:57 467
原创 扩展gcd求解二元不定方程及其证明
#include #include using namespace std;/*扩展gcd证明 因为当d = gcd(a,b)时; d = d1 = gcd(b,a%b); d1 = b1x1 + a%by1; d = ax+by = b1x1+a%by1,又因为a%b = a - a%b*b; 上式变形可以有 b1x1 + (a-b*a/b)*y1 = a*y1 + b*(x
2015-07-18 08:28:36 846
原创 hdu 1565 网络流(EK算法)
#include #include #include #include using namespace std;#define INF 0x3fffffffint v[4][2] = {{1,0},{0,1},{-1,0},{0,-1}};int ma[500][500];int a[500][500];int flow[505][505];int p[500];int
2015-07-17 11:40:15 721
原创 hdu-2045 递归
#include #include using namespace std;long long a[55] = {0,3,6};long long b[55] = {0,0,0,6};long long int fun(int x);long long int funa(int x);long long int fun(int x){ if(a[x]) return a[x];
2015-07-10 14:19:43 878
原创 求任意多边形的面积--差称法
#define LL long long#include #include #include #include #include #include #include #include #include #include using namespace std;typedef struct{ int x,y;} point;double areafun(point
2015-07-09 19:01:12 682
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人