nx

NX文件名与工程图名自动关联

只愿长相守 提交于 2019-11-30 13:24:42
1.先去D:\Program Files\Siemens\NX 9.0\LOCALIZATION\prc\simpl_chinese\startup里,把默认的图框模板替换成自己定制好的模板,如何替换?改成一样的名字就可以替换!(替换前先把西门子原来的备份)。用哪个模板就替换哪个。 2.把<W@$SH_PART_NAME>这个放到自己步骤一中工程图的图框模板 里面,然后保存模板,下次出图调用这个模板,就会自动有文件名了。改文件名,工程图名也对应会改变。 来源: https://www.cnblogs.com/nxopen2018/p/11593223.html

Random Walk——高斯消元法

◇◆丶佛笑我妖孽 提交于 2019-11-29 23:23:50
题目 有一个 $N \times M$ 大小的格子,从(0, 0)出发,每一步朝着上下左右4个格子中 可以移动的 格子等概率移动。另外有些格子有石头,因此无法移至这些格子。求第一次到达 $(N-1, M-1)$ 格子的期望步数。($2 \leq N,M\leq 10$) 分析 设 $E(x, y)$ 表示从 (x, y) 出发到终点的期望步数。 我们先考虑从 $(x, y)$ 向上下左右4个方向都可以移动的情况,由于向4个方向的移动的概率是相等的,因此可以建立如下关系: $$ \begin{aligned} E(x, y) & = \frac{1}{4}(E(x-1, y)+1) + \frac{1}{4}(E(x+1,y)+1) + \frac{1}{4}(E(x, y-1)+1) + \frac{1}{4}(E(x, y+1)+1)\\ &=\frac{1}{4}(E(x-1, y) + E(x+1, y) + E(x, y-1) + E(x, y+1)) + 1\\ \end{aligned}$$ 如果移动不是等概率,只需要把 1/4 改成相应的数值就可以了。 如果存在不能移动的方向,我们也可以列出类似的式子。 为了使方程有唯一解,我们令有石头的格子和无法到达的格子都有 $E(x, y) = 0$。 把得到的 $N \times M$ 个方程联立,就可以解出期望步数。

luogu 4380 [USACO18OPEN]Multiplayer Moo

北城余情 提交于 2019-11-29 19:30:58
题目 注:题目来源 luogu4380 分析 Part 1 写在前面 看到题解里好多大佬用STL,蒟蒻瑟瑟发抖,打了两遍BFS, 过了。 这道题本身是刷并查集时刷到的,然而发现自己用并查集想不到第二问该怎么做…… (不过luogu题解里有大佬是用的并查集) 果断放弃了并查集的思路重新思考后,发现这道题到是用BFS染色可以做。 Part 2 BFS ? 第一问倒是好想,标记连通块,统计连通块的大小,最后输出最大值就好。 void bfs1(int sx,int sy){ ++tot;//连通块的编号 color[tot] = a[sx][sy];//记下连通块的颜色 queue<Node>q; q.push((Node){sx,sy}); vis[sx][sy] = tot;//标记起点 while(!q.empty()){ Node u = q.front(); q.pop(); cnt[tot]++;//记连通块的数量 for(int i = 0;i < 4; ++ i){ int nx = u.x + dx[i]; int ny = u.y + dy[i]; if(nx <= 0 || ny <= 0 || nx > n || ny > n) continue; if(!vis[nx][ny] && a[nx][ny] == a[sx][sy]){ q.push((Node)

NX二次开发-NXOpen::CoordinateSystemCollection Class Reference

天大地大妈咪最大 提交于 2019-11-29 02:39:00
1 NX11+VS2013 2 3 4 #include <NXOpen/Section.hxx> 5 #include <NXOpen/SectionCollection.hxx> 6 #include <NXOpen/Part.hxx> 7 #include <NXOpen/PartCollection.hxx> 8 #include <NXOpen/CoordinateSystem.hxx> 9 #include <NXOpen/CoordinateSystemCollection.hxx> 10 #include <NXOpen/CartesianCoordinateSystem.hxx> 11 #include <NXOpen/NXMatrix.hxx> 12 #include <NXOpen/NXMatrixCollection.hxx> 13 #include <NXOpen/Xform.hxx> 14 #include <NXOpen/XformCollection.hxx> 15 #include <NXOpen/Scalar.hxx> 16 #include <NXOpen/ScalarCollection.hxx> 17 #include <NXOpen/CylindricalCoordinateSystem.hxx> 18 #include <NXOpen

c++ 迷宫问题

妖精的绣舞 提交于 2019-11-29 02:23:20
迷宫问题 Description 定义一个二维数组: int maze [5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, }; 它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。 Input 一个5 × 5的二维数组,表示一个迷宫。数据保证有唯一解。 Output 左上角到右下角的最短路径,格式如样例所示。 Sample Input 0 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 0 Sample Output (0, 0) (1, 0) (2, 0) (2, 1) (2, 2) (2, 3) (2, 4) (3, 4) (4, 4) Source // -*- C++ -*- //===----------------------------- he.cpp ---------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the

NOIP2013 华容道

雨燕双飞 提交于 2019-11-29 00:51:44
传送门 分析 暴力能拿 \(60\) ~ \(70pts\) 。 具体的...以后再更吧 代码 #include <queue> #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> #define INF 1e7 #define il inline #define re register #define tie0 cin.tie(0),cout.tie(0) #define fastio ios::sync_with_stdio(false) #define File(x) freopen(x".in","r",stdin);freopen(x".out","w",stdout) using namespace std; typedef long long ll; template <typename T> inline void read(T &x) { T f = 1; x = 0; char c; for (c = getchar(); !isdigit(c); c = getchar()) if (c == '-') f = -1; for ( ; isdigit(c); c = getchar()) x = x * 10 + (c ^ 48); x *= f; }

P2764 最小路径覆盖问题

落花浮王杯 提交于 2019-11-29 00:46:20
传送门 题解:最小路径覆盖等于点数-匹配数。网络流或者km跑一下二分图记录路径就可以解决 #include <iostream> #include <cstdio> #include <cmath> #include <algorithm> #include <map> #include <queue> #include <vector> #include <cstring> #include <iomanip> #include <set> #include<ctime> //CLOCKS_PER_SEC #define se second #define fi first #define ll long long #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 #define Pii pair<int,int> #define Pli pair<ll,int> #define ull unsigned long long #define pb push_back #define fio ios::sync_with_stdio(false);cin.tie(0) const double Pi=3.14159265; const int N=1e5+5; const ull base=163; const int INF

【CF1031D】Minimum path

╄→гoц情女王★ 提交于 2019-11-28 20:56:34
题面 https://www.luogu.org/problem/CF1031D 题解 #include<iostream> #include<cstdio> #include<cstdlib> using namespace std; const int dx[]={0,1},dy[]={1,0}; char map[2050][2050],mx,mn; bool vis[2050][2050]; int n,k,f[2050][2050],maxstep,nowl,x0,y0,nx,ny; struct node{ int pre,x,y,l; } que[8500500]; string nows; void solve (int p) { string ans=""; while (p!=-1) { ans.push_back(map[que[p].x][que[p].y]); p=que[p].pre; } int l=ans.size(),i; for (i=l-1;i>=0;i--) cout<<ans[i]; exit(0); } int main(){ int i,j,ii,head,tail; ios::sync_with_stdio(false); cin>>n>>k; for (i=1;i<=n;i++) for (j=1;j<=n;j++) cin>

leetcode 934. Shortest Bridge

左心房为你撑大大i 提交于 2019-11-28 20:51:27
The algorithm for this problem is not so hard to figure out. This is a problem of finding the length of the shortest path in graph. As I mentioned in my previous article, BFS is a good way to slove this kind of problem. This problem is a little different, it's no begining point but beginning points. So before the real BFS, we should find all points in one island. Then we can begin our bfs with a queue which contains all points of one island. It's marked as medium in leetcode, but the recommended solution has 81 lines. And after some inspection on discuss articles, I found that most solutions

【NOIP2012】疫情控制

爱⌒轻易说出口 提交于 2019-11-28 20:43:08
题面 https://www.luogu.org/problem/P1084 题解 也算二分的经典题吧。 关于这道题有一个尴尬的故事,我口胡出了二分答案,然后以为自己做出来了,$gyf$说还要贪心,然后我把他$D$了,其实是我错了。。。。。 先二分答案,尽可能的往上走,然后让最上的支援最下的,若此时支援点只有一支队伍,必须保证其他的人到这里更近才能更新。 #include<cstdio> #include<iostream> #include<vector> #include<cstring> #include<algorithm> #include<queue> #define ri register int #define ll long long #define N 50050 using namespace std; int fa[N],n,m,f[N][17]; int que[N],nque[N],tong[N],top[N]; long long dis[N]; bool imp[N],reach[N]; vector<int> to[N],len[N]; struct node1 { int x; ll walked; bool operator < (const node1 &rhs) const { return walked>rhs.walked; } };