当前位置:网站首页>D30:color tunnels (color tunnels, translation)
D30:color tunnels (color tunnels, translation)
2022-07-03 23:14:00 【Aggressive Wenwen】
The original title is :OpenJudge - 687:Color Tunnels
translate :
describe : A toy company has a complex system to paint products . In order to get the desired color , The product must be painted in several colors in the specified order . Every product is colored through a color tunnel . For each color , At least one channel is drawn with this color ( There may be more ). Tunnels are distributed in the spraying area , Products must be transported from one tunnel to another , To paint the given color . When the painting process starts , The product is at a certain point in the production plant , Finally, it must be delivered to the product warehouse ;
Officially , The uncolored finished product is at the source , It must be painted with different colors in the given order before it can be transported to another destination . There are several tunnels , Each tunnel is considered to operate simultaneously , Tunnels have specific colors , But the color is not necessarily different . set up < c1,c2,……,cn > Is the product to be painted n A sequence of colors . The product needs to pass < t1,t2,……> bring ti The color of is ci. Be careful , It is possible to cross the tunnel without being painted , therefore , actually , Aforementioned < t1,t2,...,tn > It may be a subsequence of the tunnel through which the product passes . The direction in which the product passes through the tunnel is not important . The goal is to find the shortest path from the source point to the destination under the limitation of color . This road may cross itself , Even through the tunnel . Twice is also allowed ( Or more times ) Through the tunnel .
Be careful ! Two tunnels can cross or overlap , But they are different ;
Input : Contains several test cases . The first line of input is a no greater than 20 The positive integer t, Represents the number of test cases . After the first line is t Data of test cases . The first line of each test case contains four real numbers xs,ys,xt,yt, They are source and destination x and y coordinate . The second line contains the color sequence : The first number is the length of the sequence , The scope is [1,30], The remaining line is the sequence itself . Each color in the sequence is in the range [1,100] The integer of . The third line contains the scope [1,60] It's an integer of , Indicates the number of tunnels , Heel n That's ok , Each line contains five numbers . The first two numbers are at one end of the tunnel x and y coordinate . The third and fourth numbers are on the other side x and y coordinate . Coordinates are real numbers . The fifth number belongs to [1,100];
Output : Yes t That's ok , Each row contains the minimum length of the path from the source point to the destination , Constrained by the problem . The length will be compared with the best length within the accuracy range of three digits after the decimal point .
边栏推荐
- . Net ADO splicing SQL statement with parameters
- QT creator source code learning note 05, how does the menu bar realize plug-in?
- The reason why the computer runs slowly and how to solve it
- Common problems in multi-threaded learning (I) ArrayList under high concurrency and weird hasmap under concurrency
- Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
- EPF: a fuzzy testing framework for network protocols based on evolution, protocol awareness and coverage guidance
- Loop compensation - explanation and calculation of first-order, second-order and op amp compensation
- Weekly leetcode - nc9/nc56/nc89/nc126/nc69/nc120
- Meta metauniverse female safety problems occur frequently, how to solve the relevant problems in the metauniverse?
- Pan Yueming helps Germany's Rochester Zodiac custom wristwatch
猜你喜欢
X Opencv feature point detection and matching
2/14 (regular expression, sed streaming editor)
The 2022 global software R & D technology conference was released, and world-class masters such as Turing prize winners attended
Gorilla/mux framework (RK boot): add tracing Middleware
Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
The difference between SRAM and DRAM
How to solve the problem of requiring a password when accessing your network neighborhood on your computer
Sort merge sort
Teach you how to run two or more MySQL databases at the same time in one system
Format cluster and start cluster
随机推荐
Selenium check box
webAssembly
X Opencv feature point detection and matching
Pat grade A - 1164 good in C (20 points)
2022.02.13
[note] glide process and source code analysis
Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
finalize finalization finally final
How to quickly build high availability of service discovery
[Android reverse] use DB browser to view and modify SQLite database (download DB browser installation package | install DB browser tool)
Classification and extension of OC
Fluent learning (4) listview
Meta metauniverse female safety problems occur frequently, how to solve the relevant problems in the metauniverse?
Pan Yueming helps Germany's Rochester Zodiac custom wristwatch
[Android reverse] use the DB browser to view and modify the SQLite database (copy the database file from the Android application data directory | use the DB browser tool to view the data block file)
Leetcode week 4: maximum sum of arrays (shape pressing DP bit operation)
Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
Go error collection | talk about the difference between the value type and pointer type of the method receiver
Druids connect to mysql8.0.11
User login function: simple but difficult