POJ1631Bridgingsignals解题报告

上传人:tia****nde 文档编号:36843682 上传时间:2018-04-03 格式:DOCX 页数:4 大小:51.03KB
返回 下载 相关 举报
POJ1631Bridgingsignals解题报告_第1页
第1页 / 共4页
POJ1631Bridgingsignals解题报告_第2页
第2页 / 共4页
POJ1631Bridgingsignals解题报告_第3页
第3页 / 共4页
POJ1631Bridgingsignals解题报告_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

《POJ1631Bridgingsignals解题报告》由会员分享,可在线阅读,更多相关《POJ1631Bridgingsignals解题报告(4页珍藏版)》请在金锄头文库上搜索。

1、POJ 1631 Bridging signalsTimeTime Limit:Limit: 1000MSMemoryMemory Limit:Limit: 10000K TotalTotal Submissions:Submissions: 10489 Accepted:Accepted: 5761 Description Oh no, theyve done it again, cries the chief designer at the Waferland chip factory. Once more the routing designers have screwed up com

2、pletely, 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

3、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 crossing each other, is imminent. Bearing in mind that th

4、ere may be thousands 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? 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 sign

5、al 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 specifies 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 conn

6、ecting the two ports of each pair do.InputOn the first line of the input, there is a single positive integer n, telling the number of test scenarios to follow. Each test scenario begins with a line containing a single positive integer p #include #include #include #define maxn 1000100 #define CLR(x) memset(x,0,sizeof(x) using namespace std; int amaxn,dpmaxn; const int INF=(131-1); int main() int t,n;scanf(“%d“,while(t-)scanf(“%d“,for(int i=0;in;i+)scanf(“%d“,fill(dp,dp+n,INF);for(int i=0;in;i+)*lower_bound(dp,dp+n,ai)=ai;printf(“%dn“,lower_bound(dp,dp+n,INF)-dp);

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 中学教育 > 试题/考题

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号