文件名称:slides
介绍说明--下载内容均来自于网络,请自行研究使用
用双向链表实现了存储数据的功能。使用了两个链表,分别存储编号对应的幻灯片的两个点对应的坐标,以及序号对应的点的坐标。采用蛮力算法,找每个点是否只落在一个幻灯片所在的区域内,如果只有一个则记下该序号,并且删除该幻灯片和序号;如果出现多于一个的情况,立即跳出for循环,进行对下一个序号点的检验工作;如果没有落入任何一个幻灯片,则表明无解,直接输出-1停止。外面使用了一个虚假的while循环,判读条件是现在是否还有幻灯片以及上一次没有进行for循环时的幻灯片数和现在的片数是否相等:如果相等,表明已经不能继续抽出幻灯片,跳出while循环。之后检查此时是否还有幻灯片,如果还有,则表明无解;否则打印出所需要的输出即可。-Achieved using a doubly linked list data storage capabilities. Using the two lists, slides are stored corresponding to the number corresponding to the coordinates of the two points, and the number of coordinates of the corresponding point. Using brute force algorithm to find whether each point falls on a slide only area where, if the only one you write down the serial number, and remove the slide and serial number if there is more than one case, immediately jump out of the for loop for the next serial point inspection if not fall into any one slide, it indicates that no solution, direct output-1 stop. Outside using a while loop false, interpretation condition is whether there is now no slides, and the last number of slides for loop and is equal to the number of pieces now: If they are equal, indicating that the extract has been unable to continue to slide, bounce while loop. After checking whether there slides case, if there is, it indicates that no solution or print out the require
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Slides.cpp
DoubleList.h