- 博客(6)
- 收藏
- 关注
原创 归并,插入和stl排序的速度比较
//#pragma region #include <bits/stdc++.h> #include <time.h> using namespace std; // clang-format off #define redir(i, o) { if (i) freopen("a.in", "r", stdin);if (o)freopen("a.out", "w", stdout);} #define repr(i,a,b) for(int i = a;i < b;++i)
2022-03-25 09:50:20
748
原创 (备忘) 算法竞赛常用宏定义
#include <bits/stdc++.h> #include <time.h> using namespace std; #define redir(i, o) { if (i) freopen("a.in", "r", stdin);if (o)freopen("a.out", "w", stdout);} #define repr(i,a,b) for(int i = a;i < b;++i) #define DEBUG "L= "<< setw(2)&.
2022-03-25 09:45:30
233
原创 Solitaire HDU - 1401双向广搜
Solitaire HDU - 1401 https://vjudge.net/problem/HDU-1401 Solitaire is a game played on a chessboard 8x8. The rows and columns of the chessboard are numbered from 1 to 8, from the top to the bottom and from left to right respectively. There are four identic
2021-07-31 22:45:31
110
原创 基本模板语法
基本模板语法 即template语句的使用 泛型编程 优点:可以没有任何数据类型 根据模板生成类型处理方案 只需使用占位符(T)来表示类型 可以用typename 和 class 代表不确定的数据类型 在这里二者没有区别 e.g 类模板: template <typename T> class Vector{ private: public: ...dosomething }; 函数模板: template<class T> voi...
2021-02-12 11:09:23
120
原创 2021 2 11 最长公共子序列
题目来源 想得知最长公共子列的长度,应该使用减治法,当AB列末尾元素不同时,AB列元素分别减一,继续递归循环,直到遇到终点:AB数列其一为空,代码如下: #include <bits/stdc++.h> //递归处理法 using namespace std; char a[105],b[105]; int longest(int i,int j){ if(i==0||j==0)return 0; if(a[i-1]==b[j-1]){ i--,j--; return lon
2021-02-11 17:02:34
96
原创 2021-02-07 2014 排序
http://62.234.183.36/p/2014 有问题,但是具体问题无法得知 #include <bits/stdc++.h> using namespace std; int main() { int b[1000]; char a[1000]; while(gets(a)) { int len=0,idx=0; memset(b,0,sizeof(b)); int amax; for(amax=0; a[amax]!=0; amax++)a[amax]-=
2021-02-07 13:33:08
103
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人