摘要: 思路就是最大的数相加次数最小,每次相加后的新数要重新排序。#include#include#include#include#includeusing namespace std;int main(){ int n,a[5009],i; long long int sum,t; wh... 阅读全文
posted @ 2015-02-11 20:31 xryz 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 数据比较小,所以直接将所有和算出来,然后在遍历和的数组,找出最靠近的。#include#includeusing namespace std;int f(int a,int b){ if(a>b) return a-b; return b-a;}int main(){ int n,... 阅读全文
posted @ 2015-02-11 20:07 xryz 阅读(135) 评论(0) 推荐(0) 编辑