摘要:
class Solution { public: int heightChecker(vector<int>& heights) { vector<int> expected(heights); int t=expected.size(),ans=0; sort(expected.begin(),e 阅读全文
摘要:
直接找入度为$n-1$,出度为$0$的点就行了,时间复杂度是$O(n)$。 int in[1007],out[1007]; class Solution { public: int findJudge(int n, vector<vector<int>>& trust) { int t=trust. 阅读全文