- 博客(4)
- 收藏
- 关注
原创 PAT-甲级 1007 Maximum Subsequence Sum (25分)【最长连续子序列和】
1007Maximum Subsequence Sum(25分)Given a sequence ofKintegers {N1,N2, ...,NK}. A continuous subsequence is defined to be {Ni,Ni+1, ...,Nj} where1≤i≤j≤K. The Maximum Subsequence is the continuous subsequence which has the la...
2020-10-31 13:33:43 180
原创 PAT-甲级 1004 Counting Leaves (30分)
1004Counting Leaves(30分)A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.Input Specification:Each input file contains one test case. Each case starts with a line containing0&l...
2020-10-30 00:18:54 274
原创 线性表——顺序表 知识总结
顺序表的常用操作有建表、插入、删除、查找、打印等等。#include <stdio.h>#include <stdlib.h>#include <string.h>#include <iostream>using namespace std;typedef int ElementType;const int MAXSIZE = 50; //最多存放5个元素struct sqList{ ElementType data...
2020-10-10 16:14:00 873
原创 全排列总结(二)
一、n个数全排列#include <iostream>#include <string>#include <algorithm>#include <cstdio>using namespace std;int flag[200], a[200];int n = 5;void dfs(int step){ if (step - 1 == m) { for (int i = 0; i < step; i+
2020-10-10 01:47:54 184
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人