C. Ilya and Sticks】的更多相关文章

C. Ilya and Sticks time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output In the evening, after the contest Ilya was bored, and he really felt like maximizing. He remembered that he had a set of…
Codeforces Round #297 (Div. 2)C. Ilya and Sticks Time Limit: 2 Sec  Memory Limit: 256 MBSubmit: xxx  Solved: 2xx 题目连接 http://codeforces.com/contest/525/problem/C Description In the evening, after the contest Ilya was bored, and he really felt like ma…
C. Ilya and Sticks time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output In the evening, after the contest Ilya was bored, and he really felt like maximizing. He remembered that he had a set of …
题目传送门 /* 题意:给n个棍子,组成的矩形面积和最大,每根棍子可以-1 贪心:排序后,相邻的进行比较,若可以读入x[p++],然后两两相乘相加就可以了 */ #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> using namespace std; typedef long long ll; ; const int INF = 0x3f3f3f3f; in…
Problem description In the evening, after the contest Ilya was bored, and he really felt like maximizing. He remembered that he had a set of n sticks and an instrument. Each stick is characterized by its length li. Ilya decided to make a rectangle fr…
题目:click here #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> typedef long long ll; using namespace std; const int M = 1e5+5; int n; int a[M]; int b[M]; bool cmp( int a, int b ) { //从大到小排序 return a >…
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 用cnt[i]记录数字i出现的次数就好. 然后i从1e6逆序到1 如果cnt[i+1]和cnt[i]>0同时成立的话. 那么得到一条边.加入到vector中. 然后 如果cnt[i]>1 则cnt[i]-=2 加入i到vector中,直到cnt[i]<=1为止. 注意这两个判断的先后顺序. 否则 5 4 4 3会被认为无解. vector的大小如果大于等于2了. 就说明找到一个矩形. [代码] #include <…
Wooden Sticks Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 15564    Accepted Submission(s): 6405 Problem Description There is a pile of n wooden sticks. The length and weight of each stick a…
题意:给你n条线段依次放到二维平面上,问最后有哪些没与前面的线段相交,即它是顶上的线段 题解:数据弱,正向纯模拟可过 但是有一个陷阱:如果我们从后面向前枚举,找与前面哪些相交,再删除前面那些相交的线段,这样就错了 因为如果线段8与5,6,7相交了,我们接下来不能直接判断4,我们还要找7,6,5与之前哪些相交 #include<set> #include<map> #include<queue> #include<stack> #include<cmat…
http://acm.hdu.edu.cn/showproblem.php?pid=1455 http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=243 uva开头描述: 307 - Sticks Time limit: 3.000 seconds hduoj 开头描述: E - Sticks Time Limit:3000MS     Memo…