Submission #400904

# Submission time Handle Problem Language Result Execution time Memory
400904 2021-05-08T19:50:00 Z Divanny Jelly Flavours (IOI20_jelly) C++14
0 / 100
12 ms 340 KB
#include "jelly.h"
#include <bits/stdc++.h>

using namespace std;

int find_maximum_unique(int x, int y, vector<int> a, vector<int> b) 
{
	int n = a.size();
	int cont = 0;
	while (x > 0 || y > 0)
	{
		int i = min_element(a.begin(), a.end()) - a.begin();
		if ((a[i] < b[i] && x - a[i] >= 0) || (y - b[i] < 0 && x - a[i] >= 0))
		{
			x -= a[i];
			a[i] = 10001;
			b[i] = 10001;
			cont++;
		}
		else if (y - b[i] >= 0)
		{
			y -= b[i];
			a[i] = 10001;
			b[i] = 10001;
			cont++;
		}
		else
		{
			break;
		}
	}
	return cont;
}

Compilation message

jelly.cpp: In function 'int find_maximum_unique(int, int, std::vector<int>, std::vector<int>)':
jelly.cpp:8:6: warning: unused variable 'n' [-Wunused-variable]
    8 |  int n = a.size();
      |      ^
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB 1st lines differ - on the 1st token, expected: '8', found: '6'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB 1st lines differ - on the 1st token, expected: '8', found: '6'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 204 KB 1st lines differ - on the 1st token, expected: '689', found: '65'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 204 KB Output is correct
2 Correct 2 ms 204 KB Output is correct
3 Correct 2 ms 204 KB Output is correct
4 Correct 11 ms 320 KB Output is correct
5 Correct 11 ms 204 KB Output is correct
6 Correct 2 ms 204 KB Output is correct
7 Correct 2 ms 204 KB Output is correct
8 Correct 2 ms 204 KB Output is correct
9 Correct 11 ms 340 KB Output is correct
10 Correct 11 ms 332 KB Output is correct
11 Correct 2 ms 332 KB Output is correct
12 Correct 1 ms 332 KB Output is correct
13 Correct 2 ms 332 KB Output is correct
14 Correct 12 ms 308 KB Output is correct
15 Correct 8 ms 340 KB Output is correct
16 Correct 2 ms 332 KB Output is correct
17 Incorrect 2 ms 332 KB 1st lines differ - on the 1st token, expected: '69', found: '63'
18 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 204 KB Output is correct
2 Correct 2 ms 204 KB Output is correct
3 Correct 2 ms 332 KB Output is correct
4 Correct 11 ms 336 KB Output is correct
5 Incorrect 11 ms 332 KB 1st lines differ - on the 1st token, expected: '1867', found: '1866'
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB 1st lines differ - on the 1st token, expected: '8', found: '6'
2 Halted 0 ms 0 KB -