 Servers

Description
The Kingdom of Byteland decided to develop a large computer network of servers offering various services.
The network is built of n servers connected by bidirectional wires. Two servers can be directly connected by at most one wire. Each server can be directly connected to at most 10 other servers and every two servers are connected with some path in the network. Each wire has a fixed positive data transmission time measured in milliseconds. The distance (in milliseconds) d(V,W) between two servers V and W is defined as the length of the shortest (transmission timewise) path connecting V and W in the network. For convenience we let d(V,V)=0 for all V.
Some servers offer more services than others. Therefore each server V is marked with a natural number r(V), called a rank. The bigger the rank the more powerful a server is.
At each server, data about nearby servers should be stored. However, not all servers are interesting. The data about distant servers with low ranks do not have to be stored. More specifically, a server W is interesting for a server V if for every server U such that d(v,U) ≤ d(V,W) we have r(U) ≤ r(W).
For example, all servers of the maximal rank are interesting to all servers. If a server V has the maximal rank, then exactly the servers of the maximal rank are interesting for V. Let B(V) denote the set of servers interesting for a server V.
We want to compute the total amount of data about servers that need to be stored in the network being the total sum of sizes of all sets B(V). The Kingdom of Byteland wanted the data to be quite small so it built the network in such a way that this sum does not exceed 30n.
Write a program that:
reads the description of a server network from the standard input,
computes the total amount of data about servers that need to be stored in the network,
writes the result to the standard output.
InputIn the first line there are two natural numbers n, m, where n is the number of servers in the network (1 <= n <= 30000) and m is the number of wires (1 <= m <= 5n)). The numbers are separated by single space.
In the next n lines the ranks of the servers are given. Line i contains one integer ri (1 <= ri <= 10)  the rank of ith server.
In the following m lines the wires are described. Each wire is described by three numbers a, b, t (11 <= t <= 1000, 1 <= a, b <= n, a ≠ b), where a and b are numbers of the servers connected by the wire and t is the transmission time of the wire in milliseconds.
OutputThe output consists of a single integer equal to the total amount of data about servers that need to be stored in the network.
Sample Input4 3
2
3
1
1
1 4 30
2 3 20
3 4 20
Sample Output9
Analysis Servers连接问题~~_course
20030107建立了服务器以后，本机工作正常，但是远程机器无法连接。报错说： 测试连接失败，因为初始化提供程序时发生错误。由于安全问题，所请求的操作失败 — 未能验证该用户的身份
Servers _course
20170607The Kingdom of Byteland decided to develop a large computer network of servers offering various services. The network is built of n servers connected by bidirectional wires. Two servers can be directly connected by at most one wire. Each server can be directly connected to at most 10 other servers and every two servers are connected with some path in the network. Each wire has a fixed positive data transmission time measured in milliseconds. The distance (in milliseconds) delta(V, W) between two servers V and W is defined as the length of the shortest (transmission timewise) path connecting V and W in the network. For convenience we let delta(V, V ) = 0 for all V. Some servers offer more services than others. Therefore each server V is marked with a natural number r(V), called a rank. The bigger the rank the more powerful a server is. At each server, data about nearby servers should be stored. However, not all servers are interesting. The data about distant servers with low ranks do not have to be stored. More specifically, a server W is interesting for a server V if for every server U such that delta(V, U) <= delta(V, W) we have r(U) <= r(W). For example, all servers of the maximal rank are interesting to all servers. If a server V has the maximal rank, then exactly the servers of the maximal rank are interesting for V . Let B(V) denote the set of servers interesting for a server V. We want to compute the total amount of data about servers that need to be stored in the network being the total sum of sizes of all sets B(V). The Kingdom of Byteland wanted the data to be quite small so it built the network in such a way that this sum does not exceed 30n. Write a program that: > reads the description of a server network from the standard input, > computes the total amount of data about servers that need to be stored in the network, > writes the result to the standard output. Input In the first line there are two natural numbers n, m, where n is the number of servers in the network (1 <= n <= 30,000) and m is the number of wires (1 <= m <= 5n). The numbers are separated by single space. In the next n lines the ranks of the servers are given. Line i contains one integer ri (1 <= ri <= 10)  the rank of ith server. In the following m lines the wires are described. Each wire is described by three numbers a, b, t (1 <= t <= 1000, 1 <= a, b <= n, a != b), where a and b are numbers of the servers connected by the wire and t is the transmission time of the wire in milliseconds. Process to the end of file. Output The output consists of a single integer equal to the total amount of data about servers that need to be stored in the network. Sample Input 4 3 2 3 1 1 1 4 30 2 3 20 3 4 20 Sample Output 9 because B(1) = {1, 2}, B(2) = {2}, B(3) = {2, 3}, B(4) = {1, 2, 3, 4}.
Remmarguts' Date _course
20171016Description "Good man never makes girls wait or breaks an appointment!" said the mandarin duck father. Softly touching his little ducks' head, he told them a story. "Prince Remmarguts lives in his kingdom UDF – United Delta of Freedom. One day their neighboring country sent them Princess Uyuw on a diplomatic mission." "Erenow, the princess sent Remmarguts a letter, informing him that she would come to the hall and hold commercial talks with UDF if and only if the prince go and meet her via the Kth shortest path. (in fact, Uyuw does not want to come at all)" Being interested in the trade development and such a lovely girl, Prince Remmarguts really became enamored. He needs you  the prime minister's help! DETAILS: UDF's capital consists of N stations. The hall is numbered S, while the station numbered T denotes prince' current place. M muddy directed sideways connect some of the stations. Remmarguts' path to welcome the princess might include the same station twice or more than twice, even it is the station with number S or T. Different paths with same length will be considered disparate. Input The first line contains two integer numbers N and M (1 <= N <= 1000, 0 <= M <= 100000). Stations are numbered from 1 to N. Each of the following M lines contains three integer numbers A, B and T (1 <= A, B <= N, 1 <= T <= 100). It shows that there is a directed sideway from Ath station to Bth station with time T. The last line consists of three integer numbers S, T and K (1 <= S, T <= N, 1 <= K <= 1000). Output A single line consisting of a single integer number: the length (time required) to welcome Princess Uyuw using the Kth shortest path. If Kth shortest path does not exist, you should output "1" (without quotes) instead. Sample Input 2 2 1 2 5 2 1 4 1 2 2 Sample Output 14
Number Link _course
20170715Problem Description Number Link is a famous game available in platforms including iOS and Android. Given a board with n rows and m columns, the target of the game is to connect pairs of grids with the same numbers. Once two numbers are paired, the path connecting them will occupy the corresponding grids. The path can only go vertically or horizontally. Note that, no two paths could intersect (by sharing the same grid) in any grid. In this problem, you are going to play a modified version, called Number Link ++. See the picture below for an example. In this new game, you can use two types of paths. Type I is to connect two number grids with different parities (i.e., connect odd number with any other even number). It might be hard to cover the entire grid with only type I path, so we allow type II path, which is a circle path covers only the empty grids (the only special case of type II path is a path only connecting two adjacent empty grids; see the figure above). Since there is no free lunch, we have no free path either. When goes from grid (a,b) to an adjacent grid (c,d), you have to pay for a certain amount of tolls. The cost is the same when goes back from (c,d) to (a,b). Usually the cost of a path is the sum of tolls you paid by traveling along the grids on this path. The only exception is for the special case of type II path. In that case, you have to pay twice the cost (since it is a circle). The total cost of the game is the sum of costs for all the paths. Can you help me figure out the paths so that each grid is on exactly one path? If there exists such solution, what is the minimum possible cost? Input The first line of input consists of an integer T, which is the number of test cases. Each case begins with two integers, n and m, in a line (1≤n,m≤50). The next n lines describe the board. Each line consists of m nonnegative numbers, which describe the status of each column from left to right. If the number is zero, then the grid is empty; otherwise it indicates the number on the corresponding grid. The next n−1 lines each have m nonnegative numbers, which describe the cost of vertical connection. The jth number in ith line is the cost when travels from grid (i,j) to (i+1,j). The next n lines each have m−1 nonnegative numbers, which describe the cost of horizontal connection. The jth number in ith line is the cost for a path to go from grid (i,j) to (i,j+1). All the numbers, including the answer, can be represented using 32bit signed integer. Output For each test case, first output the case number, then output a single number, which is the minimum cost possible to finish the game. When there is no solution available, simply output 1. Sample Input 3 3 3 1 0 0 1 0 0 2 0 2 1 2 1 2 1 1 3 1 5 6 1 4 1 4 1 1 2 2 1 2 3 3 5 0 0 0 0 0 0 5 0 6 0 0 0 0 0 0 1 1000 1000 1000 1 1 1000 1000 1000 1 1 1 1 1 1000 1 1 1000 1 1 1 1 Sample Output Case #1: 10 Case #2: 1 Case #3: 14
python中sys.argv[1:]到底是什么意思呢？_course
201408221 import sys 2 import Image 3 4 for infile in sys.argv[1:]: 5 try: 6 im = Image.open(infile) 7 print infile, im.format, "%dx%d" % im.size, im.mode 8 except IOError: 9 pass 大神们，请问for infile in sys.argv[1:]到底是什么意思呢？新手，请解答简单明了一些，您的回答能帮助我解决燃眉之急！！在此非常之感谢！
Advertisement _course
20171006Description The Department of Recreation has decided that it must be more profitable, and it wants to sell advertising space along a popular jogging path at a local park. They have built a number of billboards (special signs for advertisements) along the path and have decided to sell advertising space on these billboards. Billboards are situated evenly along the jogging path, and they are given consecutive integer numbers corresponding to their order along the path. At most one advertisement can be placed on each billboard. A particular client wishes to purchase advertising space on these billboards but needs guarantees that every jogger will see it's advertisement at least K times while running along the path. However, different joggers run along different parts of the path. Interviews with joggers revealed that each of them has chosen a section of the path which he/she likes to run along every day. Since advertisers care only about billboards seen by joggers, each jogger's personal path can be identified by the sequence of billboards viewed during a run. Taking into account that billboards are numbered consecutively, it is sufficient to record the first and the last billboard numbers seen by each jogger. Unfortunately, interviews with joggers also showed that some joggers don't run far enough to see K billboards. Some of them are in such bad shape that they get to see only one billboard (here, the first and last billboard numbers for their path will be identical). Since outofshape joggers won't get to see K billboards, the client requires that they see an advertisement on every billboard along their section of the path. Although this is not as good as them seeing K advertisements, this is the best that can be done and it's enough to satisfy the client. In order to reduce advertising costs, the client hires you to figure out how to minimize the number of billboards they need to pay for and, at the same time, satisfy stated requirements. Input The first line of the input contains two integers K and N (1 <= K, N <= 1000) separated by a space. K is the minimal number of advertisements that every jogger must see, and N is the total number of joggers. The following N lines describe the path of each jogger. Each line contains two integers Ai and Bi (both numbers are not greater than 10000 by absolute value). Ai represents the first billboard number seen by jogger number i and Bi gives the last billboard number seen by that jogger. During a run, jogger i will see billboards Ai, Bi and all billboards between them. Output On the fist line of the output file, write a single integer M. This number gives the minimal number of advertisements that should be placed on billboards in order to fulfill the client's requirements. Then write M lines with one number on each line. These numbers give (in ascending order) the billboard numbers on which the client's advertisements should be placed. Sample Input 5 10 1 10 20 27 0 3 15 15 8 2 7 30 1 10 27 20 2 9 14 21 Sample Output 19 5 4 3 2 1 0 4 5 6 7 8 15 18 19 20 21 25 26 27
Prime Path _course
20161127![](http://poj.org/images/3126_1.jpg) Description The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the fourdigit room numbers on their offices. — It is a matter of security to change such things every now and then, to keep the enemy in the dark. — But look, I have chosen my number 1033 for good reasons. I am the Prime minister, you know! — I know, so therefore your new number 8179 is also a prime. You will just have to paste four new digits over the four old ones on your office door. — No, it’s not that simple. Suppose that I change the first digit to an 8, then the number will read 8033 which is not a prime! — I see, being the prime minister you cannot stand having a nonprime number on your door even for a few seconds. — Correct! So I must invent a scheme for going from 1033 to 8179 by a path of prime numbers where only one digit is changed from one prime to the next prime. Now, the minister of finance, who had been eavesdropping, intervened. — No unnecessary expenditure, please! I happen to know that the price of a digit is one pound. — Hmm, in that case I need a computer program to minimize the cost. You don't know some very cheap software gurus, do you? — In fact, I do. You see, there is this programming contest going on... Help the prime minister to find the cheapest prime path between any two given fourdigit primes! The first digit must be nonzero, of course. Here is a solution in the case above. 1033 1733 3733 3739 3779 8779 8179 The cost of this solution is 6 pounds. Note that the digit 1 which got pasted over in step 2 can not be reused in the last step – a new 1 must be purchased. Input One line with a positive number: the number of test cases (at most 100). Then for each test case, one line with two numbers separated by a blank. Both numbers are fourdigit primes (without leading zeros). Output One line for each case, either with a number stating the minimal cost or containing the word Impossible. Sample Input 3 1033 8179 1373 8017 1033 1033 Sample Output 6 7 0
Optimal Milking _course
20171010Description FJ has moved his K (1 <= K <= 30) milking machines out into the cow pastures among the C (1 <= C <= 200) cows. A set of paths of various lengths runs among the cows and the milking machines. The milking machine locations are named by ID numbers 1..K; the cow locations are named by ID numbers K+1..K+C. Each milking point can "process" at most M (1 <= M <= 15) cows each day. Write a program to find an assignment for each cow to some milking machine so that the distance the furthestwalking cow travels is minimized (and, of course, the milking machines are not overutilized). At least one legal assignment is possible for all input data sets. Cows can traverse several paths on the way to their milking machine. Input * Line 1: A single line with three spaceseparated integers: K, C, and M. * Lines 2.. ...: Each of these K+C lines of K+C spaceseparated integers describes the distances between pairs of various entities. The input forms a symmetric matrix. Line 2 tells the distances from milking machine 1 to each of the other entities; line 3 tells the distances from machine 2 to each of the other entities, and so on. Distances of entities directly connected by a path are positive integers no larger than 200. Entities not directly connected by a path have a distance of 0. The distance from an entity to itself (i.e., all numbers on the diagonal) is also given as 0. To keep the input lines of reasonable length, when K+C > 15, a row is broken into successive lines of 15 numbers and a potentially shorter line to finish up a row. Each new row begins on its own line. Output A single line with a single integer that is the minimum possible total distance for the furthest walking cow. Sample Input 2 3 2 0 3 2 1 1 3 0 3 2 0 2 3 0 1 0 1 2 1 0 2 1 0 0 2 0 Sample Output 2
Lapux the Floating Island _course
20161221Description ![](http://poj.org/images/2701_1.jpg) In the subtropical Pacific Ocean there is a country consisting of many islands. Its capital, Lapux, is a circular, floating island of radius R0 that always stays in the air at a fixed elevation through some magical application of magnetic forces. There is a very short festival each year at the noon of the summer solstice, when the sun shines directly from above. At this time Lapux moves rapidly over the sea along some polygonal path, casting a shadow right beneath it. (Note: a polygonal path is a path consisting of several straight line segments.) The shadow is enlarged by a circular ring of artificial clouds surrounding Lapux serving some unknown practical and entertainment functions. Because of his predecessors' promise to the people and because of technical reasons, the benign dictator of Lapux always order the engineers to plan for a path and a cloudcontrolling scheme such that Lapux and the clouds never cast a shadow on any part of the islands; the size of the circular disc of shadow remain constant along each segment of the polygonal path, changing only at the vertices, i.e., when it changes directions; the size of the shadow be as large as possible, up to the technical limit of radius R1. You are to help the benign dictator of Lapux verifying that the path proposed by the engineers are indeed feasible, and to calculate the radius of the shadow at each segment of the path. In this problem, islands are represented as polygons, and the path of the center of Lapux as a polygonal line. You can safely assume that all islands are convex and that the path always stays on the sea and never touches any island (but may cross itself). Note thak a polygon P is convex if and only if the line segment joining any pair of points in P is completely contained in P. Consider the example above, where R0 = 10 and R1 = 50. The radius of the shadow can assume the minimum value of 50 during the first segment. During the second segment, the center passes (200, 240), which is only 7.07 <= R0 from the northwest corner of an island, and therefore is infeasible. The radius for the third segment is limited by the distance between the last stop and the southern tip of the triangular island, namely 20.0. Input The input consists of several test cases. Each test case begins with a line of 2 real numbers and 1 integer  R0 the minimum radius, R1 the minimum radius, and n, 1 <= n <= 20 the number of islands. Each of the next n lines represents an island. The first number ni, 3 <= n <= 20 on a line gives the number of vertices of this island. The following ni, pairs of real numbers represent the x and y coordinates of the vertices around the island. The next line gives the path. The first number m, 2 <= m <= 20 gives the number of vertices of the path. The following m pairs of real numbers represent the x and ycoordinates of the vertices along the path. The last test case is followed by a line consisting of three zeros. Every real number t in the input file has at most one digit after the decimal point and −9999.9 <= t <= 9999.9. Output Print the result of each test case on one line. For a test case with an mvertex path, print m − 1 integers, in order, each representing the desired radius (rounded to the decimal point) during that segment of flight. If the desired radius is impossible for a segment (less than R0), print '0' for that segment. Round all numbers to integers. Sample Input 10 50 3 3 220.0 360.0 240.0 380.0 200.0 380.0 4 205.0 235.0 240.0 220.0 240.0 200.0 220.0 200.0 4 60.0 340.0 120.0 280.0 180.0 340.0 120.0 400.0 4 20.0 200.0 160.0 200.0 220.0 260.0 220.0 340.0 0 0 0 Sample Output 50 0 20
Enigmatic Travel _course
20171017Description Suhan and Laina live in an ndimensional city where there are (n+1) locations. Any two locations (consider these locations as points) are equidistant from each other and connected by only one bidirectional road. They love to roam together around the city on their favourite biverbal (A kind of vehicle). Kiri, a tenth generation robot also lives in the same city and wants to kill Suhan out of jealousy. That is why Suhan and Laina are very careful about keeping their thoughts and plans secret. Therefore nobody knows a) Where Suhan and Laina lives. b) What their destination location is. c) Which roads will they use? So their journey can start from any location, ends in another location and they may use any road sequence they like. Their destination location may be same or different than the source location. For example when their tour is guaranteed to be a simple cycle their source and destination location are same. Given the number of locations in the city (L) you will have to find the expected cost (often considered as average) of one of their single travelling. You can assume that the cost of travelling from one location to another through the direct (also shortest) path is 1 universal joule. Input The input file contains several lines of input. Each line contains a single integer L(15 >= L > 2) that indicates the number of locations in the city. Input is terminated by a line where value of L is zero. This line should not be processed. Output For each line of input produce one line of output. This line contains three floatingpoint numbers F1, F2, F3. Here F1 is the expected cost when they travel along a path, F2 is the expected cost when it is guaranteed that they travel along a simple path and F3 is the expected cost when it is guaranteed that they travel along a simple cycle. All the floatingpoint numbers should be rounded up to four digits after the decimal point. You must assume that their travelling cost is not greater than (L). Travelling cost is always expressed in universal joule. Sample Input 3 4 5 0 Sample Output 2.4286 1.5000 3.0000 3.5500 2.2000 3.5000 4.6716 3.0625 4.2000
Servers _course
20171016Description The Kingdom of Byteland decided to develop a large computer network of servers offering various services. The network is built of n servers connected by bidirectional wires. Two servers can be directly connected by at most one wire. Each server can be directly connected to at most 10 other servers and every two servers are connected with some path in the network. Each wire has a fixed positive data transmission time measured in milliseconds. The distance (in milliseconds) d(V,W) between two servers V and W is defined as the length of the shortest (transmission timewise) path connecting V and W in the network. For convenience we let d(V,V)=0 for all V. Some servers offer more services than others. Therefore each server V is marked with a natural number r(V), called a rank. The bigger the rank the more powerful a server is. At each server, data about nearby servers should be stored. However, not all servers are interesting. The data about distant servers with low ranks do not have to be stored. More specifically, a server W is interesting for a server V if for every server U such that d(v,U) ≤ d(V,W) we have r(U) ≤ r(W). For example, all servers of the maximal rank are interesting to all servers. If a server V has the maximal rank, then exactly the servers of the maximal rank are interesting for V. Let B(V) denote the set of servers interesting for a server V. We want to compute the total amount of data about servers that need to be stored in the network being the total sum of sizes of all sets B(V). The Kingdom of Byteland wanted the data to be quite small so it built the network in such a way that this sum does not exceed 30n. Write a program that: reads the description of a server network from the standard input, computes the total amount of data about servers that need to be stored in the network, writes the result to the standard output. Input In the first line there are two natural numbers n, m, where n is the number of servers in the network (1 <= n <= 30000) and m is the number of wires (1 <= m <= 5n)). The numbers are separated by single space. In the next n lines the ranks of the servers are given. Line i contains one integer ri (1 <= ri <= 10)  the rank of ith server. In the following m lines the wires are described. Each wire is described by three numbers a, b, t (11 <= t <= 1000, 1 <= a, b <= n, a ≠ b), where a and b are numbers of the servers connected by the wire and t is the transmission time of the wire in milliseconds. Output The output consists of a single integer equal to the total amount of data about servers that need to be stored in the network. Sample Input 4 3 2 3 1 1 1 4 30 2 3 20 3 4 20 Sample Output 9
TRAFFIC LIGHTS _course
20170916Description In the city of Dingilville the traffic is arranged in an unusual way. There are junctions and roads connecting the junctions. There is at most one road between any two different junctions. There is no road connecting a junction to itself. Travel time for a road is the same for both directions. At every junction there is a single traffic light that is either blue or purple at any moment. The color of each light alternates periodically: blue for certain duration and then purple for another duration. Traffic is permitted to travel down the road between any two junctions, if and only if the lights at both junctions are the same color at the moment of departing from one junction for the other. If a vehicle arrives at a junction just at the moment the lights switch it must consider the new colors of lights. Vehicles are allowed to wait at the junctions. You are given the city map which shows the travel times for all roads (integers), the durations of the two colors at each junction (integers) and the initial color of the light and the remaining time (integer) for this color to change at each junction. Your task is to find a path which takes the minimum time from a given source junction to a given destination junction for a vehicle when the traffic starts. In case more than one such path exists you are required to report only one of them. Input The first line contains two numbers: The idnumber of the source junction and the idnumber of the destination junction. The second line contains two numbers: N, M. The following N lines contain information on N junctions. The (i+2)’th line of the input file holds information about the junction i : Ci, ric, tiB, tiP where Ci is either ‘B’ or ‘P’, indicating the initial color of the light at the junction i. Finally, the next M lines contain information on M roads. Each line is of the form: i, j, lij where i and j are the idnumbers of the junctions which are connected by this road . 2 <= N <=300 where N is the number of junctions. The junctions are identified by integers 1 through N. These numbers are called idnumbers. 1 <=M <=14,000 where M is the number of roads. 1 <= lij <= 100 where lij is the time required to move from junction i to j using the road that connects i and j. 1 <= tic <= 100 where tic is the duration of the color c for the light at the junction i. The index c is either B for blue or P for purple. 1 <= ric <= tic where ric is the remaining time for the initial color c at junction i. The first line contains two numbers: The idnumber of the source junction and the idnumber of the destination junction. The second line contains two numbers: N, M. The following N lines contain information on N junctions. The (i+2)’th line of the input file holds information about the junction i : Ci, ric, tiB, tiP where Ci is either ‘B’ or ‘P’, indicating the initial color of the light at the junction i. Finally, the next M lines contain information on M roads. Each line is of the form: i, j, lij where i and j are the idnumbers of the junctions which are connected by this road . Output If a path exists: The first line will contain the time taken by a minimumtime path from the source junction to the destination junction. If a path does not exist: A single line containing only the integer 0. Sample Input 1 4 4 5 B 2 16 99 P 6 32 13 P 2 87 4 P 38 96 49 1 2 4 1 3 40 2 3 75 2 4 76 3 4 77 Sample Output 127
Railroad Sort _course
20170325Consider the railroad station that has n deadends designed in a way shown on the picture. Deadends are numbered from right to left, starting from 1. Let 2n railroad cars get from the right. Each car is marked with some integer number ranging from 1 to 2n, different cars are marked with different numbers. You can move the cars through the deadends using the following two operations. If the car x is the first car on the path to the right of the deadend i, you may move this car to this deadend. If the car y is the topmost car in the deadend j you can move it to the path on the left of the deadend. Note, that cars cannot be moved to the deadend from the path to its left and cannot be moved to the path on the right of the deadend they are in. Your task is to rearrange the cars so that the numbers on the cars listed from left to right were in the ascending order and all the cars are to the left of all the deadends. One can prove that the required rearranging is always possible. Input The input contains multiple test cases. Each test case occupies two lines. The first line of each case contains n  the number of deadends (1 <= n <= 13). The second line contains 2n integer numbers  the numbers on the cars, listed from left to right. A case with n = 0 ends up the input file. Output For each case, output the sequence of operations in one line. Each operation is identified with the number of the car moved in this operation. The type of the operation and the deadend used are clearly determined uniquely. Sample Input 2 3 2 1 4 2 1 2 3 4 0 Sample Output 3 3 2 2 1 1 4 4 3 2 1 1 2 3 4 4 1 2 2 1 2 1 3 3 4 4 1 2 3 3 4 4
oracle使用imp导入数据库出问题IMP00009_course
20150726** imp导入数据库中途出错**：（：IMP00009、IMP00027、IMP00003、ORA01013:）；dmp文件大小500G **emp导出日志（部分）**： Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0  Production With the Partitioning, OLAP and Data Mining options Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set About to export specified users ... . exporting preschema procedural objects and actions . exporting foreign function library names for user SHDUCHA . exporting PUBLIC type synonyms . exporting private type synonyms . exporting object type definitions for user SHDUCHA About to export SHDUCHA's objects ... . exporting database links . exporting sequence numbers . exporting cluster definitions . about to export SHDUCHA's tables via Conventional Path ... **imp导出日志（部分）**： Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0  Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Export file created by EXPORT:V10.02.01 via conventional path import done in ZHS16GBK character set and AL16UTF16 NCHAR character set . . . . importing table "TB_I_G_3_106_82_97" 72632 rows imported . . importing table "TB_I_G_3_106_83_101" IMP00009: abnormal end of export file IMP00027: failed to rollback partial import of previous table IMP00003: ORACLE error 1013 encountered ORA01013: user requested cancel of current operation IMP00000: Import terminated unsuccessfully
Color Tunnels _course
20170902A company producing toys has a complex system to paint its products. To obtain the desired color, the product must be painted by several colors in a specified order. A product is painted by moving through color tunnels. For each color there is at least one tunnel that paints with that color, but there may be more. The tunnels are distributed in the painting area and the product must be delivered from one tunnel to another in order to be painted with the given colors. The product is at a certain point in the production plant when painting process starts and must finally be delivered to the product warehouse. More formally, a finished uncolored product is at a certain given point (source point) and must be delivered to another given point (destination point) after being painted with different colors in a given order. There are several tunnels, each is assumed to be a line segment in the plain with a specific color. The colors of the tunnels are not necessarily distinct. Let <c1, c2, ..., cn> be the sequence of n colors that the product is to be painted with. The product is required to pass through tunnels <t1, t2, ... tn> such that the color of ti is ci. Note that it is possible to pass through a tunnel without being painted, so the mentioned <t1, t2, ... tn> may be in fact a subsequence of the tunnels which the product passes through. The direction in which the product passes a tunnel is not important. The goal is to find the shortest path from source to destination subject to the color constraints. The path may cross itself, or even cross a tunnel. Passing twice (or more) through a tunnel is also allowed. Note that two tunnels can cross or overlap but are different. Input The input file contains several test cases. The first line of the input consists of a single integer t (between 1 and 20), the number of test cases. Following the first line is the data for t test cases. The first line of each test case contains four real numbers xs, ys, xt, yt which are x and y coordinates of the source and destination respectively. The second line of the test case contains the color sequence: the first number is the length of the sequence (between 1 and 30), and the rest of the line is the sequence itself. Each color in the sequence is an integer in the range 1...100. The third line contains a single integer n in the range 1...60 which is the number of tunnels followed by n lines each containing five numbers. The first two numbers are the x and y coordinates of one end of the tunnel. The third and fourth numbers are the x and y coordinates of the other end. Coordinates are real numbers. The fifth number is an integer in the range 1...100 representing the color of the tunnel. Output The output file must have t lines, each containing the minimum length of a path from source to destination subject to the constraints of the problem. The length will be compared to optimal length within a precision of three digits after decimal point. Sample Input 1 0 1.5 100 67 4 1 4 3 1 9 10 10 20 20 1 10 15 20.5 35.333 3 30 15 14.55 12.5 1 40 30 44 33 1 29 84 33 58 4 9 39 41 115 2 75 47 37 69 4 46 26 58 25 3 73 48 27 59 3 Sample Output 240.610
Problem Bee _course
20161031Description Imagine a perfectly formed honeycomb, spanning the infinite Cartesian plane. It is an interlocking grid composed of congruent equilateral hexagons. One hexagon is located so that its center is at the origin and has two corners on the Xaxis. A bee must be very careful about how it travels in order not to get lost in the infinite plane. To get from an arbitrary point A to another arbitrary point B, it will first head from A to the exact center of the hexagon in which A is located. Then, it will travel in a straight line to the exact center of an adjacent hexagon. It will move from center to adjacent center until it has reached the hexagon containing point B. At the destination hexagon, it will move from the center to point B. In all cases the bee will take a path of minimal distance that obeys the rules. The figure below demonstrates one possible minimal path from point A to point B. Input Input will be in the form of 5 floating point numbers per line. The first number will be the length, in centimeters, of the sides of the hexagons. The next two numbers will be the x and y coordinates of point A, followed by the x and y coordinates for point B. The input will be terminated by a line containing five zeroes. Neither point A nor point B will ever be exactly on a border between hexagons. Output For each line of the input, output the minimum length of a path from point A to point B, in centimeters, to the nearest .001 centimeters. Sample Input 1.0 3.2 2.2 3.3 0 9 1 4 5 1 0.1 .09 0 .21 0 0 0 0 0 0 Sample Output 7.737 5.000 0.526
Circuit Board _course
20170920On the circuit board, there are lots of circuit paths. We know the basic constrain is that no two path cross each other, for otherwise the board will be burned. Now given a circuit diagram, your task is to lookup if there are some crossed paths. If not find, print "ok!", otherwise "burned!" in one line. A circuit path is defined as a line segment on a plane with two endpoints p1(x1,y1) and p2(x2,y2). You may assume that no two paths will cross each other at any of their endpoints. Input The input consists of several test cases. For each case, the first line contains an integer n(<=2000), the number of paths, then followed by n lines each with four float numbers x1, y1, x2, y2. Output If there are two paths crossing each other, output "burned!" in one line; otherwise output "ok!" in one line. Sample Input 1 0 0 1 1 2 0 0 1 1 0 1 1 0 Sample Output ok! burned!
Border _course
20161120Description You are to write a program that draws a border around a closed path into a bitmap, as displayed in the following figure: ![](http://images.cnblogs.com/cnblogs_com/acmicky/502875/o_1132.png) The path is closed and runs along the grid lines, i.e. between the squares of the grid. The path runs counterclockwise, so if following the path is considered as going ``forward'', the border pixels are always to the "right'' of the path. The bitmap always covers 32 by 32 squares and has its lower left corner at (0, 0). You can safely assume that the path never touches the bounding rectangle of the bitmap and never touches or crosses itself. Note that a bit gets set if it is on the outside of the area surrounded by the path and if at least one of its edges belongs to the path, but not if only one of its corners is in the path. (A look at the convex corners in the figure should clarify that statement.) Input The first line of the input file contains the number of test cases in the file. Each test case that follows consists of two lines. The first line of each case contains two integer numbers x and y specifying the starting point of the path. The second line contains a string of variable length. Every letter in the string symbolizes a move of length one along the grid. Only the letters 'W' ("west"), 'E' ("east"), 'N' ("north"), 'S' ("south"), and '.' ("end of path", no move) appear in the string. The endofpath character ( '.') is immediately followed by the end of the line. Output For each test case, output a line with the number of the case ('Bitmap #1', 'Bitmap #2', etc.). For each row of the bitmap from top to bottom, print a line where you print a character for every bit in that row from left to right. Print an uppercase 'X' for set bits and a period '.' for unset bits. Output a blank line after each bitmap. Sample Input 1 2 1 EENNWNENWWWSSSES.
质数的路径问题 _course
20161128Description The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the fourdigit room numbers on their offices. — It is a matter of security to change such things every now and then, to keep the enemy in the dark. — But look, I have chosen my number 1033 for good reasons. I am the Prime minister, you know! — I know, so therefore your new number 8179 is also a prime. You will just have to paste four new digits over the four old ones on your office door. — No, it’s not that simple. Suppose that I change the first digit to an 8, then the number will read 8033 which is not a prime! — I see, being the prime minister you cannot stand having a nonprime number on your door even for a few seconds. — Correct! So I must invent a scheme for going from 1033 to 8179 by a path of prime numbers where only one digit is changed from one prime to the next prime. Now, the minister of finance, who had been eavesdropping, intervened. — No unnecessary expenditure, please! I happen to know that the price of a digit is one pound. — Hmm, in that case I need a computer program to minimize the cost. You don’t know some very cheap software gurus, do you? — In fact, I do. You see, there is this programming contest going on… Help the prime minister to find the cheapest prime path between any two given fourdigit primes! The first digit must be nonzero, of course. Here is a solution in the case above. 1033 1733 3733 3739 3779 8779 8179 The cost of this solution is 6 pounds. Note that the digit 1 which got pasted over in step 2 can not be reused in the last step – a new 1 must be purchased. Input One line with a positive number: the number of test cases (at most 100). Then for each test case, one line with two numbers separated by a blank. Both numbers are fourdigit primes (without leading zeros). Output One line for each case, either with a number stating the minimal cost or containing the word Impossible. Sample Input 3 1033 8179 1373 8017 1033 1033 Sample Output 6 7 0
Sometimes Na1ve _course
20170922Problem Description Rhason Cheung had a naive problem, and asked Teacher Mai for help. But Teacher Mai thought this problem was too simple, sometimes naive. So she ask you for help. She has a tree with n vertices, numbered from 1 to n. The weight of ith node is wi. You need to support two kinds of operations: modification and query. For a modification operation u,w, you need to change the weight of uth node into w. For a query operation u,v, you should output ∑ni=1∑nj=1f(i,j). If there is a vertex on the path from u to v and the path from i to j in the tree, f(i,j)=wiwj, otherwise f(i,j)=0. The number can be large, so print the number modulo 109+7 Input There are multiple test cases. For each test case, the first line contains two numbers n,m(1≤n,m≤105). There are n numbers in the next line, the ith means wi(0≤wi≤109). Next n−1 lines contain two numbers each, ui and vi, that means that there is an edge between ui and vi. The following are m lines. Each line indicates an operation, and the format is "1 u w"(modification) or "2 u v"(query)(0≤w≤109) Output For each test case, print the answer for each query operation. Sample Input 6 5 1 2 3 4 5 6 1 2 1 3 2 4 2 5 4 6 2 3 5 1 5 6 2 2 3 1 1 7 2 2 4 Sample Output 341 348 612
Carl the Ant _course
20170508Ants leave small chemical trails on the ground in order to mark paths for other ants to follow. Ordinarily these trails follow rather straight lines. But in one ant colony there is an ant named Carl, and Carl is not an ordinary ant. Carl will often zigzag for no apparent reason, sometimes crossing his own path numerous times in the process. When other ants come to an intersection, they always follow the path with the strongest scent, which is the most recent path that leads away from the intersection point. Ants are 1 centimeter long, move and burrow at 1 centimeter per second, and follow their paths exactly (bending at right angles when moving around corners). Ants cannot cross or overlap each other. If two ants meet at the exact same instant at an intersection point, the one that has been on Carl's path the longest has the right of way; otherwise, the ant that has been waiting the longest at an intersection will move first. Carl burrows up from the ground to start at the origin at time 0. He then walks his path and burrows back down into the ground at the endpoint. The rest of the ants follow at regular intervals. Given the description of Carl's path and when the other ants start the path, you are to determine how long it takes the entire set of ants to finish burrowing back into the ground. All the ants are guaranteed to finish. Input Input consists of several test cases. The first line of the input file contains a single integer indicating the number of test cases. The input for each test case starts with a single line containing three positive integers n (1 <= n <= 50), m (1 <= m <= 100), and d (1 <= d <= 100). Here, n is the number of line segments in Carl's path, m is the number of ants traveling the path (including Carl), and d is the time delay before each successive ant's emergence. Carl (who is numbered 0) starts at time 0. The next ant (ant number 1) will emerge at time d, the next at time 2d, and so on. If the burrow is blocked, the ants will emerge as soon as possible in the correct order. Each of the next n lines for the test case consists of a unique integer pair x y (100 <= x, y <= 100), which is the endpoint of a line segment of Carl's path, in the order that Carl travels. The first line starts at the origin (0,0) and the starting point of every subsequent line is the endpoint of the previous line. For simplicity, Carl always travels on line segments parallel to the axes, and no endpoints lie on any segment other than the ones which they serve as an endpoint. Output The output for each case is described as follows: Case C: Carl finished the path at time t1 The ants finished in the following order: a1 a2 a3 ... am The last ant finished the path at time t2 Here, C is the case number (starting at 1), a1 a2 a3 ... am are the ant numbers in the order that they go back underground, and t1 and t2 are the times (in seconds) at which Carl and the last ant finish going underground. You should separate consecutive cases with a single blank line. Sample Input 2 4 7 4 0 4 2 4 2 2 2 2 4 7 2 0 4 2 4 2 2 2 2 Sample Output Case 1: Carl finished the path at time 13 The ants finished in the following order: 0 2 1 3 4 5 6 The last ant finished the path at time 29 Case 2: Carl finished the path at time 13 The ants finished in the following order: 0 4 1 5 2 6 3 The last ant finished the path at time 19
MySQL基础入门视频课程
20181127本课程从零开始，以通俗易懂的方式讲解MySQL技术，手把手教你掌握每一个知识点。课程中使用的所有英文单词都会逐一查询并记录，真正做到零基础入门学习，适合初学者的教程！ 课程内容包括： 1.MySQL简介、安装MySQL 2.查询操作 3.聚合函数和分组统计 4.更新操作 5.表和库的管理 6.约束 7.用户和权限管理 8.事务处理 教学全程采用笔记+代码案例的形式讲解，通俗易懂！！！
 3.64MB
Xshell6完美破解版，亲测可用
20181226Xshell6破解版，亲测可用，分享给大家。直接解压即可使用
Java进阶高手课Java基础编程提升
20200427课程聚焦Java基础编程提升的核心知识点，以真实场景项目实战为导向，循序渐进，深入浅出的了解Java基础编程，讲解Java这门使用广泛的编程语言，助你能够游刃有余地游走在这些技术之中。
Linux系统编程：入门篇视频教程
20181016Linux系统编程视频课程为《Linux系统编程》入门篇，主要针对零基础的Linux开发学员科普Linux系统编程的概念以及需要掌握的各种技能，掌握Linux命令编写、Linux学习路线并熟悉嵌入式设备编程的方法。为后续的Linux系统编程深入学习打下良好的基础。
手把手带你学会Python
20200303当下最火的计算机语言，难道你还只停留知道的阶段吗？快跟着老司机一起起飞吧~ 零基础开始学，只要跟着视频一步一步来，多思考，多练习，我相信你会有质的飞越。 学习路上会很苦，也会很累。但是这些等你学会以后，会发现这些都是值得。 还在等什么？快来学习吧~
 1.16MB
微信小程序 实例汇总 完整项目源代码
20161101微信小程序 实例汇总 完整项目源代码
 下载 分享JavaScript监听全部Ajax请求事件的方法
 博客 20201021
 学院 2020千锋Python入门视频全套全开源（最新版）
 学院 RabbitMQ实战，解决java高并发，MQ企业选型
 博客 微信小程序API
 下载 TwitterDemo.zip
 博客 Java 代理
 学院 成神之路：8小时精通前端HTML5+CSS3
 学院 PHP微信小程序校园图书商城 大学生毕业设计 教学视频
 博客 sql server 临时表
 下载 浅谈jQuery为哪般去掉了浏览器检测
 博客 周金瑞10.21黄金高位震荡美盘能否再创新高？最新行情分析及操作建议
 学院 JavaWeb服装购物商城毕业设计 大学生毕业设计教学视频
 博客 macOS安装Homebrew官网安装
 下载 基础电子中的几种锂电池正极材料的发展与比较
 下载 电源技术中的基于脉冲序列控制技术的降压型开关电源
 下载 教你如何在Node.js中使用jQuery
 下载 基础电子中的如何使用iPad2平板电脑附件功能
 学院 零基础C++程序设计
 下载 电缆销售管理系统 商行天下电缆销售管理系统 v7.3
 下载 openssh8.4p1.zip
 学院 Unity热更新框架基于ILRuntime
 博客 关于 C++ 你应该更新的知识
 学院 程序员的数学通关课
 下载 可修正RF信号的RF预失真
 博客 JavaScriptHTML DOM编程接口（对象，方法，属性）
 学院 Java微信小程序校园图书商城 大学生毕业设计教学视频
 学院 JavaWeb珠宝首饰购物商城毕业设计 大学生毕业设计教学视频
 博客 【开发必备，亲测可用】哪里不会点哪里，有了这些在线工具，开发就是so easy！！！
 学院 【数据分析】 量化交易策略模型