DATA SEGMENT
RESULT DB 2 DUP(?)
DATA ENDS
STACK SEGMENT
DB 200(?)
CODE SEGMENT
MAIN PROC FAR
ASSUME CS:CODE, DS:DATA
START:
PUSH DS
SUB AX,AX
PUSH AX

MOV AX,DATA
MOV DS,AX

MOV BL,0FH
AND BL,AL
PUSH BL
CALL TRANSFER
MOV AH,BL

MOV BL,11110000B
AND BL,AL
MOV CL,4
SHR BL,CL
PUSH BL
CALL TRANSFER
SHL BL,CL

MOV RESULT,AH
MOV RESULT+1,BL

MOV AH,09H
MOV DX,RESULT

INT 21H
RET
MAIN ENDP

TRANSFER:
POP BL
PUSH AX
PUSH CX
PUSH DX

CMP BL,0AH
JB PROCESS1
JNB PROCESS2
PROCESS1:
PUSH BL
JMP QUIT
PROCESS2:
POP AX
POP CX
POP DX
PUSH BL
QUIT:
RET
END TRANSFER

CODE EDNS
END START

fatal error : attemp to access data outside the segment

1个回答

Think I’ll Buy Me a Football Team 状态切换问题
Problem Description Falling Stocks. Bankrupted companies. Banks with no Cash. Seems like the best time to invest: ``Think I'll buy me a football team!" No seriously, I think I have the solution to at least the problem of cash in banks. Banks nowadays are all owing each other great amounts of money and no bank has enough cash to pay other banks' debts even though, on paper at least, they should have enough money to do so. Take for example the inter-bank loans shown in figure (a). The graph shows the amounts owed between four banks (A ...D). For example, A owes B 50M while, at the same time, B owes A 150M. (It is quite common for two banks to owe each other at the same time.) A total amount of 380M in cash is needed to settle all debts between the banks. In an attempt to decrease the need for cash, and after studying the example carefully, I concluded that there's a lot of cash being transferred unnecessarily. Take a look: 1. C owes D the same amount as D owes A, so we can say that C owes A an amount of 30M and get D out of the picture. 2. But since A already owes C 100M, we can say that A owes C an amount of 70M. 3. Similarly, B owes A 100M only, (since A already owes B 50M.) This reduces the above graph to the one shown in figure (b) which reduces the needed cash amount to 190M (A reduction of 200M, or 53%.) 4. I can still do better. Rather than B paying A 100M and A paying 70M to C, B can pay 70M (out of A's 100M) directly to C. This reduces the graph to the one shown in figure (c). Banks can settle all their debts with only 120M in cash. A total reduction of 260M or 68%. Amazing! I have data about inter-bank debts but I can't seem to be able to process it to obtain the minimum amount of cash needed to settle all the debts. Could you please write a program to do that? Input Your program will be tested on one or more test cases. Each test case is specified on N + 1 lines where N < 1, 000 is the number of banks and is specified on the first line. The remaining N lines specifies the inter-bank debts using an N×N adjacency matrix (with zero diagonal) specified in row-major order. The ith row specifies the amounts owed by the ith bank. Amounts are separated by one or more spaces. All amounts are less than 1000. The last line of the input file has a single 0. Output For each test case, print the result using the following format: k . B A where k is the test case number (starting at 1,) is a space character, B is the amount of cash needed before reduction and A is the amount of cash after reduction. Sample Input 4 0 50 100 0 150 0 20 0 0 0 0 30 30 0 0 0 0 Sample Output 1. 380 120
Musical Chairs 音乐链条的问题
Problem Description In the traditional game of Musical Chairs, N + 1 children run around N chairs (placed in a circle) as long as music is playing. The moment the music stops, children run and try to sit on an available chair. The child still standing leaves the game, a chair is removed, and the game continues with N children. The last child to sit is the winner. In an attempt to create a similar game on these days' game consoles, you modify the game in the following manner: N Children are seated on N chairs arranged around a circle. The chairs are numbered from 1 to N . Your program pre-selects a positive number D . The program starts going in circles counting the children starting with the first chair. Once the count reaches D , that child leaves the game, removing his/her chair. The program starts counting again, beginning with the next chair in the circle. The last child remaining in the circle is the winner. For example, consider the game illustrated in the figure above for N = 5 and D = 3 . In the figure, the dot indicates where counting starts and × indicates the child leaving. Starting off, child #3 leaves the game, and counting restarts with child #4. Child #1 is the second child to leave and counting restart with child #2 resulting in child #5 leaving. Child #2 is the last to leave, and child #4 is the winner. Write a program to determine the winning child given both N and D . Input Your program will be tested on one or more test cases. Each test case specifies two positive integers N and D on a single line, separated by one or more spaces, where N, D < 1, 000, 000 . The last line of the input file contains two 0's and is not part of the test cases. Output For each test case, write the winner using the following format: N D W Where N and D are as above, is a space character, and W is the winner of that game. Sample Input 5 3 7 4 0 0 Sample Output 5 3 4 7 4 2
matlab拿别人的程序跑时出现Attempt to reference field of non-structure array.

Crash and Go(relians) 代码的写法
Think I’ll Buy Me a Football Team 球队问题
Problem Description Falling Stocks. Bankrupted companies. Banks with no Cash. Seems like the best time to invest: ``Think I'll buy me a football team!" No seriously, I think I have the solution to at least the problem of cash in banks. Banks nowadays are all owing each other great amounts of money and no bank has enough cash to pay other banks' debts even though, on paper at least, they should have enough money to do so. Take for example the inter-bank loans shown in figure (a). The graph shows the amounts owed between four banks (A ...D). For example, A owes B 50M while, at the same time, B owes A 150M. (It is quite common for two banks to owe each other at the same time.) A total amount of 380M in cash is needed to settle all debts between the banks. In an attempt to decrease the need for cash, and after studying the example carefully, I concluded that there's a lot of cash being transferred unnecessarily. Take a look: 1. C owes D the same amount as D owes A, so we can say that C owes A an amount of 30M and get D out of the picture. 2. But since A already owes C 100M, we can say that A owes C an amount of 70M. 3. Similarly, B owes A 100M only, (since A already owes B 50M.) This reduces the above graph to the one shown in figure (b) which reduces the needed cash amount to 190M (A reduction of 200M, or 53%.) 4. I can still do better. Rather than B paying A 100M and A paying 70M to C, B can pay 70M (out of A's 100M) directly to C. This reduces the graph to the one shown in figure (c). Banks can settle all their debts with only 120M in cash. A total reduction of 260M or 68%. Amazing! I have data about inter-bank debts but I can't seem to be able to process it to obtain the minimum amount of cash needed to settle all the debts. Could you please write a program to do that? Input Your program will be tested on one or more test cases. Each test case is specified on N + 1 lines where N < 1, 000 is the number of banks and is specified on the first line. The remaining N lines specifies the inter-bank debts using an N×N adjacency matrix (with zero diagonal) specified in row-major order. The ith row specifies the amounts owed by the ith bank. Amounts are separated by one or more spaces. All amounts are less than 1000. The last line of the input file has a single 0. Output For each test case, print the result using the following format: k . B A where k is the test case number (starting at 1,) is a space character, B is the amount of cash needed before reduction and A is the amount of cash after reduction. Sample Input 4 0 50 100 0 150 0 20 0 0 0 0 30 30 0 0 0 0 Sample Output 1. 380 120
Cattle 的程序的编写
Description A group of more or less domesticated bovine animals (hereafter to be referred to as cattle) are to be loaded into railway freight cars of certain train. The train consists of K freight cars (and a locomotive, which is kind of irrelevant to this problem), which can be loaded with at most M animals each. A number from 1 to N is painted on each animal (all numbers are used and no two animals carries the same number so by easy induction on N one concludes that there are exactly N animals). The animals are patiently waiting to be loaded in a queue sorted by their numbers in ascending order (1 is the first to be loaded etc.). One freight car is loaded at a time by arbitrary number of animals (not exceeding M, of course) from the beginning of the queue and then locked so no subsequent load of animals to that freight car is possible. The process of loading is continued until all freight cars are locked. It is known that some clashing pairs of animals dislikes each other and if loaded in the same freight car then the stronger one will attempt to kill the other. It is also known that there are friendly pairs of animals where the stronger animal will always successfully protect the weaker one from attack of any other animal. If no alive friendly protecting animal is present, the attack of stronger animal of a clashing pair is always successfull. All attacks in a freight car starts when it is locked. The transportation lasts long enough for all attacks to finish. Write a program that will suggest the loading of animals to the freight cars so that the number of alive animals at the end of transportation will be as large as possible. Input The first line of the input contains three integers N, K, M; 1 <= N,K <= 1000, 1 <= M <= 20. The second line contains integer D – the number of clashing pairs among the animals. Each of the following D lines contains three mutually different integers A, B, C. The pair (A, B) represents a clashing pair, and the pair (C, B) represents a friendly pair of animals. The second animal in each pair is always the weaker one. A stronger animal of a clashing pair cannot be a weaker animal in any other pair (the first number A cannot occur as a second number anywhere). A weaker animal of a clashing pair has exactly one friendly protecting animal (the third number C is uniquely determined by the first two numbers A and B). Output The first and only line of the output consists of an integer – the maximal number of alive animals at the end of transportation. Sample Input 5 2 3 2 1 2 3 1 3 2 Sample Output 5
Snooker Referee 裁判的问题
Problem Description Snooker is a cue sport that is played on a large baize-covered table with pockets in each of the four corners and in the middle of each of the long side cushions. It is played using a cue and snooker balls: one white cue ball, 15 red balls worth one point each, and six balls of different colors: yellow (2 points), green (3), brown (4), blue (5), pink (6) and black (7). A player (or team) wins a frame (individual game) of snooker by scoring more points than the opponent(s), using the cue ball to pot the red and colored balls. In this problem, your job is the referee of snooker. You should score both players, ask the correct player to play next, as well as place some of the balls back to the table if necessary. The rules of snooker needed for this problem are following. (We ignore some fouls about incorrectly hitting the cue ball here. We assume that the cue ball is never snookered after a foul, so free ball will never occur. We also assume that both players will make their best attempts to hit the ball on, so you do not need to declare a miss when they do not hit the ball on first.) At the beginning of each frame the balls are set up by the referee as illustrated above. This will be followed by a break-off shot, the white cue ball can be placed anywhere inside the D (it is called in-hand, which also happens when the cue ball is potted). Players take turns in visiting the table. A break is the number of points scored by a player in one single visit to the table. A player's turn and break end when he fails to pot a ball, when he does something against the rules of the game, which is called a foul, or when a frame has ended. The ball or balls that can be hit first by the white are called the ball(s) "on" for that particular stroke. The ball(s) "on" differ from shot to shot: a red ball, if potted, must be followed by a color, and so on until a break ends; if a red is not potted, any red ball remains the ball "on". Only a ball or balls "on" may be potted legally by a player. If a ball not "on" is potted, this is a foul. The game of snooker generally consists of two phases. The first phase is the situation in which there are still red balls on the table. In the first phase, at the beginning of a player's turn, the balls "on" are all remaining red balls. The player must therefore attempt to first hit and pot one or more red balls. For every red ball potted, the player will receive 1 point. When a red has been potted, it will stay off the table and the player can continue his break. If no red has been potted or a foul has been made, the other player will come into play. In case one or more red balls have been potted, the player can continue his break. This time one of the six colors (yellow, green, brown, blue, pink and black) is the ball "on". Only one of these can be the ball "on" and the rules of the game state that a player must nominate his desired color to the referee, although it is often clear which ball the striker is playing and it is not necessary to nominate. When the nominated color is potted, the player will be awarded the correct number of points (yellow, 2; green, 3; brown, 4; blue, 5; pink, 6; black, 7). The color is then taken out of the pocket by the referee and placed on its original spot. Because only one of the colors is the ball "on", it is a foul to first hit multiple colors at the same time, or pot more than one color. If a player fails to pot a ball "on", it being a red or nominated color, the other player will come into play and the balls "on" are always the reds, as long as there are still reds on the table. The alternation between red balls and colors ends when all reds have been potted and a color is potted after the last red, or a failed attempt to do so is made. Then the second phase begins. All six colors have to be potted in ascending order of their points value (yellow, green, brown, blue, pink, black). Each becomes the ball "on" in that order. During this phase, when potted, the colors stay down and are not replaced on the table, unless a foul is made when potting the color, in which case the color is respotted. When only the black is left, the first score or foul ends the frame, and the player who has scored most points has won it. However, if the score is tied after that, the black is respotted, the players draw lots for choice of playing, the next player plays from in-hand, and the next score or foul ends the frame. When a foul is made during a shot, the player's turn is ended and he will receive no points for the foul shot. The other player will receive penalty points. Colors illegally potted are respotted (while reds are not), and if the cue ball is potted, the next player will play from in-hand. Fouls concerned in this problem are: 。failing to hit any other ball with the cue ball 。first hitting a ball "not-on" with the cue ball 。potting a ball "not-on" 。potting the white (in-off) Penalty points are at least 4 points and at most 7 points. The number of penalty points is the value of the ball "on", or any of the "foul" balls, whichever is highest. When more than one foul is made, the penalty is not the added total - only the most highly valued foul is counted. As players usually do not nominate a color explicitly when hitting the colors, please be tolerant and assume that he always nominate the ball with the lowest score when it cannot be deduced from the ball first hit (i.e. when the cue ball does not hit any ball or hit a red first). If a player commits a foul, and his opponent considers that the position left is unattractive, he may request that the offender play again from the resulting position. Input The input file contains multiple test cases. The first line of the input file is a single integer T (T ≤ 200), the number of test cases. For each test case (frame), the first line contains the names of the two players separated by a whitespace. The first player will take the break-off shot. Each name is made up of no more than 20 English letters, and the two names are different. After that, the input mainly consists of lines that describe a stroke each (with two exceptions stated later). A stroke is described by the color of the ball first hit by the cue ball (or "None" if the cue ball does not hit any ball), followed by zero or more colors of the balls potted, all separated by whitespaces. For example, a line "Red Red White Red" means the cue ball first hit a red ball, and 2 reds are potted as well as the cue ball itself; and a line "None" means the cue ball does not hit any ball thus no ball is potted. You can assume that all strokes are legal according to the balls remain on the table, and the cue ball will not hit two or more ball first simultaneously. A line "Play again" may appear if and only if the last stroke is a foul. It means the other player request that the offender play again from the resulting position. If a score or foul occurs when only the black is left, and the score is tied after that, a line with either player's name will follow. That means the player will play next as a result of the lot. The case end when the frame ends. There is a blank line before every test case. Output For each frame, print a line in the format "Frame K" first, where K is the index of this case starts from 1. Then use the output to indicate the referee's behaviors: 。When a frame begins, print a line in the format "PlayerName's turn, in-hand", where PlayerName is the name of the player who take the break-off shot. 。After each stroke, print a line "Foul!" first if it is a foul. Then print a line with current score in the format "ScoreA : ScoreB", where ScoreA is the score of the player who take the break-off shot, and ScoreB is the other player's score. After that, if the frame continue fairly (i.e. not only black is left before the stroke, or it is not a score or foul when only black is left), and some ball(s) should be respotted. Print a line with the word "Respot" following by the color(s) of the ball(s), all separated by whitespace. If more than one ball should be respotted, print their colors in ascending order of their values. Do not print anything if no ball needed to be respotted. At last (when the frame continue fairly and any necessary ball has been respotted), if the last player's break ends, print a line in the format "PlayerName's turn" to ask the other player to play next, where PlayerName is the next player's name. If the next player should play from in-hand, print "PlayerName's turn, in-hand" instead. 。After a foul, if the other player request that the offender play again, just print a line "PlayerName's turn" or "PlayerName's turn, in-hand" according to whether the cue ball is in-hand, where PlayerName is the offender's name. Note that the requester is actually requesting in his turn, after you asked him to play next. 。If a score or foul occurs when only the black is left, and the score is tied after that, print a line "Tie" after the score. Then print two lines "Respot Black" and "PlayerName's turn, in-hand" to respot the black and play from in-hand, where PlayerName is the next player's name (determined by the lot). 。When the frame ends, print a line "PlayerName wins" after the score, where PlayerName is the winner's name. Print a blank line between every two successive cases. Sample Input 1 Zero Maxbreak Red White Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Sample Output Frame 1 Zero's turn, in-hand Foul! 0 : 4 Maxbreak's turn, in-hand 0 : 5 0 : 12 Respot Black 0 : 13 0 : 20 Respot Black 0 : 21 0 : 28 Respot Black 0 : 29 0 : 36 Respot Black 0 : 37 0 : 44 Respot Black 0 : 45 0 : 52 Respot Black 0 : 53 0 : 60 Respot Black 0 : 61 0 : 68

Snooker Referee 比赛裁判的算法
Problem Description Snooker is a cue sport that is played on a large baize-covered table with pockets in each of the four corners and in the middle of each of the long side cushions. It is played using a cue and snooker balls: one white cue ball, 15 red balls worth one point each, and six balls of different colors: yellow (2 points), green (3), brown (4), blue (5), pink (6) and black (7). A player (or team) wins a frame (individual game) of snooker by scoring more points than the opponent(s), using the cue ball to pot the red and colored balls. In this problem, your job is the referee of snooker. You should score both players, ask the correct player to play next, as well as place some of the balls back to the table if necessary. The rules of snooker needed for this problem are following. (We ignore some fouls about incorrectly hitting the cue ball here. We assume that the cue ball is never snookered after a foul, so free ball will never occur. We also assume that both players will make their best attempts to hit the ball on, so you do not need to declare a miss when they do not hit the ball on first.) At the beginning of each frame the balls are set up by the referee as illustrated above. This will be followed by a break-off shot, the white cue ball can be placed anywhere inside the D (it is called in-hand, which also happens when the cue ball is potted). Players take turns in visiting the table. A break is the number of points scored by a player in one single visit to the table. A player's turn and break end when he fails to pot a ball, when he does something against the rules of the game, which is called a foul, or when a frame has ended. The ball or balls that can be hit first by the white are called the ball(s) "on" for that particular stroke. The ball(s) "on" differ from shot to shot: a red ball, if potted, must be followed by a color, and so on until a break ends; if a red is not potted, any red ball remains the ball "on". Only a ball or balls "on" may be potted legally by a player. If a ball not "on" is potted, this is a foul. The game of snooker generally consists of two phases. The first phase is the situation in which there are still red balls on the table. In the first phase, at the beginning of a player's turn, the balls "on" are all remaining red balls. The player must therefore attempt to first hit and pot one or more red balls. For every red ball potted, the player will receive 1 point. When a red has been potted, it will stay off the table and the player can continue his break. If no red has been potted or a foul has been made, the other player will come into play. In case one or more red balls have been potted, the player can continue his break. This time one of the six colors (yellow, green, brown, blue, pink and black) is the ball "on". Only one of these can be the ball "on" and the rules of the game state that a player must nominate his desired color to the referee, although it is often clear which ball the striker is playing and it is not necessary to nominate. When the nominated color is potted, the player will be awarded the correct number of points (yellow, 2; green, 3; brown, 4; blue, 5; pink, 6; black, 7). The color is then taken out of the pocket by the referee and placed on its original spot. Because only one of the colors is the ball "on", it is a foul to first hit multiple colors at the same time, or pot more than one color. If a player fails to pot a ball "on", it being a red or nominated color, the other player will come into play and the balls "on" are always the reds, as long as there are still reds on the table. The alternation between red balls and colors ends when all reds have been potted and a color is potted after the last red, or a failed attempt to do so is made. Then the second phase begins. All six colors have to be potted in ascending order of their points value (yellow, green, brown, blue, pink, black). Each becomes the ball "on" in that order. During this phase, when potted, the colors stay down and are not replaced on the table, unless a foul is made when potting the color, in which case the color is respotted. When only the black is left, the first score or foul ends the frame, and the player who has scored most points has won it. However, if the score is tied after that, the black is respotted, the players draw lots for choice of playing, the next player plays from in-hand, and the next score or foul ends the frame. When a foul is made during a shot, the player's turn is ended and he will receive no points for the foul shot. The other player will receive penalty points. Colors illegally potted are respotted (while reds are not), and if the cue ball is potted, the next player will play from in-hand. Fouls concerned in this problem are: 。failing to hit any other ball with the cue ball 。first hitting a ball "not-on" with the cue ball 。potting a ball "not-on" 。potting the white (in-off) Penalty points are at least 4 points and at most 7 points. The number of penalty points is the value of the ball "on", or any of the "foul" balls, whichever is highest. When more than one foul is made, the penalty is not the added total - only the most highly valued foul is counted. As players usually do not nominate a color explicitly when hitting the colors, please be tolerant and assume that he always nominate the ball with the lowest score when it cannot be deduced from the ball first hit (i.e. when the cue ball does not hit any ball or hit a red first). If a player commits a foul, and his opponent considers that the position left is unattractive, he may request that the offender play again from the resulting position. Input The input file contains multiple test cases. The first line of the input file is a single integer T (T ≤ 200), the number of test cases. For each test case (frame), the first line contains the names of the two players separated by a whitespace. The first player will take the break-off shot. Each name is made up of no more than 20 English letters, and the two names are different. After that, the input mainly consists of lines that describe a stroke each (with two exceptions stated later). A stroke is described by the color of the ball first hit by the cue ball (or "None" if the cue ball does not hit any ball), followed by zero or more colors of the balls potted, all separated by whitespaces. For example, a line "Red Red White Red" means the cue ball first hit a red ball, and 2 reds are potted as well as the cue ball itself; and a line "None" means the cue ball does not hit any ball thus no ball is potted. You can assume that all strokes are legal according to the balls remain on the table, and the cue ball will not hit two or more ball first simultaneously. A line "Play again" may appear if and only if the last stroke is a foul. It means the other player request that the offender play again from the resulting position. If a score or foul occurs when only the black is left, and the score is tied after that, a line with either player's name will follow. That means the player will play next as a result of the lot. The case end when the frame ends. There is a blank line before every test case. Output For each frame, print a line in the format "Frame K" first, where K is the index of this case starts from 1. Then use the output to indicate the referee's behaviors: 。When a frame begins, print a line in the format "PlayerName's turn, in-hand", where PlayerName is the name of the player who take the break-off shot. 。After each stroke, print a line "Foul!" first if it is a foul. Then print a line with current score in the format "ScoreA : ScoreB", where ScoreA is the score of the player who take the break-off shot, and ScoreB is the other player's score. After that, if the frame continue fairly (i.e. not only black is left before the stroke, or it is not a score or foul when only black is left), and some ball(s) should be respotted. Print a line with the word "Respot" following by the color(s) of the ball(s), all separated by whitespace. If more than one ball should be respotted, print their colors in ascending order of their values. Do not print anything if no ball needed to be respotted. At last (when the frame continue fairly and any necessary ball has been respotted), if the last player's break ends, print a line in the format "PlayerName's turn" to ask the other player to play next, where PlayerName is the next player's name. If the next player should play from in-hand, print "PlayerName's turn, in-hand" instead. 。After a foul, if the other player request that the offender play again, just print a line "PlayerName's turn" or "PlayerName's turn, in-hand" according to whether the cue ball is in-hand, where PlayerName is the offender's name. Note that the requester is actually requesting in his turn, after you asked him to play next. 。If a score or foul occurs when only the black is left, and the score is tied after that, print a line "Tie" after the score. Then print two lines "Respot Black" and "PlayerName's turn, in-hand" to respot the black and play from in-hand, where PlayerName is the next player's name (determined by the lot). 。When the frame ends, print a line "PlayerName wins" after the score, where PlayerName is the winner's name. Print a blank line between every two successive cases. Sample Input 1 Zero Maxbreak Red White Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Red Red Black Black Sample Output Frame 1 Zero's turn, in-hand Foul! 0 : 4 Maxbreak's turn, in-hand 0 : 5 0 : 12 Respot Black 0 : 13 0 : 20 Respot Black 0 : 21 0 : 28 Respot Black 0 : 29 0 : 36 Respot Black 0 : 37 0 : 44 Respot Black 0 : 45 0 : 52 Respot Black 0 : 53 0 : 60 Respot Black 0 : 61 0 : 68
Crash and Go(relians) 怎么实现的
The Embarrassed Cryptographer 的程序的设计
Problem Description The young and very promising cryptographer Odd Even has implemented the security module of a large system with thousands of users, which is now in use in his company. The cryptographic keys are created from the product of two primes, and are believed to be secure because there is no known method for factoring such a product effectively. What Odd Even did not think of, was that both factors in a key should be large, not just their product. It is now possible that some of the users of the system have weak keys. In a desperate attempt not to be fired, Odd Even secretly goes through all the users keys, to check if they are strong enough. He uses his very poweful Atari, and is especially careful when checking his boss' key. Input The input consists of no more than 20 test cases. Each test case is a line with the integers 4 <= K <= 10100 and 2 <= L <= 106. K is the key itself, a product of two primes. L is the wanted minimum size of the factors in the key. The input set is terminated by a case where K = 0 and L = 0. Output For each number K, if one of its factors are strictly less than the required L, your program should output "BAD p", where p is the smallest factor in K. Otherwise, it should output "GOOD". Cases should be separated by a line-break. Sample Input 143 10 143 20 667 20 667 30 2573 30 2573 40 0 0 Sample Output GOOD BAD 11 GOOD BAD 23 GOOD BAD 31
java tomcat dubbo服务关闭失败
MySQL为何无法读取数据？

maven工程报以下错误，初始化失败、监听器出现问题等 这是怎么回事？

debian10.2安装phpstorm2019.3.1时出现了问题，求大佬解答

Java学习的正确打开方式

Python 植物大战僵尸代码实现(2):植物卡片选择和种植

【搞定 Java 并发面试】面试最常问的 Java 并发基础常见面试题总结！

2019年互联网寒冬，大批企业开始裁员，下图是网上流传的一张截图： 裁员不可避免，那如何才能做到不管大环境如何变化，自身不受影响呢？ 我们先来看一个有意思的故事，如果西游记取经团队需要裁员一名，会裁掉谁呢，为什么？ 西游记团队组成： 1.唐僧 作为团队teamleader，有很坚韧的品性和极高的原则性，不达目的不罢休，遇到任何问题，都没有退缩过，又很得上司支持和赏识(直接得到唐太宗的任命，既给
shell脚本：备份数据库、代码上线

iOS Bug 太多，苹果终于坐不住了！

《Neural Networks and Deep Learning》读书笔记第四篇本章其实和前面章节的关联性不大，所以大可将本章作为小短文来阅读，当然基本的深度学习基础还是要有的。主要介绍了神经⽹络拥有的⼀种普遍性，比如说不管目标函数是怎样的，神经网络总是能够对任何可能的输入，其值（或者说近似值）是网络的输出，哪怕是多输入和多输出也是如此，我们大可直接得出一个结论：不论我们想要计算什么样的函数，...

IntelliJ IDEA 简称 IDEA，被业界公认为最好的 Java 集成开发工具，尤其在智能代码助手、代码自动提示、代码重构、代码版本管理(Git、SVN、Maven)、单元测试、代码分析等方面有着亮眼的发挥。IDEA 产于捷克，开发人员以严谨著称的东欧程序员为主。IDEA 分为社区版和付费版两个版本。 我呢，一直是 Eclipse 的忠实粉丝，差不多十年的老用户了。很早就接触到了 IDEA...

Redis 面试题 1、什么是 Redis?. 2、Redis 的数据类型？ 3、使用 Redis 有哪些好处？ 4、Redis 相比 Memcached 有哪些优势？ 5、Memcache 与 Redis 的区别都有哪些？ 6、Redis 是单进程单线程的？ 7、一个字符串类型的值能存储最大容量是多少？ 8、Redis 的持久化机制是什么？各自的优缺点？ 9、Redis 常见性...

【超详细分析】关于三次握手与四次挥手面试官想考我们什么？

Vue快速实现通用表单验证

2019年Spring Boot面试都问了什么？快看看这22道面试题！
Spring Boot 面试题 1、什么是 Spring Boot？ 2、Spring Boot 有哪些优点？ 3、什么是 JavaConfig？ 4、如何重新加载 Spring Boot 上的更改，而无需重新启动服务器？ 5、Spring Boot 中的监视器是什么？ 6、如何在 Spring Boot 中禁用 Actuator 端点安全性？ 7、如何在自定义端口上运行 Sprin...
【图解】记一次手撕算法面试：字节跳动的面试官把我四连击了