Thursday, October 9, 2014

ACM 1196. History Exam / Экзамен по истории

 C++ map can help us here a lot, just keep a map where A[i] will be true if the number i exist in the professor's list. Then input the student's answers and increment the final answer by 1 if the current number of the student has a value of true  If you have problems using map you need to implement binary search which takes logN time to check for the existence of an element in a sorted list. You can find more info about Binary Search here.


       FULL SOURCE CODE

No comments:

Post a Comment