摘要:
水题,只要遍历一遍,不够平均数的,从后面的借,比平均数多的,把多余的数添加到后面即可,注意数据范围#include #include #include using namespace std;int main(){ int n; cin >> n; vector a(n); ... 阅读全文
posted @ 2014-06-09 22:36
OpenSoucre
阅读(155)
评论(0)
推荐(0)
摘要:
水题,注意数据范围#include using namespace std;int main(){ long long n,a; cin >> n; long long sum =(n*(n+1))>>1; for(int i = 0 ; i >a; sum ... 阅读全文
posted @ 2014-06-09 22:34
OpenSoucre
阅读(159)
评论(0)
推荐(0)
摘要:
贪心算法,每条路径最短2格,故前k-1步每次走2格,最后一步全走完由于数据比较小,可以先打表#include #include #include #include using namespace std;typedef pair Point;int main(){ int n, m, k, f... 阅读全文
posted @ 2014-06-09 21:04
OpenSoucre
阅读(218)
评论(0)
推荐(0)
摘要:
#include #include #include #include using namespace std;int main(){ int n,v; cin >> n >>v; map fruit; for(int i = 0 ; i >a >> b; if... 阅读全文
posted @ 2014-06-09 19:53
OpenSoucre
阅读(210)
评论(0)
推荐(0)
摘要:
水题#include #include #include #include using namespace std;int main(){ int n,v; cin >> n >> v; vector res; for(int i = 0; i > k; for... 阅读全文
posted @ 2014-06-09 19:02
OpenSoucre
阅读(373)
评论(0)
推荐(0)
摘要:
注意p的边界情况,p为0,或者 p为k奇数+偶数 = 奇数奇数+奇数 = 偶数#include #include #include #include #include using namespace std;int main(){ int n,k,p; long a; cin >>... 阅读全文
posted @ 2014-06-09 00:59
OpenSoucre
阅读(216)
评论(0)
推荐(0)

浙公网安备 33010602011771号