Created
October 27, 2012 20:31
-
-
Save dheerajrav/3966052 to your computer and use it in GitHub Desktop.
FAQ cs3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. How is the third test case in the sample test case 1? | |
ans: for the testcase 1 25, only 1 situation is possible. A Strike, A spare and an extra ball using which we can get a 5. 10 9 6 isn't a valid bowling score as for that frame, a strike in the first try and a 9 in the second try will leave 1 pin on the bowling alley and not 6. Hence only 1 valid case results in a score of 25. | |
For more information on bowling scoring check | |
https://en.wikipedia.org/wiki/Ten-pin_bowling#Rules_of_play |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Is the matrix symmetric? | |
ans: Yes | |
2. Is the permutation transitive? | |
ans: yes. Matrix serves as a checker for every permutation P starting from the initial permutation that one reads as the input. The same is clearly explained in the second sample test case. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Output not matching | |
ans: The answer is num%142857 and not just the nCr answer. | |
2. 142857 isn't a prime. Is it intentional? | |
ans: Yes!! it is intentional. Some numbers are special and 142857 is one among them though it isn't a prime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Why isn't the answer 1/4 for the first sample test case. | |
ans: The trick lies in the space the input rests in. Its REAL numbers and not INTEGERS. So, the asnwer is 1/2 and not 1/4. | |
2. If a random number generates between 0 and M are 0 and M included does it affect my strategy if I assume either? | |
ans: No! Real numbers have a limit of 0 at any integer value. Its always limiting. So, it doesn't matter if 0 and M are included or excluded. For clarity sake a random number generates a number in the range [0..M] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how is the ans for power outage qn for this test case 2 1 1000000 1 2 1000000 is 0 ?