当前位置:网站首页>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 .
边栏推荐
- EPF: a fuzzy testing framework for network protocols based on evolution, protocol awareness and coverage guidance
- Teach you how to run two or more MySQL databases at the same time in one system
- [note] glide process and source code analysis
- In 2022, 6G development has indeed warmed up
- "Learning notes" recursive & recursive
- Go error collection | talk about the difference between the value type and pointer type of the method receiver
- Hcip day 14 notes
- Creation of the template of the password management software keepassdx
- 2022 examination of safety production management personnel of hazardous chemical production units and examination skills of safety production management personnel of hazardous chemical production unit
- Pandaoxi's video
猜你喜欢

The overseas listing of Shangmei group received feedback, and brands such as Han Shu and Yiye have been notified for many times and received attention

Design of logic level conversion in high speed circuit

Pyqt5 sensitive word detection tool production, operator's Gospel
![[Happy Valentine's day]](/img/d9/9280398eb64907a567df6eea772adb.jpg)
[Happy Valentine's day] "I still like you very much, like sin ² a+cos ² A consistent "(white code in the attached table)

In 2022, 6G development has indeed warmed up

Cgb2201 preparatory class evening self-study and lecture content

Gorilla/mux framework (RK boot): add tracing Middleware

Leetcode week 4: maximum sum of arrays (shape pressing DP bit operation)

Fluent learning (4) listview

Exclusive download! Alibaba cloud native brings 10 + technical experts to bring "new possibilities of cloud native and cloud future"
随机推荐
Sword finger offer day 4 (Sword finger offer 03. duplicate numbers in the array, sword finger offer 53 - I. find the number I in the sorted array, and the missing numbers in sword finger offer 53 - ii
Pan Yueming helps Germany's Rochester Zodiac custom wristwatch
Creation of the template of the password management software keepassdx
Text replacement demo
Hcip 13th day notes
Leetcode: a single element in an ordered array
Pyqt5 sensitive word detection tool production, operator's Gospel
Es6~es12 knowledge sorting and summary
In 2022, 6G development has indeed warmed up
Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
Weekly leetcode - nc9/nc56/nc89/nc126/nc69/nc120
Pat grade A - 1164 good in C (20 points)
C # basic knowledge (1)
Gorilla/mux framework (RK boot): add tracing Middleware
How to solve the problem of computer networking but showing no Internet connection
Interpretation of corolla sub low configuration, three cylinder power configuration, CVT fuel saving and smooth, safety configuration is in place
How to solve win10 black screen with only mouse arrow
IO flow review
Teach you how to run two or more MySQL databases at the same time in one system
Interesting 10 CMD commands