这题想了很久没思路,不知道怎么不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…
题目链接: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…
目录 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…
题目大意:给你一个数字n(n<=1e9) ,让你求一个能包含这个数的斐波那契数列的第一项a 和第二项b,找出b最小的那个. 帮我复习了一下扩展欧几里得.... 思路:a,b,a+b,a+2b……我们能枚举出50项内,每一项的a和b的数量,然后就是从后往前解 二元一次方程. 其实以a为第一项,b为第二项的斐波那切数列公式为,a[ i ]=f[ i - 1 ] * x+f[ i ]*y. #include<bits/stdc++.h> #define ll long long using n…
题目大意:有n个人,每个人都有三个物品,排名分别为a[ i ],b[ i ],b[ i ],现在要删掉其中的一些人 如果一个人x的三个物品的排名为a[ x ],b[ x ],b[ x ],若存在另一个人y物品排名为a[ y ],b[ y ],b[ y ], 且a[ y ]<a[ x ] && b[ y ]<b[ x ]  && c[ y ]<c[ x ],则删掉x,问你最后剩下多少人. 思路:一开始肯定要按一个物品的排名进行排序,然后就三个人想了半小时没想…
题意:一副无向有权图,每个点有一些人,某些点是避难所(有容量),所有人要去避难所,问最小时间所有人都到达避难所, 题解:dij+二分+最大流check,注意到避难所最多10个,先挨个dij求到避难所的时间,然后二分时间,在这个时间之内的建边,s向避难所建边,流量是避难所容量,可达的避难所向点建边,流量inf,点向t建边,流量为人的个数,看能不能满流即可,wa点:maxflow里的inf忘改,maxn开小了= = //#pragma GCC optimize(2) //#pragma GCC op…
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…
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(…
$$2015\ German\ Collegiate\ Programming\ Contest\ (GCPC 15) + POI 10-T3$$ \(A.\ Journey\ to\ Greece\) 状压DP,TSP,先考虑找出这些关键点之间的最短路,然后就是旅行商问题,其中可以用一次\(taxi\),考虑\(dp\)状态为\(f[i][msk][tag]\),表示当前所在位置为\(i\)点,已经经过的节点集合为\(msk\),是否用过\(taxi\)的情况下,所化的最小时间,最后再从走遍了…
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…