-
OOP-实验5
一、任务1 1、源代码: publish.hpp #pragma once #include <string> // 发行/出版物类:Publisher (抽象类) class Publisher { public: Publisher(const std::string &name_ = ""); -
第四次算法作业
贪心策略:按右端点bi从小到大排序;依次遍历区间,如果当前区间已经包含之前选择过的点就跳过,否则,选择当前区间的右端点为新点,并计数 时间的复杂度O(nlogn) 理解:在每一步做出局部最优选择,希望能导向全局最优解 -
高级语言从程序设计第九次作业
1 -
实验5
任务一: 1.源代码: (1)publisher.hpp: #pragma once #include <string> // 发行/出版物类:Publisher (抽象类) class Publisher { public: Publisher(const std::string &name_ = -
c++ 5
##task1 #代码 1 #include <iostream> 2 #include <string> 3 #include "publisher.hpp" 4 5 // Publisher类:实现 6 Publisher::Publisher(const std::string &name_) -
实验5
一 #pragma once #include <string> // 发行/出版物类:Publisher (抽象类) class Publisher { public: Publisher(const std::string& name_ = ""); // 构造函数 virtual ~Publi -
第四次作业
选点问题: 1.按区间右端点bi从小到大排序,如果右端点相同,则按左端点 ai从小到大排序。 2.从第一个区间开始,选择第一个区间的右端点作为一个选点。 3.继续遍历后续区间: (1)如果当前区间左端点小于等于已选的点, 说明这个点在这个区间内,则跳过,该区间已被覆盖。 (2)否则(当前区间的左端点 -
第九次作业
这个作业属于哪个课程:https://edu.cnblogs.com/campus/fzu/gjyycx 这个作业要求在哪里:https://edu.cnblogs.com/campus/fzu/gjyycx/homework/15595 学号:102500418 姓名:王俊豪 作业截屏: -
算法第四章作业
include include include using namespace std; struct Interval { int left; int right; }; int main() { int n; cin >> n; vector intervals(n); for (int i = -
实验5
实验任务1 Publisher.hpp #pragma once #include <string> // 发行/出版物类:Publisher (抽象类) class Publisher { public: Publisher(const std::string &name_ = ""); // 构 -
高级语言程序设计课程第九次个人作业
这个作业属于哪个课程:https://edu.cnblogs.com/campus/fzu/gjyycx 这个作业要求在哪里:https://edu.cnblogs.com/campus/fzu/gjyycx/homework/15595 学号:102500314 姓名:杨成 -
9
  (2) (3)(4) (5) 遍历 删 -
算法第四章作业
"选点问题" 核心贪心策略为: 1.排序:按区间右端点b升序排序(冒泡实现); 2.选择:遍历排序后的区间,每次选结束最早且与已选区间不重叠的区间(用last记录已选区间的最后结束位置)。 贪心选择性质证明 设结束最早的区间为I1,假设最优解首区间为Ik(bk > b1)。将Ik替换为I1,新解区间 -
实验4 组合与继承
1. 实验任务1 #pragma once #include <vector> #include <array> #include <string> class GradeCalc { public: GradeCalc(const std::string &cname); void input(i -
高级语程序设计第八次作业
这个作业属于哪个课程:https://edu.cnblogs.com/campus/fzu/gjyycx/ 这个作业要求在哪里:https://edu.cnblogs.com/campus/fzu/gjyycx/homework/15590 学号:102500302 姓名:陈婧妍 编写并运行书本第1 -
高级语言程序设计课程第八次个人作业
这个作业属于哪个课程:https://edu.cnblogs.com/campus/fzu 这个作业要求在哪里:https://edu.cnblogs.com/campus/fzu/gjyycx/homework/15590 学号:102500407 姓名:胡晨怡 一、 11.1:设计并测试一个函数 -
实验五
实验任务一: publisher.hpp 1 #pragma once 2 3 #include <string> 4 5 // 发行/出版物类:Publisher (抽象类) 6 class Publisher { 7 public: 8 Publisher(const std::string & -
高级语言程序设计课程第八次个人作业
这个作业属于哪个课程:https://edu.cnblogs.com/campus/fzu/gjyycx 这个作业要求在哪里: https://edu.cnblogs.com/campus/fzu/gjyycx/homework/15590 学号:102500310 姓名:刘昕骁 1.编写并运行书本