网页学习体会

  • 首页
  • 个人博客
您的位置: 首页  >  IT文章  >  Codeforces Round #251 (Div. 2) B. Devu, the Dumb Guy

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

分类: IT文章 • 2022-06-15 14:21:43

注意数据范围即可

#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 = 0 ; i < n; ++ i) cin >> c[i];
    sort(c.begin(),c.end());
    long long res = 0;
    for(int i = 0 ; i <  n; ++ i){
        res +=c[i]*(x> 1 ? x--: 1);
    }
    cout<<res<<endl;
}

相关推荐

  • Codeforces Round #362 (Div. 2)->B. Barnicle
  • Codeforces Round #241 (Div. 2)->B. Art Union
  • Codeforces Round #190 (Div. 2) B. Ciel and Flowers
  • Codeforces Round #497 (Div. 2)B. Turn the Rectangles
  • Codeforces Round #240 (Div. 2)(A -- D) A. Mashmokh and Lights B. Mashmokh and Tokens C. Mashmokh and Numbers D. Mashmokh and ACM
  • Codeforces Round #441 Div. 2 A B C D 题目链接 A. Trip for Meal B. Divisibility of Differences C. Classroom Watch D. Sorting the Coins 小结
  • Codeforces Round #384 (Div. 2) B. Chloe and the sequence(规律题)
  • Codeforces Round #353 (Div. 2) B. Restoring Painting _ 地图 or set 、思维题
  • Codeforces Round #319 (Div. 2) B. Modulo Sum 抽屉原理+01背包
  • Codeforces Round #633 (Div. 2) A. Filling Diamonds B. Sorted Adjacent Differences C. Powered Addition D. Edge Weight Assignment
  • hdu 4493 Tutor (水 精度)
  • HDU 4576 Robot (概率DP)
    网站免责声明 网站地图 最新文章 用户隐私 版权申明
本站所有数据收集于网络,如果侵犯到您的权益,请联系网站进行下架处理。   

Copyright © 2018-2021   Powered By 网页学习体会    备案号:   粤ICP备20002247号