- 博客(8)
- 收藏
- 关注
转载 好久没写博客了,最近刚创了个洛谷账号,P1002有意思啊,过河卒
洛谷P1002题面就不贴了吧,第一眼看直接是暴力深搜。结果直接T了然后看了一下,考虑了时间复杂度太高了,还有也没有很有效的剪枝。贴一下我的dfs#include <iostream>using namespace std;int n, m, a, b;int dir1[8] = { 1,1,2,2,-1,-1,-2,...
2019-04-08 11:19:00 239
转载 BST的实现(二叉搜索树)
void Inorder(struct Tree *T); //中序void Preorder(struct Tree *T); //前序void Postorder(struct Tree *T); //后序 struct Tree * InsertTree(struct Tree * T, int z);struct Tree * Delete(struct Tree *T...
2019-01-09 16:01:00 147
转载 归并+二分
递归二分#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 RightEnd);void ...
2018-12-30 21:05:00 130
转载 Phone Code
Polycarpus hasnfriends in Tarasov city. Polycarpus knows phone numbers of all his friends: they are stringss1,s2,...,sn. All these strings consist only of digits and have the same length.O...
2018-12-30 19:27:00 350
转载 Potato Sacks
Potato sacks come in different weight capacities (specified in pounds). Potatoes come in different weights. If you are given some number of potatoes of possibly different weights (specified ...
2018-12-30 16:21:00 327
转载 (Codeforce)Correct Solution?
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. When it was Alice's turn, she told the number...
2018-12-30 16:06:00 158
转载 计蒜客(三角形的内点)
在一个平面坐标系中,我们可以选出三个不全在一条线上的点构成一个三角形。我们称一个在三角形内(不包含三角形的边上),横纵坐标皆为整数的点位这个三角形的内点。 对于一个由(0,0)、(n,m)、(p,0)作为顶点构成的三角形,请你设计程序求出他的内点数。输入包括一行,包括三个用空格分隔的整数,分别为n,m,p(0 ≤ n < 32000,0 < m < 32000,...
2018-12-30 15:42:00 115
转载 (Codeforce)The number of positions
Petr stands in line ofnpeople, but he doesn't know exactly which position he occupies. He can say that there are no less thanapeople standing in front of him and no more ...
2018-12-30 15:29:00 204
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人