标签:
Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2033 Accepted Submission(s):
878
#include <cstdio> #include <iostream> #include <algorithm> using namespace std; bool cMp(int a, int b){ return a > b; } int main(){ __int64 num[101]; int T; while(~scanf("%d", &T), T){ for(int i = 0; i < T; i++) scanf("%I64d", &num[i]); sort(num, num+T, cMp); // int P = (T-1)%2==0? (T-1)/2*T:T/2*(T-1); // int Q = 2009 - P; // __int64 sum = num[0]*Q; __int64 sum = num[0]*(2010-T); // printf("%I64d\n", sum); for(int i = 1; i < T; i++) sum += num[i]; printf("%I64d\n", sum); } return 0; }
标签:
原文地址:http://www.cnblogs.com/fengshun/p/4927463.html