摘要: K BestTime Limit: 8000MSMemory Limit: 65536KTotal Submissions: 5177Accepted: 1411Case Time Limit: 2000MSSpecial JudgeDescriptionDemy has n jewels. Each of her jewels has some value vi and weight wi.Since her husband John got broke after recent financial crises, Demy has decided to sell some jewels. 阅读全文
posted @ 2014-03-14 14:18 hyx1 阅读(165) 评论(0) 推荐(0) 编辑
摘要: MedianTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 3528Accepted: 1001DescriptionGiven N numbers, X1, X2, ... , XN, let us calculate the difference of every pair of numbers: ∣Xi - Xj∣ (1 ≤ i < j ≤ N). We can get C(N,2) differences through this work, and now your task is to find the median 阅读全文
posted @ 2014-03-14 12:32 hyx1 阅读(288) 评论(0) 推荐(0) 编辑
摘要: Cow AcrobatsTime Limit:1000MSMemory Limit:65536KTotal Submissions:2302Accepted:912DescriptionFarmer John's N (1 2 #include 3 #include 4 5 using namespace std; 6 7 #define maxn 50005 8 9 #define INF (1 << 30)10 11 struct node {12 int w,s;13 };14 15 node s[maxn];16 int n;17 18 bool cmp(n... 阅读全文
posted @ 2014-03-14 00:29 hyx1 阅读(354) 评论(0) 推荐(0) 编辑