This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <algorithm>
using namespace std;
int N, K;
int A[509], B[509];
int main() {
// Step #1. Input
cin >> N >> K;
for (int i = 0; i < N; i++) {
cin >> A[i] >> B[i];
}
// Step #2. Sorting
sort(A, A + N);
// Step #3. Find Answer
int Answer = 0;
for (int i = 0; i < K; i++) {
Answer += A[i];
}
cout << Answer << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |