답안 #406466

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
406466 2021-05-17T15:50:20 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 = a.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-b[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 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB 1st lines differ - on the 1st token, expected: '8', found: '9'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB 1st lines differ - on the 1st token, expected: '8', found: '9'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB 1st lines differ - on the 1st token, expected: '689', found: '1949'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB 1st lines differ - on the 1st token, expected: '62', found: '1936'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB 1st lines differ - on the 1st token, expected: '154', found: '1959'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB 1st lines differ - on the 1st token, expected: '8', found: '9'
2 Halted 0 ms 0 KB -