Submission #729269

# Submission time Handle Problem Language Result Execution time Memory
729269 2023-04-23T17:50:08 Z tch1cherin Let's Win the Election (JOI22_ho_t3) C++17
0 / 100
1 ms 324 KB
#include <bits/stdc++.h>
using namespace std;

void solve() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n), b(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  sort(a.rbegin(), a.rend());
  long double ans = 0;
  for (int i = 0; i < k; i++) {
    ans += a[i];
  }
  cout << ans << "\n";
}

int main() {
  cout << fixed << setprecision(9);
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  solve();
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 324 KB Output is correct
3 Incorrect 1 ms 320 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 324 KB Output is correct
3 Incorrect 1 ms 320 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 324 KB Output is correct
3 Incorrect 1 ms 320 KB Output isn't correct
4 Halted 0 ms 0 KB -