上一页 1 2 3 4 5 6 ··· 12 下一页
摘要: 使用dfs计算连通分量的数量 1 #pragma warning(disable:4996) 2 #define _CRT_SECURE_NO_WARNINGS 3 4 #include <iostream> 5 #include <algorithm> 6 #include <cmath> 7 # 阅读全文
posted @ 2021-03-02 22:17 幻想Elapse 阅读(53) 评论(0) 推荐(0) 编辑
摘要: 先定义结构图node{name, height},存放姓名和身高。先将所有人按照身高顺序从大到小排好序(因为从最后一排开始输出,最后一排身高最高,所以刚好是从头开始处理),再分组处理,除了最后一排人数是n/k+n%k,其余排的人数均为n/k,引入formation函数,用下标作为参数给出处理范围(下 阅读全文
posted @ 2021-03-01 16:13 幻想Elapse 阅读(48) 评论(0) 推荐(0) 编辑
摘要: 其实核心思想就是遍历每一个‘A’,这个A前面P的数量和后面T的数量的乘积就是一个A所能产生的PAT数,依次累加起来就是总的数量。 所以可以先找到第1个A,再找到第1个A前面所有P的数量cp,后面所有T的数量ct,相乘,并累加到结果中。 接着找第2个、第3个……第N个A,在找的过程中,如果遇到P,就将 阅读全文
posted @ 2021-03-01 10:57 幻想Elapse 阅读(41) 评论(0) 推荐(0) 编辑
摘要: 1 #pragma warning(disable:4996) 2 #define _CRT_SECURE_NO_WARNINGS 3 4 #include <iostream> 5 #include <map> 6 #include <set> 7 using namespace std; 8 s 阅读全文
posted @ 2021-02-20 20:10 幻想Elapse 阅读(44) 评论(0) 推荐(0) 编辑
摘要: 题目:https://pintia.cn/problem-sets/994805342720868352/problems/994805357933608960 1 #pragma warning(disable:4996) 2 #define _CRT_SECURE_NO_WARNINGS 3 4 阅读全文
posted @ 2021-02-19 17:26 幻想Elapse 阅读(37) 评论(0) 推荐(0) 编辑
摘要: D G=[0,inf,inf,1.2,9.2,inf,0.5; inf,0,inf,5,inf,3.1,2 inf,inf,0,inf,inf,4,1.5 1.2,5,inf,0,6.7,inf,inf 9.2,inf,inf,6.7,0,15.6,inf inf,3.1,4,inf,15.6,0, 阅读全文
posted @ 2020-11-24 13:30 幻想Elapse 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 #include <string.h> 3 #include <stdlib.h> 4 #include <errno.h> 5 #include <sys/socket.h> 6 #include <sys/types.h> 7 #include <n 阅读全文
posted @ 2020-11-03 16:44 幻想Elapse 阅读(79) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <cstring> #include <algorithm> using namespace std; struct person { string id; int virtue, talent, sum; int type;//12345 阅读全文
posted @ 2020-09-30 10:10 幻想Elapse 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 注意事项: 八千万八千(√),八千万零八千(×) 输入为0时单独判断 #include <iostream> #include <cstring> using namespace std; int main() { char out_num[10][5] = { "yi","er","san","s 阅读全文
posted @ 2020-09-29 22:30 幻想Elapse 阅读(126) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <cstring> using namespace std; int main() { int N; cin >> N; char ch; int k = -1; char(*s)[300] = new char[101][300]; int 阅读全文
posted @ 2020-09-29 09:25 幻想Elapse 阅读(130) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 12 下一页