Submission #406471

# Submission time Handle Problem Language Result Execution time Memory
406471 2021-05-17T15:54:15 Z victoriad Jelly Flavours (IOI20_jelly) C++14
0 / 100
1 ms 204 KB
#include "jelly.h"
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <utility>
#include <queue>
#include <map>
#include <iomanip>
#include <stack>
#include <fstream>
using namespace std;


int find_maximum_unique(int x, int y, std::vector<int> a, std::vector<int> b) {
	int n = b.size();
	if(x==0){
		sort(b.begin(),b.end());
		int r=0;
		for(int i=0;i<n;i++){
			if(b[i]<=y){
				r++;
				y=y-b[i];
			}
		}
		if(r>=n)return n;
		return r;
	}
	if(y==0){
		sort(a.begin(),a.end());
		int r=0;
		for(int i=0;i<n;i++){
			if(a[i]<=x){
				r++;
				x=x-a[i];
			}
		}
		if(r>=n)return n;
		return r;
	}
}

Compilation message

jelly.cpp: In function 'int find_maximum_unique(int, int, std::vector<int>, std::vector<int>)':
jelly.cpp:42:1: warning: control reaches end of non-void function [-Wreturn-type]
   42 | }
      | ^
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 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 204 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 204 KB 1st lines differ - on the 1st token, expected: '689', found: '58'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 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 204 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 1 ms 204 KB 1st lines differ - on the 1st token, expected: '8', found: '5'
2 Halted 0 ms 0 KB -