摘要:
#include<bits/stdc++.h> using namespace std; const int N = 300010; vector<int>p[N]; int ans[N]; int main() { int t; scanf("%d",&t); while(t --) { int 阅读全文
摘要:
#include <iostream> #include <cstdio> #include <cstring> using namespace std; const int N = 2000010; typedef long long LL; int n; //t[i]表示树状数组i结点覆盖的范围 阅读全文
摘要:
//这是一题无向图的题目。#include<bits/stdc++.h> using namespace std; const int N = 750005; int n,q; int h[N],ne[2*N],idx,e[2*N];//无向图记得开二倍int dp[N][3]; void add( 阅读全文
摘要:
#include<bits/stdc++.h> using namespace std; const int N = 10001; int a[N]; int tree[N*2]; build_tree(int a[],int tree[],int node,int start,int end1) 阅读全文
摘要:
#include<bits/stdc++.h> using namespace std; const int N=1e5+5; int a[N][26]; //因为这题是小写的26个字母,所以我们二维写的便是26; int idx; //idx用来统计新出现的节点的个数。 int cnt[N]; / 阅读全文
摘要:
AcWing 830. 单调栈 思路是让这题变成一个单调递增的数列,若新出现的一个数比前面的数小,那么就逐个覆盖。每次输出栈尾就是左边不大于他的第一个数。 #include<iostream> using namespace std; const int N =100010; int tt=0; i 阅读全文
摘要:
今天我们讲的双链表和单链表是用数组的形式进行的。 也就是用邻接表的形式完成的。 #include<bits/stdc++.h> using namespace std; const int N =100010; char cp; int x,k; int idx,head; int a[N],Nex 阅读全文