连击 天
fork: star:
#include <stdio.h> #include <cmath> //二叉树结点 typedef struct binary_tree_node_t{ binary_tree_node_t * left; binary_tree_node_t * right; int elem; }; //方法1...
#include <stdio.h> #include <climits> //二叉树结点 typedef struct binary_tree_node_t{ binary_tree_node_t * left; binary_tree_node_t * right; int elem; }; //如果...
#include <stdio.h> #include <string.h> #include <vector> using namespace std; int n; int visit[100];//是否访问过 vector<int> vi;//排列的结果 void dfs(int level ){ ...
#include <stdio.h> #include <queue> #include <algorithm> #define MAX 1000 using namespace std; int n; int A[MAX], B[MAX]; typedef struct node{ int sum;//sum =...
#include <stdio.h> #include <stack> #include <queue> using namespace std; //结点的数据 typedef int tree_node_elem_t; //二叉树结点 typedef struct binary_tree_node_t{ ...
未做: C语言实现栈、队列 汉诺塔 void hanoi(int n, char x, char y, char z){ if(n == 1){//已经轮到移动1号盘,即最后一步了 printf("%d from %c to %c\n", 1, x...
题本身很水,但逗比的过程中发现了: 1: 不要用strcmp比较两个数字型字符串的大小: printf("%d\n",strcmp("60","100"));//return 1即 60 > 100,因为strcmp 比较首字符发现不等就返回...
排序题, 关键是要想到排序后,是按照学生的志愿来遍历,所有志愿都拒绝了,这个学生就是reject; 所有学生都录取或reject了,就停止; 两个结构体是一边写代码时一边完善的: typedef struc...
结构体+树的BFS就过了 #include <stdio.h> #include <vector> #include <queue> using namespace std; int n; double p, r; double totalSale; typedef struct node{ int id;...
自己想到了是多源点求最短路径问题,用Dijkstra实现了1个多小时,还是2个4分case错误! 1: 初始化不应该用memeset设-1, 判断里面烦死了,图的算法还得练,不熟 2 :居然没有round函数,inc...
模拟题 1: map默认就是按照key排序的 2:添加元素时,可以直接map[string]++; #include <stdio.h> #include <string> #include <iostream> #include <map> using namespace std; map<s...
没有更多内容
加载失败,请刷新页面
文章删除后无法恢复,确定删除此文章吗?
动弹删除后,数据将无法恢复
评论删除后,数据将无法恢复