随笔分类 - 算法基础.基础算法
摘要:定义i为头指针,j为尾指针,i从a数组开头走到尾是单调的,j同理。 code: #include<bits/stdc++.h>//这是xfl的代码 using namespace std; const int N = 1e5+5; int n,m,x,a[N],b[N]; int read() {
阅读全文
摘要:题目: 双指针+桶优化 code: #include<bits/stdc++.h> using namespace std; const int N=1e5+5; int tong[N],a[N],n; int read() { int f=1,ans=0;char c=getchar(); whi
阅读全文
摘要:#include<bits/stdc++.h> using namespace std; const int N = 200000; int a[N],b[N],c[N],s[N]; int n,m; int main() { scanf("%d%d",&n,&m); for(int i=1;i<=
阅读全文
摘要:AcWing.2816判断子序列 用双指针 code: #include<bits/stdc++.h> using namespace std; const int N = 1e5+5; int n,m,a[N],b[N]; int read() { int f=1,ans=0;char c=get
阅读全文
浙公网安备 33010602011771号