Codeforces Round #251 (Div. 2) B. Devu, the Dumb Guy

注意数据范围即可

#include <iostream>
#include <vector>
#include <algorithm> using namespace std; int main(){
long long n,x;
cin >> n >> x;
vector<long long> c(n);
for(int i = ; i < n; ++ i) cin >> c[i];
sort(c.begin(),c.end());
long long res = ;
for(int i = ; i < n; ++ i){
res +=c[i]*(x> ? x--: );
}
cout<<res<<endl;
}
上一篇:Lingo (Spring Remoting) : Passing client credentials to the server


下一篇:vs2012 condition_variable notify_one 崩溃