- 博客(13)
- 收藏
- 关注
原创 ROS_tf_2016_1_25
创建包: catkin_creat_pkg [包名] [依赖包] catkin_make source ./devel/setup.bash 使得能够找相应的包 tf 工具具有强大的坐标转换的功能 1> 图像化显示ROS 中的被 tf 广播的帧: rosrun tf view_f
2016-12-25 20:52:12
262
原创 ROS_rosparam_2016_12_24
rosparam 的用法: rosparam list 查看所有参数 rosparam list /名空间 查看该名空间下的参数 rosparam [option] get parameter_name 得到参数的值 若option 为 -v 显示详细的
2016-12-24 20:47:42
302
原创 Redundant Paths POJ, 3177
//并查集加桥//注意有重边的情况,对edge进行处理#include#include#include#include#include #include #include #define MAXN 5005#define maxn 10005using namespace std;int parent[MAXN];//每个节点的父亲int df
2016-04-14 23:30:19
260
原创 Doves and bombs UVA, 10765
//永远只用根节点做#include#include#include#include#include #include #include #define MAXN 10005#define maxn 80005using namespace std;int parent[MAXN];//每个节点的父亲int dfn[MAXN];int low[
2016-04-14 23:26:41
269
原创 An antiarithmetic permutation UVA, 11129
注意这答题的答案并不唯一解释见图#include #include using namespace std;int a[10005];int ans[10005];void compute(int l,int r)// l和r 是在数组中的位置{ int p,q; p=l; if(r-l==1||r==l||r else
2016-04-13 22:04:07
258
原创 关于快速幂取模的两个算法
关于这个问题,它的核心就是 (a*b)%n =(a%n*b%n)%n那么下面给出自己写的两个算法:ll modexp(ll a, ll x, ll n){ll ret=1;ll temp=a; while(b){if(x&0x1) ret=ret*temp%n;temp=temp*temp%n;x>>=1;}return ret;
2016-04-13 22:02:02
381
原创 Transferring Sylla POJ, 3713
/*本题注意初始化问题*/方法见图片#include#include#include#include#include #define MAXN 505#define maxn 40005using namespace std;int parent[MAXN];//每个节点的父亲int dfn[MAXN];int low[MAXN];typede
2016-04-12 20:13:09
337
原创 Windows API 中的SetThreadPriority()
我们都知道线程的执行是没有顺序的,比如下面的例子,有三个线程,分别输出Hello word! I am sleeping! Please wait... I am awake ,如果我们不加控制,那么运行出来的结果可能是 I am sleeping! Hello word! Please wait... I am awake或者其他的情况。那么下面就讲一下怎么让其按照指定的顺序
2016-04-08 20:29:22
8001
原创 Sum It Up UVA, 574
#include #include #include #include #include #include using namespace std;int List[15];vectorit;vector > it_sum;//还可以这样用,长知识了int flag=0;int n;void DFS(int cur,int t){ if
2016-04-08 13:51:38
693
原创 Getting in Line UVA, 216
#include#include#include#include#includeusing namespace std;struct Node{ int x; int y;}node[10];struct Ans{ double goal; int i;}ans[41000]; //i为全排列中的编号,goal为得
2016-04-06 22:55:22
292
原创 Making Change UVA, 166
这道题我们先来想一想: 在现实生活中,你去买东西,有找零钱找你100的吗??没有!! 那么我们可以试着从卖家出发考虑问题,把小于最大面值的所有情况枚举出来int re[41][2]={ //第一个数表示找的零钱,第二个数表示需要的最少的硬币 {0,0},
2016-04-03 21:31:59
527
原创 X-Explosives
#include#includeconst int maxn=100000+10;int a[maxn];using namespace std;int find(int x){ if(x==a[x]) return x; int temp; temp=a[x]; a[x]=find(temp);//路径压缩
2016-04-02 16:12:47
229
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人