Thursday, October 2, 2014

ACM 1880. Psych Up's Eigenvalues / Собственные числа Psych Up

We will use C++ STL map for this one. For more info about map go here.
 No need for arrays ,we keep only one map of type <int,int> where A[I] tells how many times we encountered the number I.  We just input the first two blocks and increment the corresponding map element by 1. Then when we read the third block we input and check if we have faced the current number 2 times with the help our map, if yes then we increment answer by 1.


       FULL SOURCE CODE

No comments:

Post a Comment