题意:一副无向有权图,每个点有一些人,某些点是避难所(有容量),所有人要去避难所,问最小时间所有人都到达避难所, 题解:dij+二分+最大流check,注意到避难所最多10个,先挨个dij求到避难所的时间,然后二分时间,在这个时间之内的建边,s向避难所建边,流量是避难所容量,可达的避难所向点建边,流量inf,点向t建边,流量为人的个数,看能不能满流即可,wa点:maxflow里的inf忘改,maxn开小了= = //#pragma GCC optimize(2) //#pragma GCC op…
目录 Contest Info Solutions A A Prize No One Can Win B Birthday Boy C Cardboard Container D Driver Disagreement E Entirely Unsorted Sequences F Financial Planning G Game Night H Harry the Hamster I In Case of an Invasion, Please. . . J Janitor Troubles…
A .A Prize No One Can Win 题意:给定N,S,你要从N个数中选最多是数,使得任意两个之和不大于S. 思路:排序,然后贪心的选即可. #include<bits/stdc++.h> #define ll long long #define rep(i,a,b) for(int i=a;i<=b;i++) using namespace std; ; ll a[maxn]; int main() { int N,ans; ll M; scanf("%d%ll…
题目链接:https://vjudge.net/contest/187496#problem/E E Excellent Engineers You are working for an agency that selects the best software engineers from Belgium, the Netherlands and Luxembourg for employment at various international companies. Given the ve…
A - Amsterdam Distance 题意:极坐标系,给出两个点,求最短距离 思路:只有两种方式,取min  第一种,先走到0点,再走到终点 第二种,走到同一半径,再走过去 #include <bits/stdc++.h> using namespace std; #define INF 0x3f3f3f3f const double PI = acos(-1.0); double n, m, r; double n1, m1, n2, m2; inline double work1(…
这题想了很久没思路,不知道怎么不sort维护二维的最小值 emmmm原来是线段树/树状数组,一维sort,二维当成下标,维护三维的最小值 #include<bits/stdc++.h> #define fi first #define se second #define mp make_pair #define pb push_back #define pii pair<int,int> #define C 0.5772156649 #define pi acos(-1.0) #d…
2018 German Collegiate Programming Contest (GCPC 18) Attack on Alpha-Zet 建树,求lca 代码: #include <algorithm> #include <iterator> #include <iostream> #include <cstring> #include <cstdlib> #include <iomanip> #include <bit…
layout: post title: 2018 German Collegiate Programming Contest (GCPC 18) author: "luowentaoaa" catalog: true tags: mathjax: true - codeforces 传送门 付队博客 C.Coolest Ski Route (记忆化搜索) 题意 给出一个有向图,求出一个权值最长的链, 题解 暴力dfs会超时,所以直接储存每个起点能走到的最远距离 #include<…
B:Button Bashing You recently acquired a new microwave, and noticed that it provides a large number of buttons to be able to quickly specify the time that the microwave should be running for. There are buttons both for adding time, and for subtractin…
1.A题 题意:给定第一行的值表示m列的最大值,第m行的值表示n行的最大值,问是否会行列冲突 思路:挺简单的,不过我在一开始理解题意上用了些时间,按我的理解是输入两组数组,找出每组最大数,若相等则输出possible,否则输出impossible,代码很直接用的C语言 1 #include<stdio.h> 2 int main(){ 3 int r,c,i,j; 4 int s[110],b[110]; 5 while(scanf("%d %d",&r,&…