03 2022 档案
摘要:安装clang-format sudo apt install clang-format clang自带的五种风格格式化代码(LLVM, Google, Chromium, Mozilla, WebKit) 格式化代码形式:clang-format -style=<风格> -i <文件名> 以goo
阅读全文
摘要:class Solution { private: vector<int> father(1005); } 上述写法是错误的,因为编译器无法区分这个vector是成员变量声明还是成员方法声明。 class Solution { private: vector<int> father; // 成员变量
阅读全文
摘要:优先队列priority_queue的比较函数 STL头文件:#include 优先队列: 默认从大到小排列:priority_queue<node>q; # 自带的比较函数 priority_queue<int, vector<int>, less<int> > q;//等价于默认,从大到小排 /
阅读全文
摘要:万能库 #include<bits/stdc++.h> 1. scanf 函数 scanf()用法 int a,b,c; scanf("%d", &a); // 读取一个数字赋值给a 如果成功,该函数返回成功匹配和赋值的个数。如果到达文件末尾或发生读错误,则返回 EOF。 while(scanf(%
阅读全文