답안 #406464

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
406464 2021-05-17T15:49:33 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];
			}
		}
		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];
			}
		}
		return r;
	}
}

Compilation message

jelly.cpp: In function 'int find_maximum_unique(int, int, std::vector<int>, std::vector<int>)':
jelly.cpp:40:1: warning: control reaches end of non-void function [-Wreturn-type]
   40 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB 1st lines differ - on the 1st token, expected: '8', found: '7'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB 1st lines differ - on the 1st token, expected: '8', found: '7'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB 1st lines differ - on the 1st token, expected: '689', found: '894'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB 1st lines differ - on the 1st token, expected: '62', found: '14'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB 1st lines differ - on the 1st token, expected: '154', found: '13'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB 1st lines differ - on the 1st token, expected: '8', found: '7'
2 Halted 0 ms 0 KB -