Submission #430691

# Submission time Handle Problem Language Result Execution time Memory
430691 2021-06-16T18:42:49 Z charterla Jelly Flavours (IOI20_jelly) C++14
0 / 100
4 ms 2452 KB
#include "jelly.h"
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;



int find_maximum_unique(int x, int y, vector<int> a, vector<int> b){
	int f[505][505],ans=0;
	
	for(int k=0;k<a.size();k++){
		for(int i=x;i>=0;i--){
			for(int j=y;j>=0;j--){
				f[i][j]=0;
				if(i>=a[k])f[i][j]=max(f[i][j],f[i-a[k]][j]+1);
				if(j>=b[k])f[i][j]=max(f[i][j],f[i][j-b[k]]+1);
				
				ans=max(ans,f[i][j]);
				//cout<<f[i][j]<<" ";
			}//cout<<endl;
		}
	}
	
	return ans;
}

Compilation message

jelly.cpp: In function 'int find_maximum_unique(int, int, std::vector<int>, std::vector<int>)':
jelly.cpp:12:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |  for(int k=0;k<a.size();k++){
      |              ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 1228 KB 1st lines differ - on the 1st token, expected: '8', found: '7'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 1228 KB 1st lines differ - on the 1st token, expected: '8', found: '7'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 2380 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 4 ms 2452 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 2432 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 1228 KB 1st lines differ - on the 1st token, expected: '8', found: '7'
2 Halted 0 ms 0 KB -