Last active
August 29, 2015 14:23
-
-
Save msg555/4a6723c26b9616964f94 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/* Correct answer is "OK". Most solutions incorrectly identify | |
* (4, 5) as a deadlock despite it not being reachable. | |
*/ | |
int NumberOfOperations(long long i) { | |
return 8; | |
} | |
int GetOperation(long long i, long long index) { | |
int op1[] = {1, 2, -2, 3, 2, -2, -1, -3}; | |
int op2[] = {1, 2, 3, -1, -3, 3, -3, -2}; | |
return (i ? op2 : op1)[index]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment