SGU 171.Sarov zones】的更多相关文章

题目   SGU 171 相当好的贪心的题目!!!!! 题目意思就是说有K个赛区招收参赛队员,每个地区招收N[i]个,然后每个地区都有一个Q值,而N[i]的和就是N,表示总有N个参赛队员,每个队员都有他自己的P值,和他的权值W,只有当一个队员的P大于某一个地区的Q值时,权值W才能被记录在内,问怎样让着N个参赛队员选择地区才能让权值和最大. 贪心的思路就是按照权值W贪心 1.先按W的降序排序,优先考虑权值交大的. 2.歪了不影响后面的参赛队员,W较大的而且满足P>Q的,让其参加p>Q时Q最大的那…
简单的贪心.优先weight最大的,优先匹配Q值大的地区 code #include <iostream> #include <algorithm> #include <cstdio> using namespace std; struct node { int num, level, weght, p; } f[209], g[17009]; int ans[17009]; bool cmp1 (node a, node b) { return a.level >…
http://acm.sgu.ru/problemset.php?contest=0&volume=1 101 Domino 欧拉路 102 Coprime 枚举/数学方法 103 Traffic Lights 最短路 104 Little Shop of Flowers 动态规划 105 Div 3 找规律 106 The Equation 扩展欧几里德 107 987654321 Problem 找规律 108 Self-numbers II 枚举+筛法递推 109 Magic of Dav…
2013-7-19 shu 新生训练赛:母函数[转换成了背包做的] shuacm 题目:http://acm.hdu.edu.cn/diy/contest_show.php?cid=20083总结:http://blog.csdn.net/cfreezhan/article/details/9385183 2013-7-20 上午 9 点 -- 下午 2 点 湖大第六次训练赛:[1题] HNU_训练赛6[来源zoj月赛] 总结:  A:zoj 3716 Ribbon Gymnastics[神奇的…
这一次都主要是贪心练习 练习地址http://acm.hust.edu.cn/vjudge/contest/view.action?cid=26733#overview Problem APOJ 1328 对于每一个点,可以找到他在x轴上的可行区域,这样的话就变为了对区间的贪心. #include<iostream> #include<stdio.h> #include<string.h> #include<map> #include<vector&g…
When it comes to Amazon Web Services, there are two concepts that are extremely important and spanning across all the services, and that you simply can’t help but be aware of: Regions and Availability Zones. Both of them associate with most of the AW…
171. Excel Sheet Column Number Related to question Excel Sheet Column Title Given a column title as appear in an Excel sheet, return its corresponding column number. For example: A -> 1 B -> 2 C -> 3 ... Z -> 26 AA -> 27 AB -> 28 从A到Z依次代…
yum install openssl openssl-devel groupadd mysqluseradd -g mysql -s /sbin/nologin -M mysqlchown -R mysql:mysql /usr/local/mysql ./configure  --prefix=/usr/local/mysql/ --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client -with…
水概率....SGU里难得的水题.... 495. Kids and Prizes Time limit per test: 0.5 second(s)Memory limit: 262144 kilobytes input: standardoutput: standard ICPC (International Cardboard Producing Company) is in the business of producing cardboard boxes. Recently the…
sgu 101 - Domino Time Limit:250MS     Memory Limit:4096KB     64bit IO Format:%I64d & %I64u Description Dominoes – game played with small, rectangular blocks of wood or other material, each identified by a number of dots, or pips, on its face. The bl…