(权限题)NFLSoj #113: 或负 题解

该博客探讨了一道关于NFLSoj平台的题目,涉及权限管理和最大流算法的应用。文章介绍了如何构建网络流模型,其中包含超级源点向各个长者连接的边,每个长者按天数拆分,并根据其批判会准备时间分配流量。同时,考虑了长者的午休时间,再次调整流量分配。最后,所有这些都连接到批判会的节点,强调在处理过程中要避免数组越界的问题。
摘要由CSDN通过智能技术生成

一眼网络流
考虑超级源点向第i个长者连流量为L[i]的边,每个长者拆成D天,向每一天连N-sum[i][j],sum[i][j]表示他当天必须用来准备批判会的时间
每个长者的每一天专门再拆一个点管理长者的午休,连Hl-Hr-sum1[i][j],sum1[i][j]表示他当天午休时间内必须用来准备批判会的时间
最后对应的点向批判会连边

*数组不要开小了!!!

#include <cstdio>
#include <iostream>
#include <cstring>
#include <string>
#include <cstdlib>
#include <utility>
#include <cctype>
#include <algorithm>
#include <bitset>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <cmath>
#define LL long long
#define LB long double
#define x first
#define y second
#define Pair pair<int,int>
#define pb push_back
#define pf push_front
#define mp make_pair
#define LOWBIT(x) x & (-x)
using namespace std;

const int MOD=1e9+7;
const LL LINF=2e16;
const int INF=2e9;
const int magic=348<
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值