Submission #397556

#TimeUsernameProblemLanguageResultExecution timeMemory
397556IwanttobreakfreeKisik (COCI19_kisik)C++98
0 / 90
497 ms14276 KiB
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int n,k,sum=0,h=0; cin>>n>>k; vector<pair<int,int> > v(n); for(int i=0;i<n;i++){ cin>>v[i].first>>v[i].second; } sort(v.begin(),v.end()); for(int i=0;i<k;i++){ h=max(h,v[i].second); sum+=v[i].first; } sum*=h; cout<<sum; }
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...