Submission #406436

# Submission time Handle Problem Language Result Execution time Memory
406436 2021-05-17T15:17:40 Z victoriad Jelly Flavours (IOI20_jelly) C++14
0 / 100
1 ms 332 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();
		vector<pair<int,int> >pa(n);
		vector<pair<int,int> >pb(n);
		for(int i=0;i<n;i++){
			pa[i]=make_pair(a[i],i);
			pb[i]=make_pair(b[i],i);
		}
		sort(pb.begin(),pb.end());
		sort(pa.begin(),pa.end());
		int r=0;
		vector<bool>v(n,false);
		bool f=true,s=true;
		for(int i=0;i<n;i++){
			if(f){
			if(!v[pb[i].second]){
				if(pb[i].first<=y){
					r++;
					y-=pb[i].first;
				}
				else{
					f=false;
				}
			}
			}
			if(s){
			if(!v[pa[i].second]){
				if(pa[i].first<=y){
					r++;
					y-=pa[i].first;
				}
				else{
					s=false;
				}
			}
			}
			if(!f && !s)break;

		}
		return r;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB 1st lines differ - on the 1st token, expected: '8', found: '3'
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: '3'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB 1st lines differ - on the 1st token, expected: '689', found: '642'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB 1st lines differ - on the 1st token, expected: '62', found: '3'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB 1st lines differ - on the 1st token, expected: '154', found: '70'
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: '3'
2 Halted 0 ms 0 KB -