题目链接:https://codeforces.com/gym/102056/problem/L LCR is really an incredible being. Thinking so, sitting on the plane and looking at the sea, Rikka savours the fantastic journey. A fire never happened. It must be interesting to share it with her mate…
tetrahedron/center> 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5726 Description Given four points ABCD, if ABCD is a tetrahedron, calculate the inscribed sphere of ABCD. Input Multiple test cases (test cases ≤100). Each test cases contains a lin…
题意:求1到N的最短路,最短路的定义为路径上最大的K条边. 思路:对于每种边权,假设为X,它是第K大,那么小于X的变为0,大于K的,边权-X.然后求最短路,用dis[N]+K*X更新答案. 而小于K的情况下,最短路显然就是原图的最短路.(还是不好想的 #include<bits/stdc++.h> #define ll long long #define mp make_pair #define pii pair<ll,int> #define F first #define S…
传送门 题面 题解 不难看出每个点的大小为行列限制中较小的那一个(因为数据保证有解) 对于行的每个限制,能取到的个数是列里限制大于等于它的数的个数,同理,对于列是行里大于它的个数(这里没有等于,为了避免重复计算) 于是可以对于行列分别开权值线段树,修改的时候只要把对应的贡献改一下就好了 //minamoto #include<bits/stdc++.h> #define R register #define ll long long #define fp(i,a,b) for(R int i=…
Problem B Tree of Almost Clean Money Input File: B.in Output File: standard output Time Limit: 4 seconds (C/C++) Memory Limit: 256 megabytes The tree of Almost Clean Money (or ACM Tree, for short) consists of N (1≤N≤500000) vertices in which, well, (…
Problem H. ICPC QuestTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100500/attachments Description Noura Boubou is a Syrian volunteer at ACM ACPC (Arab Collegiate Programming Contest) since 2011. She graduated from Tishreen Un…
B. Lunch Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100637/problem/B Description The swamp looks like a narrow lane with length n covered by floating leaves sized 1, numbered from 1 to n with a fly sitting on the top of ea…
Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 25950 Accepted: 8853 Description Background The knight is getting bored of seeing the same black and white squares again and again and has decided to make a journey around the world. When…
转载请注明出处: http://www.cnblogs.com/fraud/ ——by fraud Invitation Cards Time Limit: 5 Seconds Memory Limit: 65536 KB In the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fa…
Problem J. Journey with Pigshttp://codeforces.com/gym/241680/problem/J考察排序不等式算出来单位重量在每个村庄的收益,然后生序排列猪的重量也生序排列此时价值最大 #include<iostream> #include<cstdio> #include<queue> #include<algorithm> #include<cmath> #include<ctime>…
题目链接:http://codeforces.com/gym/101164/attachments 题意:对于已知的 n 个二维坐标点,要求按照某种特定的连线方式将尽可能多的点连接(任意相邻的 3 个点 a , b , c ,点 c 必须在有向线段 ab 的左侧.问最多可以连多少点,并给出连线顺序. 思路:因为连接最多的点,尽量让形成一个凸包将点包起来,形成螺旋式的连接所有的点,凸包模板: #pragma comment(linker, "/STACK:1024000000,1024000000…
bryce1010模板 http://codeforces.com/gym/101810 #include <bits/stdc++.h> using namespace std; #define ll long long const int MAXN=1010; int a[MAXN<<1]; int main() { int t; cin>>t; int n; while(t--) { cin>>n; for(int i=1;i<=2*n;i++)…
bryce1010模板 http://codeforces.com/gym/101810 #include<bits/stdc++.h> using namespace std; #define ll long long ll a[1000005]; int main() { int t,n,temp; ll ans,maxn,minl,x; scanf("%d",&t); while(t--) { scanf("%I64d",&n);…