摘要: 在不得不先读入一行,对此行的长度做一个判断之后,再拿这一行中的某些值 这时候就先得cin.getline(line,size)得到一行 但是在取这一行之前,如果使用了cin>>, 就必须(cin>>).get(); 或者用一个getchar(); 例题蓝桥杯 2018_C++_A_6 标题:航班时间 阅读全文
posted @ 2020-04-04 18:23 Stephen~Jixing 阅读(895) 评论(0) 推荐(0)
摘要: /* //ABDCDCBABC CBABCDCDBA 7 最长相同子序列(不需要连续)采用动态规划DP 二维表 输出最后一个位置就可*/#include <iostream> #include <string> using namespace std; int n, m; string a, b; 阅读全文
posted @ 2020-04-03 18:55 Stephen~Jixing 阅读(627) 评论(0) 推荐(0)
摘要: #include <iostream> #include <stdlib.h> #include <math.h> #include <sstream> using namespace std; void i2s(int x, string &basic_string) { stringstream 阅读全文
posted @ 2020-04-03 18:49 Stephen~Jixing 阅读(334) 评论(0) 推荐(0)
摘要: #include <iostream> #include <string> #include <sstream> using namespace std ; void i2s(int x, string &basic_string) { stringstream ss; ss << x; ss >> 阅读全文
posted @ 2020-04-03 18:47 Stephen~Jixing 阅读(279) 评论(0) 推荐(0)
摘要: 基础 #include <iostream> #include <algorithm> #include <cstring> #include <stdio.h> using namespace std; typedef unsigned long long LL; LL n, m, mod; vo 阅读全文
posted @ 2020-04-03 18:46 Stephen~Jixing 阅读(323) 评论(0) 推荐(0)
摘要: #include <iostream> #include <algorithm> #include <stdio.h> #include<cstdlib> #include<cstdio> using namespace std; int main() { long long t10[100]; c 阅读全文
posted @ 2020-04-03 18:45 Stephen~Jixing 阅读(374) 评论(0) 推荐(0)
摘要: /*手动:交换 再 交换自动:next_permutation*/#include <iostream> #include <string> #include <sstream> #include <algorithm> #include <cstring> using namespace std 阅读全文
posted @ 2020-04-03 18:43 Stephen~Jixing 阅读(207) 评论(0) 推荐(0)
摘要: 深度优先搜索(DFS) 深度优先搜索在搜索过程中访问某个顶点后,需要递归地访问此顶点的所有未访问过的相邻顶点。 初始条件下所有节点为白色,选择一个作为起始顶点,按照如下步骤遍历: a. 选择起始顶点涂成灰色,表示还未访问 b. 从该顶点的邻接顶点中选择一个,继续这个过程(即再寻找邻接结点的邻接结点) 阅读全文
posted @ 2020-04-03 18:00 Stephen~Jixing 阅读(415) 评论(0) 推荐(0)
摘要: 只记录部分题,2013所有题的网盘链接 链接:https://pan.baidu.com/s/1C4pZkgw5XTeMEvn6okas5g 提取码:qe26 T4 标题: 颠倒的价牌 小李的店里专卖其它店中下架的样品电视机,可称为:样品电视专卖店。 其标价都是4位数字(即千元不等)。 小李为了标价 阅读全文
posted @ 2020-04-03 17:54 Stephen~Jixing 阅读(267) 评论(0) 推荐(0)
摘要: 部分题,2014全部题见链接 链接:https://pan.baidu.com/s/1tkTzLsQkkVkxgY_w1oYkSw 提取码:f0q8 T6 标题:扑克序列 A A 2 2 3 3 4 4, 一共4对扑克牌。请你把它们排成一行。 要求:两个A中间有1张牌,两个2之间有2张牌,两个3之间 阅读全文
posted @ 2020-04-03 17:53 Stephen~Jixing 阅读(234) 评论(0) 推荐(0)