제출 #1328524

#제출 시각아이디문제언어결과실행 시간메모리
1328524tomthuy123Let's Win the Election (JOI22_ho_t3)C++20
5 / 100
1 ms344 KiB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll MOD = 1e9 + 7;

ll n;
vector<ll> lst;

inline vector<ll> Amount(ll x){
	ll returner=1;
	while(x%2==0){
		x/=2;
		returner*=2;
	}
	return {x,returner};
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
	
	ll n,k;
	cin >> n >> k;
	vector<pair<ll,ll>> lst(n+1);
	for(ll i=1;i<=n;i++){
		cin >> lst[i].first >> lst[i].second;
	}
	sort(lst.begin(),lst.end());
	ll total=0;
	for(ll i=1;i<=k;i++){
		total+=lst[i].first;
	}
	cout << total;
	

	
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...