摘要:
洛谷P1002 题面就不贴了吧,第一眼看直接是暴力深搜。 结果直接T了 然后看了一下,考虑了时间复杂度太高了,还有也没有很有效的剪枝。 贴一下我的dfs #include <iostream> using namespace std; int n, m, a, b; int dir1[8] = { 阅读全文
摘要:
void Inorder(struct Tree *T); //中序 void Preorder(struct Tree *T); //前序 void Postorder(struct Tree *T); //后序 struct Tree * InsertTree(struct Tree * T, 阅读全文
摘要:
#include <iostream> using namespace std; int a[10]={1,4,6,8,7,3,2,9,5,10}; void MergeSort(int a[], int n); void MSort(int a[], int TmpA[], int L, int 阅读全文
摘要:
Polycarpus has n friends in Tarasov city. Polycarpus knows phone numbers of all his friends: they are strings s1,s2,...,sn. All these strings consist 阅读全文
摘要:
Potato sacks come in different weight capacities (specified in pounds). Potatoes come in different weights. If you are given some number of potatoes o 阅读全文
摘要:
One cold winter evening Alice and her older brother Bob was sitting at home near the fireplace and giving each other interesting problems to solve. Wh 阅读全文