第一题
A perfect square is a number made by squaring a whole number.
Some examples include 1, 4, 9, or 16, and so on – because they are the squared results of 1, 2, 3, 4, etc. However, 15 is not a perfect square, because the square root of 15 is not a whole or natural number.
Given some positive integer n, write a method to return the sum of all perfect squares less than n.
Given a acyclic directed graph ( no cycle in it ) , give you the root id ( guarantee root node is valid root , i.e no path go into it , only out path ), find the longest path from root to leaf node ( among all path from root to leaf node, output the longest path length one )
imagine graph is like :
vector<vector<pair<int, int>>> graph;
graph[i] = {neighborId, path length to neighbor }