Sunflower
12
🌻
(#150)
Thông tin
Số bài đã giải: 5
Performance Points: 3,00 #348
Active contests: 0/3
Đóng góp: 0
include<bits/stdc++.h>
using namespace std;
define ll long long
ll n,k,tong=0,a[1000005]; int main() { iosbase::syncwith_stdio(false); cin.tie(nullptr);
cin>>n;
cin>>k;
for(ll i=1;i<=n;i++)
{
cin>>a[i];
}
sort(a+1,a+n+1);
for(ll i=1;i<=k;i++)
{
tong+=a[i];
}
cout<<tong;
}