04 2022 档案

摘要:一段代码的流程 ***** 1.预处理 将头文件展开,宏定义进行替换,清除注释,if条件宏处理 2.编译 分析语法,并转成汇编 代码优化,如寄存器变量 3.汇编转二进制 4.链接 完成函数的调用和库的链接,并将它们一起打包形成可执行文件 ***** 头文件保护符 #ifndef SALES_DATA 阅读全文
posted @ 2022-04-30 23:14 matt-11 阅读(25) 评论(0) 推荐(0) 编辑
摘要:链接、装载与库 计算机框架:应用层->运行库->操作系统层->硬件层 层与层之间需要通信,而通信需要协议,这个协议就叫接口 下层为上层提供接口,上层作为接口的使用者 开发工具与应用层属于同一层次,他们都用操作系统应用编程接口 应用接口的提供者是运行库,不同的运行库提供不同的API,如windows运 阅读全文
posted @ 2022-04-30 23:14 matt-11 阅读(24) 评论(0) 推荐(0) 编辑
摘要:1 1.对于L,R; 2 找到最大的R,使得[n/l]=[n/r]; 3 n/r>=[n/r]-->r<=n/[n/r] 4 <<=>> 5 r<=n/[n/l]; 6 7 2. 8 [[n/x]/y]=[n/xy] 9 10 3.杜教筛 11 i >= 1 && i <= n j >= 1 && 阅读全文
posted @ 2022-04-10 22:22 matt-11 阅读(42) 评论(0) 推荐(0) 编辑
摘要:1 /* 2 set 自带的 lower_bound 和 upper_bound 的时间复杂度为 O(logn)。 3 4 但使用 algorithm 库中的 lower_bound 和 upper_bound 函数对 set 中的元素进行查询,时间复杂度为 0(n)。 5 6 总结:对于可随机访问 阅读全文
posted @ 2022-04-09 18:39 matt-11 阅读(39) 评论(0) 推荐(0) 编辑
摘要:1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int N=1e5+5; 5 ll a[N],mod[N],ans,n,mulsum=1; 6 ll read() 7 { 8 ll x= 阅读全文
posted @ 2022-04-07 21:54 matt-11 阅读(54) 评论(0) 推荐(0) 编辑
摘要:1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int N=1e5+5; 5 ll a[N],mod[N],n; 6 ll read() 7 { 8 ll x=0,f=1;char ch 阅读全文
posted @ 2022-04-06 23:16 matt-11 阅读(41) 评论(0) 推荐(0) 编辑
摘要:1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int N=2e3+5; 5 const int mod=998244353; 6 ll x[N],y[N],n,k,ans; 7 ll 阅读全文
posted @ 2022-04-05 19:42 matt-11 阅读(32) 评论(0) 推荐(0) 编辑
摘要:1 //初温尽量调高点,末温如果太小也调大点;玄学; 2 class Solution { 3 public: 4 int minimumXORSum(vector<int>& nums1, vector<int>& nums2) { 5 int ans=INT_MAX; 6 srand(time( 阅读全文
posted @ 2022-04-04 23:13 matt-11 阅读(68) 评论(0) 推荐(0) 编辑
摘要:1 class Solution { 2 public: 3 typedef pair<int,int> pii; 4 const int k1=1331; 5 const int k2=13331; 6 const int mod1=1e9+7; 7 const int mod2=1e9+9; 8 阅读全文
posted @ 2022-04-04 23:10 matt-11 阅读(46) 评论(0) 推荐(0) 编辑
摘要:无论是求最大值还是最小值;能量差值del=now-ans; del的正负性无关紧要,重要的是del的差值,也就是绝对值大小; 如果当前求的是最大值if(now>ans)ans=now,说明现在的值更优,否则完美以一定概率接受劣质解; 如果del越大说明劣质解偏差较大,我们接受它的概率就要小,否则劣质 阅读全文
posted @ 2022-04-03 20:57 matt-11 阅读(25) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> using namespace std; typedef long long ll; ll ans,n,sum; int a[100]; int f() { int t=0; for(int i=1;i<=n/2;i++)t+=a[i]; return 阅读全文
posted @ 2022-04-03 16:29 matt-11 阅读(20) 评论(0) 推荐(0) 编辑
摘要:1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 typedef double db; 5 const int N=1e3+5; 6 db ansx,ansy,answ; 7 int n; 8 str 阅读全文
posted @ 2022-04-03 15:50 matt-11 阅读(47) 评论(0) 推荐(0) 编辑
摘要:1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int N=200200; 5 int dep[N],fa[N][30],color[N],bin[N],blg[N],ord[N],in 阅读全文
posted @ 2022-04-03 13:58 matt-11 阅读(30) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示