随笔分类 -  c++

1
摘要:#include<vector> #include<queue> #include<string> #include<binaryNode.hpp> #include<iostream> #include<sstream> template<typename T> class traverse { 阅读全文
posted @ 2021-05-02 09:00 世界を変える御宅族 阅读(92) 评论(0) 推荐(0)
摘要:1 #include <iostream> 2 #include<string> 3 #include<binaryNode.hpp> 4 using namespace std; 5 template<typename T> 6 class BST { 7 public: 8 BST() { sz 阅读全文
posted @ 2021-05-01 00:10 世界を変える御宅族 阅读(157) 评论(0) 推荐(0)
摘要:1 #include <iostream> 2 #include<vector> 3 #include<binaryNode.hpp> 4 #include<queue> 5 //自己的头文件放最后防止被依赖 6 7 using namespace std; 8 template<class T>c 阅读全文
posted @ 2020-10-31 00:07 世界を変える御宅族 阅读(425) 评论(0) 推荐(0)
摘要:1 #include<iostream> 2 #include<string> 3 #include<vector> 4 #include<map> 5 #include<text.hpp> 6 #include<ctime> 7 8 using namespace std; 9 clock_t b 阅读全文
posted @ 2020-10-24 17:33 世界を変える御宅族 阅读(570) 评论(0) 推荐(0)
摘要:1 #pragma once 2 #include <initializer_list> 3 struct String { 4 String(const char*s) { 5 c_str = new char[strlen(s)+1]; 6 while (*s) { 7 *(c_str+sz) 阅读全文
posted @ 2020-10-17 20:50 世界を変える御宅族 阅读(128) 评论(0) 推荐(0)
摘要:1 #include<iostream> 2 #include<vector> 3 using namespace std; 4 5 6 struct Sort { 7 8 inline void operator()(vector<int>&vec){ 9 for (int N = vec.siz 阅读全文
posted @ 2020-10-16 10:04 世界を変える御宅族 阅读(172) 评论(0) 推荐(0)
摘要:#include <iostream> #include <vector> #include<cassert> #include <queue> using namespace std; auto func(vector<int> nums, size_t k) { assert(!nums.emp 阅读全文
posted @ 2020-10-15 15:16 世界を変える御宅族 阅读(157) 评论(0) 推荐(0)
摘要:1 #include <iostream> 2 #include <vector> 3 #include <string> 4 #include<random> 5 using namespace std; 6 7 template<class T=long long>class factory { 阅读全文
posted @ 2020-10-06 22:02 世界を変える御宅族 阅读(157) 评论(0) 推荐(0)
摘要:1 #include <iostream> 2 #include<binaryNode.hpp> 3 #include<cassert> 4 #include<queue> 5 #include<vector> 6 7 using namespace std; 8 9 template<class 阅读全文
posted @ 2020-09-13 10:27 世界を変える御宅族 阅读(250) 评论(0) 推荐(0)
摘要:1 #pragma once 2 template<class T>struct binaryNode { 3 binaryNode() = default; 4 binaryNode(T data, binaryNode<T>* father = NULL, binaryNode<T>* lson 阅读全文
posted @ 2020-08-19 00:48 世界を変える御宅族 阅读(181) 评论(0) 推荐(0)
摘要:#include <iostream> #include<algorithm> #include<stack> #include<vector> using namespace std; bool nixu(vector<int>cp) { for (size_t i = 2; i < cp.siz 阅读全文
posted @ 2020-08-08 01:17 世界を変える御宅族 阅读(336) 评论(0) 推荐(0)
摘要:1 #include <iostream> 2 #include<my.hpp> 3 using namespace std; 4 5 void line_feed() { 6 cout << endl; 7 } 8 9 template<class T>class List { 10 public 阅读全文
posted @ 2020-08-05 21:39 世界を変える御宅族 阅读(198) 评论(0) 推荐(0)
摘要:map<vector<int>::iterator,int*>m; vector<int>vec{ 1,4,31,23,1 }; less<int>s; auto iter = vec.begin(); while (iter != vec.end()) { m[iter] = &(*iter); 阅读全文
posted @ 2020-07-23 16:48 世界を変える御宅族 阅读(114) 评论(0) 推荐(0)
摘要:#include <iostream> #include<algorithm> #include<vector> using namespace std; void swap(int& a, int& b) { int t = a; a = b; b = t; } void quicksort(ve 阅读全文
posted @ 2020-07-15 18:21 世界を変える御宅族 阅读(205) 评论(0) 推荐(0)
摘要:1. First, write a simple program called null.c that creates a pointer to an integer, sets it to NULL, and then tries to dereference it. Compile this i 阅读全文
posted @ 2020-07-09 17:58 世界を変える御宅族 阅读(349) 评论(0) 推荐(0)
摘要:2. Now, run free, perhaps using some of the arguments that might be useful (e.g., -m, to display memory totals in megabytes). How much memory is in yo 阅读全文
posted @ 2020-07-02 00:16 世界を変える御宅族 阅读(243) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2020-06-25 12:48 世界を変える御宅族 阅读(296) 评论(0) 推荐(0)
摘要:1. Write a program that calls fork(). Before calling fork(), have the mainprocess access a variable (e.g., x) and set its value to something (e.g., 10 阅读全文
posted @ 2020-06-12 13:28 世界を変える御宅族 阅读(494) 评论(0) 推荐(0)
摘要:1 auto getter() { 2 return new vector<int>(); 3 } 4 auto setter(vector<int>* vec) { 5 int x; 6 while (cin >> x) 7 vec->push_back(x); 8 return vec; 9 } 阅读全文
posted @ 2020-05-25 11:51 世界を変える御宅族 阅读(162) 评论(0) 推荐(0)
摘要:1 void func(forward_list<string>& flst, const string& s1, const string& s2) { 2 auto bb = flst.before_begin(); 3 bool flag = false; 4 for (auto j : fl 阅读全文
posted @ 2020-05-17 17:15 世界を変える御宅族 阅读(193) 评论(0) 推荐(0)

1