Bridging signals
来源:互联网 发布:qq飞车噬魂金甲数据 编辑:程序博客网 时间:2024/06/06 01:31
Bridging signals
'Oh no, they've done it again', cries the chief designer at the Waferland chip factory. Once more the routing designers have screwed up completely, making the signals on the chip connecting the ports of two functional blocks cross each other all over the place. At this late stage of the process, it is too
expensive to redo the routing. Instead, the engineers have to bridge the signals, using the third dimension, so that no two signals cross. However, bridging is a complicated operation, and thus it is desirable to bridge as few signals as possible. The call for a computer program that finds the maximum number of signals which may be connected on the silicon surface without rossing each other, is imminent. Bearing in mind that there may be housands of signal ports at the boundary of a functional block, the problem asks quite a lot of the programmer. Are you up to the task?
Figure 1. To the left: The two blocks' ports and their signal mapping (4,2,6,3,1,5). To the right: At most three signals may be routed on the silicon surface without crossing each other. The dashed signals must be bridged.
A typical situation is schematically depicted in figure 1. The ports of the two functional blocks are numbered from 1 to p, from top to bottom. The signal mapping is described by a permutation of the numbers 1 to p in the form of a list of p unique numbers in the range 1 to p, in which the i:th number pecifies which port on the right side should be connected to the i:th port on the left side.
Two signals cross if and only if the straight lines connecting the two ports of each pair do.
expensive to redo the routing. Instead, the engineers have to bridge the signals, using the third dimension, so that no two signals cross. However, bridging is a complicated operation, and thus it is desirable to bridge as few signals as possible. The call for a computer program that finds the maximum number of signals which may be connected on the silicon surface without rossing each other, is imminent. Bearing in mind that there may be housands of signal ports at the boundary of a functional block, the problem asks quite a lot of the programmer. Are you up to the task?
Figure 1. To the left: The two blocks' ports and their signal mapping (4,2,6,3,1,5). To the right: At most three signals may be routed on the silicon surface without crossing each other. The dashed signals must be bridged.
A typical situation is schematically depicted in figure 1. The ports of the two functional blocks are numbered from 1 to p, from top to bottom. The signal mapping is described by a permutation of the numbers 1 to p in the form of a list of p unique numbers in the range 1 to p, in which the i:th number pecifies which port on the right side should be connected to the i:th port on the left side.
Two signals cross if and only if the straight lines connecting the two ports of each pair do.
4642631510234567891018876543219589231746
3914
该题看似说的很复杂,其实就是给你一串数,让你求出来这一串数的最小上升子序列的长度。
下面解释一下代码:
#include <cstdio> #include <algorithm> #define INF 0x3f3f3f3f//定义一个无穷大的数//using namespace std; int dp[40010],a[40010]; int main(){int t;scanf("%d",&t);while(t--){int p;scanf("%d",&p);for(int i = 1;i <= p;i++){scanf("%d",&a[i]);dp[i] = INF;//初始化数组dp为无穷大//}for(int j = 1;j <= p; j++)*lower_bound(dp+1,dp+p+1,a[j]) = a[j];//找到第一个不小于a[j]元素的地址//printf("%d\n",lower_bound(dp+1,dp+p+1,INF)-dp-1);}return 0;}
阅读全文
0 0
- Bridging signals
- Bridging signals
- Bridging signals
- Bridging signals
- Bridging signals
- Bridging signals
- Bridging Signals
- Bridging signals
- Bridging signals
- Bridging signals
- Bridging signals
- Bridging signals
- pku 1631 Bridging signals
- POJ 1631 Bridging signals
- PKU的Bridging Signals
- ZOJ 1986 Bridging Signals
- Bridging signals POJ 1631
- poj1631 Bridging signals
- JSP与Servlet之间的传值
- 【GDOI2018模拟8.7】图的异或
- EL表达式中获取list长度
- 数组和链表的区别,数组和指针的区别
- Java类和对象 详解(一)
- Bridging signals
- 电脑桌面图片变成白色的解决方案
- C#连接MySQL数据库
- Shuffle'm Up
- Java中的枚举类型
- 为什么GitHub Contribution Activity没有没有统计贡献
- 搭建SSH框架遇到的问题汇总
- 为什么你的 Contributions 没有在你的 Profile 里显示?
- 模拟水题2