We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
//Define the structs Workshops and Available_Workshops.
struct Workshop
{
int st;
int dur;
int et;
};
struct Available_Workshops
{
int n;
vector wsarr;
};
//Implement the functions initialize and CalculateMaxWorkshops
Available_Workshops* initialize(int start_time[], int duration[], int n)
{
Available_Workshops *ws_avail = new Available_Workshops;
int main(int argc, char argv[]) {
int n; // number of workshops
cin >> n;
// create arrays of unknown size n
int start_time = new int[n];
int* duration = new int[n];
Attending Workshops
You are viewing a single comment's thread. Return to all comments →
My solution:
include
using namespace std;
//Define the structs Workshops and Available_Workshops. struct Workshop { int st; int dur; int et; };
struct Available_Workshops { int n; vector wsarr; };
//Implement the functions initialize and CalculateMaxWorkshops Available_Workshops* initialize(int start_time[], int duration[], int n) { Available_Workshops *ws_avail = new Available_Workshops;
}
int CalculateMaxWorkshops(Available_Workshops* ws_avail) { int cnt = 1; int cur; vector vec;
}
int main(int argc, char argv[]) { int n; // number of workshops cin >> n; // create arrays of unknown size n int start_time = new int[n]; int* duration = new int[n];
}