 Numerically Speaking

Description
A developer of crossword puzzles (and other similar word games) has decided to develop a mapping between every possible word with from one to twenty characters and unique integers. The mapping is very simple, with the ordering being done first by the length of the word, and then alphabetically. Part of the list is shown below.
a 1 b 2 ... z 26 aa 27 ab 28 ... snowfall 157,118,051,752 ...
Your job in this problem is to develop a program which can translate, bidirectionally, between the unique word numbers and the corresponding words.
InputInput to the program is a list of words and numbers, one per line starting in column one, followed by a line containing a single asterisk in column one. A number will consist only of decimal digits (0 through 9) followed immediately by the end of line (that is, there will be no commas in input numbers). A word will consist of between one and twenty lowercase alphabetic characters (a through z).
OutputThe output is to contain a single line for each word or number in the input data. This line is to contain the word starting in column one, followed by an appropriate number of blanks, and the corresponding word number starting in column 23. Word numbers that have more than three digits must be separated by commas at thousands, millions, and so forth.
Sample Input29697684282993
transcendental
28011622636823854456520
computationally
zzzzzzzzzzzzzzzzzzzz
*
Sample Outputelementary 29,697,684,282,993
transcendental 51,346,529,199,396,181,750
prestidigitation 28,011,622,636,823,854,456,520
computationally 232,049,592,627,851,629,097
zzzzzzzzzzzzzzzzzzzz 20,725,274,851,017,785,518,433,805,270
Basically Speaking _course
20171015Description The Really Neato Calculator Company, Inc. has recently hired your team to help design their Super Neato Model I calculator. As a computer scientist you suggested to the company that it would be neato if this new calculator could convert among number bases. The company thought this was a stupendous idea and has asked your team to come up with the prototype program for doing base conversion. The project manager of the Super Neato Model I calculator has informed you that the calculator will have the following neato features: It will have a 7digital display. Its buttons will include the capital letters A through F in addition to the digits 0 through 9. It will support bases 2 through 16. Input The input for your prototype program will consist of one base conversion per line. There will be three numbers per line. The first number will be the number in the base you are converting from. The second number is the base you are converting from. The third number is the base you are converting to. There will be one or more blanks surrounding (on either side of) the numbers. There are several lines of input and your program should continue to read until the end of file is reached. Output The output will only be the converted number as it would appear on the display of the calculator. The number should be right justified in the 7digit display. If the number is to large to appear on the display, then print ``ERROR'' (without the quotes) right justified in the display. Sample Input 1111000 2 10 1111000 2 16 2102101 3 10 2102101 3 15 12312 4 2 1A 15 2 1234567 10 16 ABCD 16 15 Sample Output 120 78 1765 7CA ERROR 11001 12D687 D071
Numerically Speaking _course
20171011Description A developer of crossword puzzles (and other similar word games) has decided to develop a mapping between every possible word with from one to twenty characters and unique integers. The mapping is very simple, with the ordering being done first by the length of the word, and then alphabetically. Part of the list is shown below. a 1 b 2 ... z 26 aa 27 ab 28 ... snowfall 157,118,051,752 ... Your job in this problem is to develop a program which can translate, bidirectionally, between the unique word numbers and the corresponding words. Input Input to the program is a list of words and numbers, one per line starting in column one, followed by a line containing a single asterisk in column one. A number will consist only of decimal digits (0 through 9) followed immediately by the end of line (that is, there will be no commas in input numbers). A word will consist of between one and twenty lowercase alphabetic characters (a through z). Output The output is to contain a single line for each word or number in the input data. This line is to contain the word starting in column one, followed by an appropriate number of blanks, and the corresponding word number starting in column 23. Word numbers that have more than three digits must be separated by commas at thousands, millions, and so forth. Sample Input 29697684282993 transcendental 28011622636823854456520 computationally zzzzzzzzzzzzzzzzzzzz * Sample Output elementary 29,697,684,282,993 transcendental 51,346,529,199,396,181,750 prestidigitation 28,011,622,636,823,854,456,520 computationally 232,049,592,627,851,629,097 zzzzzzzzzzzzzzzzzzzz 20,725,274,851,017,785,518,433,805,270
Afshung Pizza Delivery _course
20171027Description AfshungPizza chain, a doortodoor pizza delivery service for Hamedung, a Sildavya district, needs your help for fastest possible pizza delivery plan. With a GIS device that shows all streets of the Hamedung, each delivery boy can find a fast route to deliver the pizza to the place of order. The Elyasung Company that sells and supports this GIS device needs your help to reprogram the device to provide even a faster route plan. Hamedung is a rectangular shape district with many twoway streets that are all rectilinear. To show the map, the GIS device uses text characters as shown in the sample test data. In this format, each one kilometer of a street is shown by a dash () or a pipe () showing that the street is either in westeast or in northsouth direction. A plus (+) on the map indicates a sharp 90 degree turn (with length zero) on that position without any traffic light. All such turns are marked with +. An intersection is shown by an integer τ on that position. τ is the timing of the traffic light at that intersection which can be either three or four way. To have a smooth and accidentfree district, the municipality of Hamedung has forced that every traffic light has only one green light and two or three red lights for three or four intersections respectively. One of the lights in that intersection remains green for τ minutes (i.e., during [x, x + τ) time for some x) and others are red. In the next τ minutes, one other direction turns green as if the green light turns counter clockwise. This rule is observed in all intersections. The time is set to zero at the beginning when the delivery boy starts moving. At this time, all traffic signals are set such that only the southern light (or the northern light if no southern light exists) of each intersection is set to green, and other lights at this intersection are set to red. Note that the only positions that the driver can change his direction are: a turn (+), or an intersection (represented by a digit). As an example, if we have a pattern like  in the map, the driver cannot cross the pipe if he is moving from left to right or right to left, neither can he turn left or right, since there is no intersection at this location. Given the complete map described above, the location of an AfshungPizza branch, marked by S, and the location of the final delivery place, marked by D, you are to write a program for GIS device to automatically find the fastest possible route to deliver pizza from S to D. Note the following assumptions: S and D are parts of a street (replacing either a  or ) S and D are not adjacent to any intersection or turn. S and D are not adjacent to each other. Intersections and/or turns are at least one kilometer apart. 'S', 'D', '+', and each digit have zero kilometer length. Speed of delivery boy is one kilometer per minute. Traffic that faces a green light can move in all directions. No straight move or turns are allowed at red light. There is no traffic jam or other obstacles on the way. Asterisk characters (*) show the border of the district. Input The first line of the input file contains a single integer t (1 <= t <= 10), the number of test cases, followed by the input data for each test case. The first line of each test case contains two integer numbers: N (1<= N <= 100) the number of rows of the map, and M (2 <= M <= 100) the number of columns of the map. Followed by the first line, there will be N lines, each containing a string of length M, consisting of '', '', '+', ' ', '*', 'S', 'D' or digits from '1' to '9'. Also, assume that the total number of intersections and turns (+) is at most 100. Output There should be one line in the output per test case containing a single number, the minimum time to drive from S to D, if there exists, otherwise the word impossible (with lowercase letters). Sample Input 1 10 10 ********** *D3+* *  * *  ++* *  * *41 * *   * *   * *S2+ * ********** Sample Output 15
Here We Go(relians) Again _course
20170102Description The Gorelians are a warlike race that travel the universe conquering new worlds as a form of recreation. Given their violent, funloving nature, keeping their leaders alive is of serious concern. Part of the Gorelian security plan involves changing the traffic patterns of their cities on a daily basis, and routing all Gorelian Government Officials to the Government Building by the fastest possible route. Fortunately for the Gorelian Minister of Traffic (that would be you), all Gorelian cities are laid out as a rectangular grid of blocks, where each block is a square measuring 2520 rels per side (a rel is the Gorelian Official Unit of Distance). The speed limit between two adjacent intersections is always constant, and may range from 1 to 9 rels per blip (a blip, of course, being the Gorelian Official Unit of Time). Since Gorelians have outlawed decimal numbers as unholy (hey, if you're the dominant force in the known universe, you can outlaw whatever you want), speed limits are always integer values. This explains why Gorelian blocks are precisely 2520 rels in length: 2520 is the least common multiple of the integers 1 through 9. Thus, the time required to travel between two adjacent intersections is always an integer number of blips. In all Gorelian cities, Government Housing is always at the northwest corner of the city, while the Government Building is always at the southeast corner. Streets between intersections might be oneway or twoway, or possibly even closed for repair (all this tinkering with traffic patterns causes a lot of accidents). Your job, given the details of speed limits, street directions, and street closures for a Gorelian city, is to determine the fastest route from Government Housing to the Government Building. (It is possible, due to street directions and closures, that no route exists, in which case a Gorelian Official Temporary Holiday is declared, and the Gorelian Officials take the day off.) ![](http://poj.org/images/3653_1.png) Gorelian city The picture above shows a Gorelian City marked with speed limits, one way streets, and one closed street. It is assumed that streets are always traveled at the exact posted speed limit, and that turning a corner takes zero time. Under these conditions, you should be able to determine that the fastest route from Government Housing to the Government Building in this city is 1715 blips. And if the next day, the only change is that the closed road is opened to two way traffic at 9 rels per blip, the fastest route becomes 1295 blips. On the other hand, suppose the three oneway streets are switched from southbound to northbound (with the closed road remaining closed). In that case, no route would be possible and the day would be declared a holiday. Input The input consists of a set of cities for which you must find a fastest route if one exists. The first line of an input case contains two integers, which are the vertical and horizontal number of city blocks, respectively. The smallest city is a single block, or 1 by 1, and the largest city is 20 by 20 blocks. The remainder of the input specifies speed limits and traffic directions for streets between intersections, one row of street segments at a time. The first line of the input (after the dimensions line) contains the data for the northernmost eastwest street segments. The next line contains the data for the northernmost row of northsouth street segments. Then the next row of eastwest streets, then northsouth streets, and so on, until the southernmost row of eastwest streets. Speed limits and directions of travel are specified in order from west to east, and each consists of an integer from 0 to 9 indicating speed limit, and a symbol indicating which direction traffic may flow. A zero speed limit means the road is closed. All digits and symbols are delimited by a single space. For eastwest streets, the symbol will be an asterisk '*' which indicates travel is allowed in both directions, a lessthan symbol '<' which indicates travel is allowed only in an easttowest direction, or a greaterthan symbol '>' which indicates travel is allowed only in a westtoeast direction. For northsouth streets, an asterisk again indicates travel is allowed in either direction, a lowercase "vee" character 'v' indicates travel is allowed only in a northtosouth directions, and a caret symbol '^' indicates travel is allowed only in a southtonorth direction. A zero speed, indicating a closed road, is always followed by an asterisk. Input cities continue in this manner until a value of zero is specified for both the vertical and horizontal dimensions. Output For each input scenario, output a line specifying the integer number of blips of the shortest route, a space, and then the word "blips". For scenarios which have no route, output a line with the word "Holiday". Sample Input 2 2 9 * 9 * 6 v 0 * 8 v 3 * 7 * 3 * 6 v 3 * 4 * 8 * 2 2 9 * 9 * 6 v 9 * 8 v 3 * 7 * 3 * 6 v 3 * 4 * 8 * 2 2 9 * 9 * 6 ^ 0 * 8 ^ 3 * 7 * 3 * 6 ^ 3 * 4 * 8 * 0 0 Sample Output 1715 blips 1295 blips Holiday
Here We Go(relians) Again_course
20170523Problem Description The Gorelians are a warlike race that travel the universe conquering new worlds as a form of recreation. Given their violent, funloving nature, keeping their leaders alive is of serious concern. Part of the Gorelian security plan involves changing the traffic patterns of their cities on a daily basis, and routing all Gorelian Government Officials to the Government Building by the fastest possible route. Fortunately for the Gorelian Minister of Traffic (that would be you), all Gorelian cities are laid out as a rectangular grid of blocks, where each block is a square measuring 2520 rels per side (a rel is the Gorelian Official Unit of Distance). The speed limit between two adjacent intersections is always constant, and may range from 1 to 9 rels per blip (a blip, of course, being the Gorelian Official Unit of Time). Since Gorelians have outlawed decimal numbers as unholy (hey, if you're the dominant force in the known universe, you can outlaw whatever you want), speed limits are always integer values. This explains why Gorelian blocks are precisely 2520 rels in length: 2520 is the least common multiple of the integers 1 through 9. Thus, the time required to travel between two adjacent intersections is always an integer number of blips. In all Gorelian cities, Government Housing is always at the northwest corner of the city, while the Government Building is always at the southeast corner. Streets between intersections might be oneway or twoway, or possibly even closed for repair (all this tinkering with traffic patterns causes a lot of accidents). Your job, given the details of speed limits, street directions, and street closures for a Gorelian city, is to determine the fastest route from Government Housing to the Government Building. (It is possible, due to street directions and closures, that no route exists, in which case a Gorelian Official Temporary Holiday is declared, and the Gorelian Officials take the day off.) The picture above shows a Gorelian City marked with speed limits, one way streets, and one closed street. It is assumed that streets are always traveled at the exact posted speed limit, and that turning a corner takes zero time. Under these conditions, you should be able to determine that the fastest route from Government Housing to the Government Building in this city is 1715 blips. And if the next day, the only change is that the closed road is opened to two way traffic at 9 rels per blip, the fastest route becomes 1295 blips. On the other hand, suppose the three oneway streets are switched from southbound to northbound (with the closed road remaining closed). In that case, no route would be possible and the day would be declared a holiday. Input The input consists of a set of cities for which you must find a fastest route if one exists. The first line of an input case contains two integers, which are the vertical and horizontal number of city blocks, respectively. The smallest city is a single block, or 1 by 1, and the largest city is 20 by 20 blocks. The remainder of the input specifies speed limits and traffic directions for streets between intersections, one row of street segments at a time. The first line of the input (after the dimensions line) contains the data for the northernmost eastwest street segments. The next line contains the data for the northernmost row of northsouth street segments. Then the next row of eastwest streets, then northsouth streets, and so on, until the southernmost row of eastwest streets. Speed limits and directions of travel are specified in order from west to east, and each consists of an integer from 0 to 9 indicating speed limit, and a symbol indicating which direction traffic may flow. A zero speed limit means the road is closed. All digits and symbols are delimited by a single space. For eastwest streets, the symbol will be an asterisk '*' which indicates travel is allowed in both directions, a lessthan symbol '<' which indicates travel is allowed only in an easttowest direction, or a greaterthan symbol '>' which indicates travel is allowed only in a westtoeast direction. For northsouth streets, an asterisk again indicates travel is allowed in either direction, a lowercase "vee" character 'v' indicates travel is allowed only in a northtosouth directions, and a caret symbol '^' indicates travel is allowed only in a southtonorth direction. A zero speed, indicating a closed road, is always followed by an asterisk. Input cities continue in this manner until a value of zero is specified for both the vertical and horizontal dimensions. Output For each input scenario, output a line specifying the integer number of blips of the shortest route, a space, and then the word "blips". For scenarios which have no route, output a line with the word "Holiday". Sample Input 2 2 9 * 9 * 6 v 0 * 8 v 3 * 7 * 3 * 6 v 3 * 4 * 8 * 2 2 9 * 9 * 6 v 9 * 8 v 3 * 7 * 3 * 6 v 3 * 4 * 8 * 2 2 9 * 9 * 6 ^ 0 * 8 ^ 3 * 7 * 3 * 6 ^ 3 * 4 * 8 * 0 0 Sample Output 1715 blips 1295 blips Holiday
Numerically Speaking 具体实现_course
20200610Description A developer of crossword puzzles (and other similar word games) has decided to develop a mapping between every possible word with from one to twenty characters and unique integers. The mapping is very simple, with the ordering being done first by the length of the word, and then alphabetically. Part of the list is shown below. a 1 b 2 ... z 26 aa 27 ab 28 ... snowfall 157,118,051,752 ... Your job in this problem is to develop a program which can translate, bidirectionally, between the unique word numbers and the corresponding words. Input Input to the program is a list of words and numbers, one per line starting in column one, followed by a line containing a single asterisk in column one. A number will consist only of decimal digits (0 through 9) followed immediately by the end of line (that is, there will be no commas in input numbers). A word will consist of between one and twenty lowercase alphabetic characters (a through z). Output The output is to contain a single line for each word or number in the input data. This line is to contain the word starting in column one, followed by an appropriate number of blanks, and the corresponding word number starting in column 23. Word numbers that have more than three digits must be separated by commas at thousands, millions, and so forth. Sample Input 29697684282993 transcendental 28011622636823854456520 computationally zzzzzzzzzzzzzzzzzzzz * Sample Output elementary 29,697,684,282,993 transcendental 51,346,529,199,396,181,750 prestidigitation 28,011,622,636,823,854,456,520 computationally 232,049,592,627,851,629,097 zzzzzzzzzzzzzzzzzzzz 20,725,274,851,017,785,518,433,805,270
计算运动的水平和垂直方向的速度的问题，怎么使用C语言的程序的代码设计思想的过程来解决？_course
20190617Problem Description The Gorelians are a warlike race that travel the universe conquering new worlds as a form of recreation. Given their violent, funloving nature, keeping their leaders alive is of serious concern. Part of the Gorelian security plan involves changing the traffic patterns of their cities on a daily basis, and routing all Gorelian Government Officials to the Government Building by the fastest possible route. Fortunately for the Gorelian Minister of Traffic (that would be you), all Gorelian cities are laid out as a rectangular grid of blocks, where each block is a square measuring 2520 rels per side (a rel is the Gorelian Official Unit of Distance). The speed limit between two adjacent intersections is always constant, and may range from 1 to 9 rels per blip (a blip, of course, being the Gorelian Official Unit of Time). Since Gorelians have outlawed decimal numbers as unholy (hey, if you're the dominant force in the known universe, you can outlaw whatever you want), speed limits are always integer values. This explains why Gorelian blocks are precisely 2520 rels in length: 2520 is the least common multiple of the integers 1 through 9. Thus, the time required to travel between two adjacent intersections is always an integer number of blips. In all Gorelian cities, Government Housing is always at the northwest corner of the city, while the Government Building is always at the southeast corner. Streets between intersections might be oneway or twoway, or possibly even closed for repair (all this tinkering with traffic patterns causes a lot of accidents). Your job, given the details of speed limits, street directions, and street closures for a Gorelian city, is to determine the fastest route from Government Housing to the Government Building. (It is possible, due to street directions and closures, that no route exists, in which case a Gorelian Official Temporary Holiday is declared, and the Gorelian Officials take the day off.) The picture above shows a Gorelian City marked with speed limits, one way streets, and one closed street. It is assumed that streets are always traveled at the exact posted speed limit, and that turning a corner takes zero time. Under these conditions, you should be able to determine that the fastest route from Government Housing to the Government Building in this city is 1715 blips. And if the next day, the only change is that the closed road is opened to two way traffic at 9 rels per blip, the fastest route becomes 1295 blips. On the other hand, suppose the three oneway streets are switched from southbound to northbound (with the closed road remaining closed). In that case, no route would be possible and the day would be declared a holiday. Input The input consists of a set of cities for which you must find a fastest route if one exists. The first line of an input case contains two integers, which are the vertical and horizontal number of city blocks, respectively. The smallest city is a single block, or 1 by 1, and the largest city is 20 by 20 blocks. The remainder of the input specifies speed limits and traffic directions for streets between intersections, one row of street segments at a time. The first line of the input (after the dimensions line) contains the data for the northernmost eastwest street segments. The next line contains the data for the northernmost row of northsouth street segments. Then the next row of eastwest streets, then northsouth streets, and so on, until the southernmost row of eastwest streets. Speed limits and directions of travel are specified in order from west to east, and each consists of an integer from 0 to 9 indicating speed limit, and a symbol indicating which direction traffic may flow. A zero speed limit means the road is closed. All digits and symbols are delimited by a single space. For eastwest streets, the symbol will be an asterisk '*' which indicates travel is allowed in both directions, a lessthan symbol '<' which indicates travel is allowed only in an easttowest direction, or a greaterthan symbol '>' which indicates travel is allowed only in a westtoeast direction. For northsouth streets, an asterisk again indicates travel is allowed in either direction, a lowercase "vee" character 'v' indicates travel is allowed only in a northtosouth directions, and a caret symbol '^' indicates travel is allowed only in a southtonorth direction. A zero speed, indicating a closed road, is always followed by an asterisk. Input cities continue in this manner until a value of zero is specified for both the vertical and horizontal dimensions. Output For each input scenario, output a line specifying the integer number of blips of the shortest route, a space, and then the word "blips". For scenarios which have no route, output a line with the word "Holiday". Sample Input 2 2 9 * 9 * 6 v 0 * 8 v 3 * 7 * 3 * 6 v 3 * 4 * 8 * 2 2 9 * 9 * 6 v 9 * 8 v 3 * 7 * 3 * 6 v 3 * 4 * 8 * 2 2 9 * 9 * 6 ^ 0 * 8 ^ 3 * 7 * 3 * 6 ^ 3 * 4 * 8 * 0 0 Sample Output 1715 blips 1295 blips Holiday
Here We Go(relians) Again 的思路_course
20191119Problem Description The Gorelians are a warlike race that travel the universe conquering new worlds as a form of recreation. Given their violent, funloving nature, keeping their leaders alive is of serious concern. Part of the Gorelian security plan involves changing the traffic patterns of their cities on a daily basis, and routing all Gorelian Government Officials to the Government Building by the fastest possible route. Fortunately for the Gorelian Minister of Traffic (that would be you), all Gorelian cities are laid out as a rectangular grid of blocks, where each block is a square measuring 2520 rels per side (a rel is the Gorelian Official Unit of Distance). The speed limit between two adjacent intersections is always constant, and may range from 1 to 9 rels per blip (a blip, of course, being the Gorelian Official Unit of Time). Since Gorelians have outlawed decimal numbers as unholy (hey, if you're the dominant force in the known universe, you can outlaw whatever you want), speed limits are always integer values. This explains why Gorelian blocks are precisely 2520 rels in length: 2520 is the least common multiple of the integers 1 through 9. Thus, the time required to travel between two adjacent intersections is always an integer number of blips. In all Gorelian cities, Government Housing is always at the northwest corner of the city, while the Government Building is always at the southeast corner. Streets between intersections might be oneway or twoway, or possibly even closed for repair (all this tinkering with traffic patterns causes a lot of accidents). Your job, given the details of speed limits, street directions, and street closures for a Gorelian city, is to determine the fastest route from Government Housing to the Government Building. (It is possible, due to street directions and closures, that no route exists, in which case a Gorelian Official Temporary Holiday is declared, and the Gorelian Officials take the day off.) The picture above shows a Gorelian City marked with speed limits, one way streets, and one closed street. It is assumed that streets are always traveled at the exact posted speed limit, and that turning a corner takes zero time. Under these conditions, you should be able to determine that the fastest route from Government Housing to the Government Building in this city is 1715 blips. And if the next day, the only change is that the closed road is opened to two way traffic at 9 rels per blip, the fastest route becomes 1295 blips. On the other hand, suppose the three oneway streets are switched from southbound to northbound (with the closed road remaining closed). In that case, no route would be possible and the day would be declared a holiday. Input The input consists of a set of cities for which you must find a fastest route if one exists. The first line of an input case contains two integers, which are the vertical and horizontal number of city blocks, respectively. The smallest city is a single block, or 1 by 1, and the largest city is 20 by 20 blocks. The remainder of the input specifies speed limits and traffic directions for streets between intersections, one row of street segments at a time. The first line of the input (after the dimensions line) contains the data for the northernmost eastwest street segments. The next line contains the data for the northernmost row of northsouth street segments. Then the next row of eastwest streets, then northsouth streets, and so on, until the southernmost row of eastwest streets. Speed limits and directions of travel are specified in order from west to east, and each consists of an integer from 0 to 9 indicating speed limit, and a symbol indicating which direction traffic may flow. A zero speed limit means the road is closed. All digits and symbols are delimited by a single space. For eastwest streets, the symbol will be an asterisk '*' which indicates travel is allowed in both directions, a lessthan symbol '<' which indicates travel is allowed only in an easttowest direction, or a greaterthan symbol '>' which indicates travel is allowed only in a westtoeast direction. For northsouth streets, an asterisk again indicates travel is allowed in either direction, a lowercase "vee" character 'v' indicates travel is allowed only in a northtosouth directions, and a caret symbol '^' indicates travel is allowed only in a southtonorth direction. A zero speed, indicating a closed road, is always followed by an asterisk. Input cities continue in this manner until a value of zero is specified for both the vertical and horizontal dimensions. Output For each input scenario, output a line specifying the integer number of blips of the shortest route, a space, and then the word "blips". For scenarios which have no route, output a line with the word "Holiday". Sample Input 2 2 9 * 9 * 6 v 0 * 8 v 3 * 7 * 3 * 6 v 3 * 4 * 8 * 2 2 9 * 9 * 6 v 9 * 8 v 3 * 7 * 3 * 6 v 3 * 4 * 8 * 2 2 9 * 9 * 6 ^ 0 * 8 ^ 3 * 7 * 3 * 6 ^ 3 * 4 * 8 * 0 0 Sample Output 1715 blips 1295 blips Holiday
Here We Go(relians) Again 代码的算法_course
20200801Problem Description The Gorelians are a warlike race that travel the universe conquering new worlds as a form of recreation. Given their violent, funloving nature, keeping their leaders alive is of serious concern. Part of the Gorelian security plan involves changing the traffic patterns of their cities on a daily basis, and routing all Gorelian Government Officials to the Government Building by the fastest possible route. Fortunately for the Gorelian Minister of Traffic (that would be you), all Gorelian cities are laid out as a rectangular grid of blocks, where each block is a square measuring 2520 rels per side (a rel is the Gorelian Official Unit of Distance). The speed limit between two adjacent intersections is always constant, and may range from 1 to 9 rels per blip (a blip, of course, being the Gorelian Official Unit of Time). Since Gorelians have outlawed decimal numbers as unholy (hey, if you're the dominant force in the known universe, you can outlaw whatever you want), speed limits are always integer values. This explains why Gorelian blocks are precisely 2520 rels in length: 2520 is the least common multiple of the integers 1 through 9. Thus, the time required to travel between two adjacent intersections is always an integer number of blips. In all Gorelian cities, Government Housing is always at the northwest corner of the city, while the Government Building is always at the southeast corner. Streets between intersections might be oneway or twoway, or possibly even closed for repair (all this tinkering with traffic patterns causes a lot of accidents). Your job, given the details of speed limits, street directions, and street closures for a Gorelian city, is to determine the fastest route from Government Housing to the Government Building. (It is possible, due to street directions and closures, that no route exists, in which case a Gorelian Official Temporary Holiday is declared, and the Gorelian Officials take the day off.) The picture above shows a Gorelian City marked with speed limits, one way streets, and one closed street. It is assumed that streets are always traveled at the exact posted speed limit, and that turning a corner takes zero time. Under these conditions, you should be able to determine that the fastest route from Government Housing to the Government Building in this city is 1715 blips. And if the next day, the only change is that the closed road is opened to two way traffic at 9 rels per blip, the fastest route becomes 1295 blips. On the other hand, suppose the three oneway streets are switched from southbound to northbound (with the closed road remaining closed). In that case, no route would be possible and the day would be declared a holiday. Input The input consists of a set of cities for which you must find a fastest route if one exists. The first line of an input case contains two integers, which are the vertical and horizontal number of city blocks, respectively. The smallest city is a single block, or 1 by 1, and the largest city is 20 by 20 blocks. The remainder of the input specifies speed limits and traffic directions for streets between intersections, one row of street segments at a time. The first line of the input (after the dimensions line) contains the data for the northernmost eastwest street segments. The next line contains the data for the northernmost row of northsouth street segments. Then the next row of eastwest streets, then northsouth streets, and so on, until the southernmost row of eastwest streets. Speed limits and directions of travel are specified in order from west to east, and each consists of an integer from 0 to 9 indicating speed limit, and a symbol indicating which direction traffic may flow. A zero speed limit means the road is closed. All digits and symbols are delimited by a single space. For eastwest streets, the symbol will be an asterisk '*' which indicates travel is allowed in both directions, a lessthan symbol '<' which indicates travel is allowed only in an easttowest direction, or a greaterthan symbol '>' which indicates travel is allowed only in a westtoeast direction. For northsouth streets, an asterisk again indicates travel is allowed in either direction, a lowercase "vee" character 'v' indicates travel is allowed only in a northtosouth directions, and a caret symbol '^' indicates travel is allowed only in a southtonorth direction. A zero speed, indicating a closed road, is always followed by an asterisk. Input cities continue in this manner until a value of zero is specified for both the vertical and horizontal dimensions. Output For each input scenario, output a line specifying the integer number of blips of the shortest route, a space, and then the word "blips". For scenarios which have no route, output a line with the word "Holiday". Sample Input 2 2 9 * 9 * 6 v 0 * 8 v 3 * 7 * 3 * 6 v 3 * 4 * 8 * 2 2 9 * 9 * 6 v 9 * 8 v 3 * 7 * 3 * 6 v 3 * 4 * 8 * 2 2 9 * 9 * 6 ^ 0 * 8 ^ 3 * 7 * 3 * 6 ^ 3 * 4 * 8 * 0 0 Sample Output 1715 blips 1295 blips Holiday
Here We Go(relians) Again 代码编写和实现_course
20191221Problem Description The Gorelians are a warlike race that travel the universe conquering new worlds as a form of recreation. Given their violent, funloving nature, keeping their leaders alive is of serious concern. Part of the Gorelian security plan involves changing the traffic patterns of their cities on a daily basis, and routing all Gorelian Government Officials to the Government Building by the fastest possible route. Fortunately for the Gorelian Minister of Traffic (that would be you), all Gorelian cities are laid out as a rectangular grid of blocks, where each block is a square measuring 2520 rels per side (a rel is the Gorelian Official Unit of Distance). The speed limit between two adjacent intersections is always constant, and may range from 1 to 9 rels per blip (a blip, of course, being the Gorelian Official Unit of Time). Since Gorelians have outlawed decimal numbers as unholy (hey, if you're the dominant force in the known universe, you can outlaw whatever you want), speed limits are always integer values. This explains why Gorelian blocks are precisely 2520 rels in length: 2520 is the least common multiple of the integers 1 through 9. Thus, the time required to travel between two adjacent intersections is always an integer number of blips. In all Gorelian cities, Government Housing is always at the northwest corner of the city, while the Government Building is always at the southeast corner. Streets between intersections might be oneway or twoway, or possibly even closed for repair (all this tinkering with traffic patterns causes a lot of accidents). Your job, given the details of speed limits, street directions, and street closures for a Gorelian city, is to determine the fastest route from Government Housing to the Government Building. (It is possible, due to street directions and closures, that no route exists, in which case a Gorelian Official Temporary Holiday is declared, and the Gorelian Officials take the day off.) The picture above shows a Gorelian City marked with speed limits, one way streets, and one closed street. It is assumed that streets are always traveled at the exact posted speed limit, and that turning a corner takes zero time. Under these conditions, you should be able to determine that the fastest route from Government Housing to the Government Building in this city is 1715 blips. And if the next day, the only change is that the closed road is opened to two way traffic at 9 rels per blip, the fastest route becomes 1295 blips. On the other hand, suppose the three oneway streets are switched from southbound to northbound (with the closed road remaining closed). In that case, no route would be possible and the day would be declared a holiday. Input The input consists of a set of cities for which you must find a fastest route if one exists. The first line of an input case contains two integers, which are the vertical and horizontal number of city blocks, respectively. The smallest city is a single block, or 1 by 1, and the largest city is 20 by 20 blocks. The remainder of the input specifies speed limits and traffic directions for streets between intersections, one row of street segments at a time. The first line of the input (after the dimensions line) contains the data for the northernmost eastwest street segments. The next line contains the data for the northernmost row of northsouth street segments. Then the next row of eastwest streets, then northsouth streets, and so on, until the southernmost row of eastwest streets. Speed limits and directions of travel are specified in order from west to east, and each consists of an integer from 0 to 9 indicating speed limit, and a symbol indicating which direction traffic may flow. A zero speed limit means the road is closed. All digits and symbols are delimited by a single space. For eastwest streets, the symbol will be an asterisk '*' which indicates travel is allowed in both directions, a lessthan symbol '<' which indicates travel is allowed only in an easttowest direction, or a greaterthan symbol '>' which indicates travel is allowed only in a westtoeast direction. For northsouth streets, an asterisk again indicates travel is allowed in either direction, a lowercase "vee" character 'v' indicates travel is allowed only in a northtosouth directions, and a caret symbol '^' indicates travel is allowed only in a southtonorth direction. A zero speed, indicating a closed road, is always followed by an asterisk. Input cities continue in this manner until a value of zero is specified for both the vertical and horizontal dimensions. Output For each input scenario, output a line specifying the integer number of blips of the shortest route, a space, and then the word "blips". For scenarios which have no route, output a line with the word "Holiday". Sample Input 2 2 9 * 9 * 6 v 0 * 8 v 3 * 7 * 3 * 6 v 3 * 4 * 8 * 2 2 9 * 9 * 6 v 9 * 8 v 3 * 7 * 3 * 6 v 3 * 4 * 8 * 2 2 9 * 9 * 6 ^ 0 * 8 ^ 3 * 7 * 3 * 6 ^ 3 * 4 * 8 * 0 0 Sample Output 1715 blips 1295 blips Holiday
Here We Go(relians) Again 的思路的问题_course
20200107Problem Description The Gorelians are a warlike race that travel the universe conquering new worlds as a form of recreation. Given their violent, funloving nature, keeping their leaders alive is of serious concern. Part of the Gorelian security plan involves changing the traffic patterns of their cities on a daily basis, and routing all Gorelian Government Officials to the Government Building by the fastest possible route. Fortunately for the Gorelian Minister of Traffic (that would be you), all Gorelian cities are laid out as a rectangular grid of blocks, where each block is a square measuring 2520 rels per side (a rel is the Gorelian Official Unit of Distance). The speed limit between two adjacent intersections is always constant, and may range from 1 to 9 rels per blip (a blip, of course, being the Gorelian Official Unit of Time). Since Gorelians have outlawed decimal numbers as unholy (hey, if you're the dominant force in the known universe, you can outlaw whatever you want), speed limits are always integer values. This explains why Gorelian blocks are precisely 2520 rels in length: 2520 is the least common multiple of the integers 1 through 9. Thus, the time required to travel between two adjacent intersections is always an integer number of blips. In all Gorelian cities, Government Housing is always at the northwest corner of the city, while the Government Building is always at the southeast corner. Streets between intersections might be oneway or twoway, or possibly even closed for repair (all this tinkering with traffic patterns causes a lot of accidents). Your job, given the details of speed limits, street directions, and street closures for a Gorelian city, is to determine the fastest route from Government Housing to the Government Building. (It is possible, due to street directions and closures, that no route exists, in which case a Gorelian Official Temporary Holiday is declared, and the Gorelian Officials take the day off.) The picture above shows a Gorelian City marked with speed limits, one way streets, and one closed street. It is assumed that streets are always traveled at the exact posted speed limit, and that turning a corner takes zero time. Under these conditions, you should be able to determine that the fastest route from Government Housing to the Government Building in this city is 1715 blips. And if the next day, the only change is that the closed road is opened to two way traffic at 9 rels per blip, the fastest route becomes 1295 blips. On the other hand, suppose the three oneway streets are switched from southbound to northbound (with the closed road remaining closed). In that case, no route would be possible and the day would be declared a holiday. Input The input consists of a set of cities for which you must find a fastest route if one exists. The first line of an input case contains two integers, which are the vertical and horizontal number of city blocks, respectively. The smallest city is a single block, or 1 by 1, and the largest city is 20 by 20 blocks. The remainder of the input specifies speed limits and traffic directions for streets between intersections, one row of street segments at a time. The first line of the input (after the dimensions line) contains the data for the northernmost eastwest street segments. The next line contains the data for the northernmost row of northsouth street segments. Then the next row of eastwest streets, then northsouth streets, and so on, until the southernmost row of eastwest streets. Speed limits and directions of travel are specified in order from west to east, and each consists of an integer from 0 to 9 indicating speed limit, and a symbol indicating which direction traffic may flow. A zero speed limit means the road is closed. All digits and symbols are delimited by a single space. For eastwest streets, the symbol will be an asterisk '*' which indicates travel is allowed in both directions, a lessthan symbol '<' which indicates travel is allowed only in an easttowest direction, or a greaterthan symbol '>' which indicates travel is allowed only in a westtoeast direction. For northsouth streets, an asterisk again indicates travel is allowed in either direction, a lowercase "vee" character 'v' indicates travel is allowed only in a northtosouth directions, and a caret symbol '^' indicates travel is allowed only in a southtonorth direction. A zero speed, indicating a closed road, is always followed by an asterisk. Input cities continue in this manner until a value of zero is specified for both the vertical and horizontal dimensions. Output For each input scenario, output a line specifying the integer number of blips of the shortest route, a space, and then the word "blips". For scenarios which have no route, output a line with the word "Holiday". Sample Input 2 2 9 * 9 * 6 v 0 * 8 v 3 * 7 * 3 * 6 v 3 * 4 * 8 * 2 2 9 * 9 * 6 v 9 * 8 v 3 * 7 * 3 * 6 v 3 * 4 * 8 * 2 2 9 * 9 * 6 ^ 0 * 8 ^ 3 * 7 * 3 * 6 ^ 3 * 4 * 8 * 0 0 Sample Output 1715 blips 1295 blips Holiday
Here We Go(relians) Again 关于路线的问题_course
20200526Problem Description The Gorelians are a warlike race that travel the universe conquering new worlds as a form of recreation. Given their violent, funloving nature, keeping their leaders alive is of serious concern. Part of the Gorelian security plan involves changing the traffic patterns of their cities on a daily basis, and routing all Gorelian Government Officials to the Government Building by the fastest possible route. Fortunately for the Gorelian Minister of Traffic (that would be you), all Gorelian cities are laid out as a rectangular grid of blocks, where each block is a square measuring 2520 rels per side (a rel is the Gorelian Official Unit of Distance). The speed limit between two adjacent intersections is always constant, and may range from 1 to 9 rels per blip (a blip, of course, being the Gorelian Official Unit of Time). Since Gorelians have outlawed decimal numbers as unholy (hey, if you're the dominant force in the known universe, you can outlaw whatever you want), speed limits are always integer values. This explains why Gorelian blocks are precisely 2520 rels in length: 2520 is the least common multiple of the integers 1 through 9. Thus, the time required to travel between two adjacent intersections is always an integer number of blips. In all Gorelian cities, Government Housing is always at the northwest corner of the city, while the Government Building is always at the southeast corner. Streets between intersections might be oneway or twoway, or possibly even closed for repair (all this tinkering with traffic patterns causes a lot of accidents). Your job, given the details of speed limits, street directions, and street closures for a Gorelian city, is to determine the fastest route from Government Housing to the Government Building. (It is possible, due to street directions and closures, that no route exists, in which case a Gorelian Official Temporary Holiday is declared, and the Gorelian Officials take the day off.) The picture above shows a Gorelian City marked with speed limits, one way streets, and one closed street. It is assumed that streets are always traveled at the exact posted speed limit, and that turning a corner takes zero time. Under these conditions, you should be able to determine that the fastest route from Government Housing to the Government Building in this city is 1715 blips. And if the next day, the only change is that the closed road is opened to two way traffic at 9 rels per blip, the fastest route becomes 1295 blips. On the other hand, suppose the three oneway streets are switched from southbound to northbound (with the closed road remaining closed). In that case, no route would be possible and the day would be declared a holiday. Input The input consists of a set of cities for which you must find a fastest route if one exists. The first line of an input case contains two integers, which are the vertical and horizontal number of city blocks, respectively. The smallest city is a single block, or 1 by 1, and the largest city is 20 by 20 blocks. The remainder of the input specifies speed limits and traffic directions for streets between intersections, one row of street segments at a time. The first line of the input (after the dimensions line) contains the data for the northernmost eastwest street segments. The next line contains the data for the northernmost row of northsouth street segments. Then the next row of eastwest streets, then northsouth streets, and so on, until the southernmost row of eastwest streets. Speed limits and directions of travel are specified in order from west to east, and each consists of an integer from 0 to 9 indicating speed limit, and a symbol indicating which direction traffic may flow. A zero speed limit means the road is closed. All digits and symbols are delimited by a single space. For eastwest streets, the symbol will be an asterisk '*' which indicates travel is allowed in both directions, a lessthan symbol '<' which indicates travel is allowed only in an easttowest direction, or a greaterthan symbol '>' which indicates travel is allowed only in a westtoeast direction. For northsouth streets, an asterisk again indicates travel is allowed in either direction, a lowercase "vee" character 'v' indicates travel is allowed only in a northtosouth directions, and a caret symbol '^' indicates travel is allowed only in a southtonorth direction. A zero speed, indicating a closed road, is always followed by an asterisk. Input cities continue in this manner until a value of zero is specified for both the vertical and horizontal dimensions. Output For each input scenario, output a line specifying the integer number of blips of the shortest route, a space, and then the word "blips". For scenarios which have no route, output a line with the word "Holiday". Sample Input 2 2 9 * 9 * 6 v 0 * 8 v 3 * 7 * 3 * 6 v 3 * 4 * 8 * 2 2 9 * 9 * 6 v 9 * 8 v 3 * 7 * 3 * 6 v 3 * 4 * 8 * 2 2 9 * 9 * 6 ^ 0 * 8 ^ 3 * 7 * 3 * 6 ^ 3 * 4 * 8 * 0 0 Sample Output 1715 blips 1295 blips Holiday
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微信小程序 实例汇总 完整项目源代码
Mysql数据库基础入门视频教程
20181024Mysql数据库基础入门视频课程：属于零基础Mysql数据库教程，从数据库的基本专业术语介绍到数据库软件的下载使用 一步一步带你安装MySql。SQL阶段你将学会如果使用数据定义语言DDL,数据操作语言DML,数据查询语言DQL 在学会各中查询语句之后,会带你学习数据的完整性, 掌握如果正确的向数据库中添加数据 以上掌握技能之后,将会带你学习如何进行多表操作,关系的建立,各种连接查询等. 常用函数,事务的学习,您将学到什么是事务的提交,回滚,并发操作及脏读,幻读. 最后视图,存储过程,索引的学习,将会带你掌握更高级的数据库技术.
Python进阶Pandas数据分析库
20181218您观看课程学习后 免费入群领取【超全Python资料包+17本学习电子书】 Pandas是python中非常常用的数据分析库，在数据分析，机器学习，深度学习等领域经常被使用。本课程会讲解到pandas中最核心的一些知识点，包括Series以及DataFrame的构建，赋值，操作，选择数据，合并等等，以及使用pandas对文件进行读取和写入，使用pandas绘图等等。
 65.8MB
java源码包java 源码 大量 实例
20130418Applet钢琴模拟程序java源码 2个目标文件，提供基本的音乐编辑功能。编辑音乐软件的朋友，这款实例会对你有所帮助。 Calendar万年历 1个目标文件 EJB 模拟银行ATM流程及操作源代码
 117B
Keil5安装包
20190523Keil5安装包，附带STM31F1、STM32F4支持包以及破解软件。
 博客 微服务概述
 博客 团队融入度
 下载 智能一卡通系统整体解决方案
 博客 《红楼梦》中文分词以及绘制词云图
 博客 URL编码表
 下载 ZigBee 技术在无线三表远程抄表系统的应用
 下载 电容式靶式流量计在煤气站发生炉煤气流量测量的应用
 博客 工程导论读书计划表
 下载 虚拟校园漫游系统优化算法研究
 学院 RabbitMQ实战，解决java高并发，MQ企业选型
 学院 FFmpeg4.3开发系列之七：WEB音视频转码器Java版
 下载 vs_community_ENU.exe安装Microsoft Visual C++ 14.0.zip
 下载 2.45G远距离读卡器应用于不停车管理项目
 学院 Android开发  kotlin + jetpack + mvvm
 博客 最大连续和_AizuALDS1_1_D
 博客 【深信服】Python 开发工程师（云计算、网络安全） 【已offer】
 下载 ZigBee 技术在无线三表远程抄表系统的实现
 博客 初探Ultra96v2
 下载 Zend Framework教程之Zend_Controller_Plugin插件用法详解
 学院 Java微信小程序家具家居购物商城 大学生毕业设计教学视频
 学院 JavaWeb家具家居购物商城毕业设计 大学生毕业设计教学视频
 学院 项目管理工具的管理和选用
 下载 远程连接软件SecureCRT
 博客 一道关于 int 的最大值 +1 的题目
 博客 数据结构_Java_递归、汉诺塔问题的理解
 下载 基于低压电力无线集中抄表系统的数据采集终端设计
 学院 【数据分析】量化交易
 下载 三维输电网GIS系统的研究与应用
 下载 PHP Echo字符串的连接格式
 学院 JavaWeb校园图书购物商城毕业设计 大学生毕业设计教学视频