Submission #551912

# Submission time Handle Problem Language Result Execution time Memory
551912 2022-04-21T21:57:38 Z smunteanu Jelly Flavours (IOI20_jelly) C++14
0 / 100
1 ms 340 KB
#include <bits/stdc++.h>
using namespace std;

int find_maximum_unique(int x, int y, vector<int> a, vector<int> b) {

  typedef pair<int,int> ipair;

  int n = (int)a.size();

  bool v[n];

  memset(v, 0, n);
  
  vector<ipair> s(n);
  
  for (int i = 0; i < n; i++)
    s[i] = {a[i], i};

  sort(s.begin(), s.end());

  for (int i = 0; i < n; i++) {
    v[i] = !b[i];
  }

  for (int i = 0; i < n; i++) {
    x -= s[i].first;
    if (x >= 0) v[s[i].second] = true;
    else break; 
  }

  int t = 0;
  for (int i = 0; i < n; i++) t += v[i];

  return t;

}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '8', found: '5'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '8', found: '5'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB 1st lines differ - on the 1st token, expected: '689', found: '683'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB 1st lines differ - on the 1st token, expected: '62', found: '60'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB 1st lines differ - on the 1st token, expected: '154', found: '146'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '8', found: '5'
2 Halted 0 ms 0 KB -