ICode9

精准搜索请尝试: 精确搜索
  • 【UVA1723】Intervals2019-07-31 17:57:03

    题面 https://www.luogu.org/problem/UVA1723 题解 #include<cstdio>#include<iostream>#include<cstring>#include<vector>#include<queue>#define ri register int#define N 50500using namespace std;int T,n;int d[N];vector<int> to[N]

  • 【Java模板】SPFA模板2019-07-26 11:07:38

    基于邻接表(链表形式)实现。 import java.util.*; public class SPFA模板 { static int N = 1005; static int len; //有向边个数 static int[] head = new int[N]; static edge[] e = new edge[N]; static int[] dis = new int[N]; static boolean[] inq = new boolea

  • 初等网络流初步2019-07-23 11:55:31

    标题名字乱取的,吐槽一下《初等数论初步》的命名。 1 网络流的概念 1.1 引入 “分配”是生产生活中一类常见的问题。如何分配才最好,是一个有技术含量的问题。 对于“分配最优”的问题,动态规划是一种有效的解决方法。但是,有些分配无法描述出一个准确的“决策”“状态”“阶段”轮廓。

  • 最大流 和 最小花费最大流2019-07-21 19:00:27

    最大流 int n, m; // 顶点和边数 int flow[100][100], cap[100][100]; // 流量和容量 int p[100]; // 上一个节点 int a[100]; // 从s到此节点最小残量 void read(){ cin >> n >> m; for(int i = 0; i < m; i++){ int x, y, z; cin >> x >> y >> z; cap[x][y]

  • 豆瓣电影top250bs4+requests2019-06-10 20:51:53

    import requests from bs4 import BeautifulSoup import re #获取html页面信息 def getHTMLText(url): #模拟用户访问 kv = {‘user-agent’:‘Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36’} t

  • BZOJ 1221 [HNOI2001] 软件开发 费用流_建模2019-05-27 09:38:15

    Code: #include <bits/stdc++.h>#define setIO(s) freopen(s".in","r",stdin) #define maxn 300000 #define inf 1000000 #define N 3005 #define nex(n) (n + 1002) using namespace std;struct Edge{ int from,to,cap,cost; Edge(int fro

  • P4012 深海机器人问题2019-04-16 18:41:36

    网络流24题之一,拆点加拆边。洛谷上有许多题解,这里就不班门弄斧啦。 #include<iostream>#include<cstdio>#include<queue>#include<cstring>using namespace std;const int N=5000+10;const int M=50000+10;const int INF=0x3f3f3f3f;int n,m,s,t,A,B,bs,maxflow,mincost;struct e

  • [APIO 2015] 雅加达的摩天楼2019-03-17 22:44:13

    [题目链接]         https://www.lydsy.com/JudgeOnline/problem.php?id=4070 [算法]          考虑将每个"Doge"向其所能到达的楼连边          直接SPFA求单源最短路可以获得57分          那么 , 怎样拿到满分呢?          我们发现这张图的边的数量达到

  • 最小斯坦纳树初探2019-02-22 09:44:22

    问题描述 斯坦纳树问题是组合优化学科中的一个问题。将指定点集合中的所有点连通,且边权总和最小的生成树称为最小斯坦纳树(Minimal Steiner Tree),其实最小生成树是最小斯坦纳树的一种特殊情况。而斯坦纳树可以理解为使得指定集合中的点连通的树,但不一定最小。(by Angel_Kitty) 解决方案

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有