报错问题
最近把.h头文件都移动到include目录下,但此时运行程序后,出现如下报错:
[ 27%] Building CXX object CMakeFiles/NaMi.dir/main.cpp.obj
E:\4.work\Qt_Work\NaMi\main.cpp:1:10: fatal error: nami.h: No such file or directory#…
题意: 给你一个 n n n个点 m m m条边的无向图,每个边有两个权值 a i , b i a_i,b_i ai,bi,让你求出一个 ( ∑ i ∈ T a i ) ( ∑ i ∈ T b i ) (\sum_{i \in T}a_i)(\sum_{i \in T}b_i) (∑i∈Tai)(∑i∈Tbi)最小的生成树。
思路…
题目: 题解:
func findDisappearedNumbers(nums []int) (ans []int) {n : len(nums)for _, v : range nums {v (v - 1) % nnums[v] n}for i, v : range nums {if v < n {ans append(ans, i1)}}return
}
题目: 题解:
class Solution {
public:vector<int> findDisappearedNumbers(vector<int>& nums) {int n nums.size();for (auto& num : nums) {int x (num - 1) % n;nums[x] n;}vector<int> ret;for (int i 0; i < n;…