-
OOP-实验6
实验任务1 源代码 contestent.hpp 点击查看代码 #pragma once #include <iomanip> #include <iostream> #include <string> struct Contestant { long id; // 学号 std::string n -
opp实验6
一.实验任务1 1.源代码 1 #pragma once 2 #include <iomanip> 3 #include <iostream> 4 #include <string> 5 6 struct Contestant { 7 long id; // 学号 8 std::string nam -
OOP-实验6
实验任务1 源代码 contestant.hpp,utils.hpp,task1.cpp 点击查看代码 contestant.hpp #pragma once #include <iomanip> #include <iostream> #include <string> struct Contes -
实验五
实验五 任务一: 代码部分: publisher.hpp: #pragma once #include <string> // 发行/出版物类:Publisher (抽象类) class Publisher { public: Publisher(const std::string &name_ = -
实验作业5
实验任务1 代码 publisher.cpp #include <iostream> #include <string> #include "publisher.hpp" // Publisher类:实现 Publisher::Publisher(const std::string &name_): -
实验5
一 #pragma once #include <string> // 发行/出版物类:Publisher (抽象类) class Publisher { public: Publisher(const std::string& name_ = ""); // 构造函数 virtual ~Publi -
实验5
实验任务1 publisher.hpp #pragma once #include <string> // 发行/出版物类:Publisher (抽象类) class Publisher { public: Publisher(const std::string &name_ = ""); // 构 -
实验 5
task 1 Publisher.hpp 1 #pragma once 2 #include<string> 3 4 class Publisher { 5 public: 6 Publisher(const std::string& name_ = " "); 7 virtual ~Publish -
实验5
实验任务1: 代码: publisher.cpp 1 #include <iostream> 2 #include <string> 3 #include "publisher.hpp" 4 5 Publisher::Publisher(const std::string &name_): name -
《算法设计与分析》第四章学习记录
一:选点问题 我的贪心策略: 1.将所有区间按照右端点right从小到大排序; 2.每次选择右端点最小的、且与已选区间不重叠的区间; 设排序后的第一个区间为[l1, r1](右端点最小); 设某个最优解为S,其中第一个选择的区间是[lk, rk]; 由于r1 ≤ rk(第一个区间右端点最小),用[l -
实验五 多态
任务1 1.实验代码 #pragma once #include <string> // 发行/出版物类:Publisher (抽象类) class Publisher { public: Publisher(const std::string &name_ = ""); // 构造函数 virtu -
实验5
1. 实验任务1 #pragma once #include <string> // 发行/出版物类:Publisher (抽象类) class Publisher { public: Publisher(const std::string &name_ = ""); // 构造函数 virtual -
实验五
任务1 publisher.cpp #include <iostream> #include <string> #include "publisher.hpp" // Publisher类:实现 Publisher::Publisher(const std::string &name_): name -
实验五
实验任务一: #pragma once #include <string> // 发行/出版物类:Publisher (抽象类) class Publisher { public: Publisher(const std::string &name_ = ""); // 构造函数 virtual ~ -
第四次算法作业
贪心策略:按右端点bi从小到大排序;依次遍历区间,如果当前区间已经包含之前选择过的点就跳过,否则,选择当前区间的右端点为新点,并计数 时间的复杂度O(nlogn) 理解:在每一步做出局部最优选择,希望能导向全局最优解 -
OOP实验五
OOP の 学习 -
第四章作业
一、贪心策略 排序:将所有区间按照右端点从小到大排序 选点规则:从前往后遍历已排序的区间,如果当前区间的左端点大于当前已选的点,说明这个点无法覆盖当前区间,就在当前区间的右端点处放置一个新点,更新当前点的位置为当前区间的右端点 贪心选择性质分析 将区间按右端点排序后,设区间序列为 [l₁, r₁], -
高级语言程序设计第十次个人作业
这个作业属于哪个课程:https://edu.cnblogs.com/campus/fzu/gjyycx/ 这个作业要求在哪里: https://edu.cnblogs.com/campus/fzu/gjyycx/homework/15596 学号:102500434 姓名:王志勇 1. 2. 3. -
实验5 多态
实验任务1: 1.源代码 #include <iostream> #include <string> #include "publisher.hpp" // Publisher类:实现 Publisher::Publisher(const std::string &name_): name {nam -
实验五
任务一 代码 1 #pragma once 2 #include <string> 3 // 发行/出版物类:Publisher (抽象类) 4 class Publisher { 5 public: 6 Publisher(const std::string &name_ = ""); // 构造