跳到正文

休闲·娱乐

你需要的堆、栈、队列、标准缺省源

structzuoye约 4 分钟
原文
文章信息与版本

文章信息

发布
2024年11月17日
收录
2026年8月20日
更新
2026年10月28日
篇幅
约 4 分钟
获赞
3

版本

  1. v1当前

蒟蒻第一次写文章不喜勿喷

你需要的堆、栈、队列、标准缺省源:

注释版:

C++
#include <iostream>//头文件
#include <queue>//头文件
#include <cstdio>//头文件
#include <vector>//头文件
#include <cstdlib>//头文件
#include <algorithm>//头文件
#include <cmath>//头文件
#include <string>//头文件
#include <list>//头文件
#include <stack>//头文件
#pragma GCC optimize(2)//手动开O2
using namespace std;
typedef long long ll;//重定向long long   ll,可以把long long写成ll,ll a = long long a
//struct node{
//	bool operator <(const //struct node* x)\\const{    //重定向运算符(优先队列排序)
//		return v<x.v;  //重定向运算符(优先队列排序)
//	}  //重定向运算符(优先队列排序)
//};  //重定向运算符(优先队列排序)
//priority_queue<int,vector<int>,greater<int> > q;  //堆优先序列  大
//priority_queue<int,vector<int>,less<int> > p;    //堆优先序列  小
//stack<int>st;  //模板栈定义
//queue<int>q;  //模板队列定义
int main()
{
	ios::sync_with_stdio(0);//加速
	cin.tie(0);//加速
	cout.tie(0);//加速
	return 0;//O2要加
}

非注释版:

C++
#include <iostream>
#include <queue>
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <string>
#include <list>
#include <stack>
#pragma GCC optimize(2)
using namespace std;
typedef long long ll;
//struct node{
//	bool operator <(const //struct node* x)\\const{
//		return v<x.v;
//	}
//};
//priority_queue<int,vector<int>,greater<int> > q;
//priority_queue<int,vector<int>,less<int> > p;
//stack<int>st;
//queue<int>q;
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	return 0;
}

添加方式: 点击工具->编译器选项

点击工具->编译器选项

点击代码/代码模板->缺省源文件/缺省源->打上蓝色勾->粘贴

点击代码/代码模板->缺省源文件/缺省源->打上蓝色勾->粘贴->确定

操作视频:
视频原网站

(视频的B站号是我的,赶紧欢迎关注)

ok了,新文件都会有代码,有问题欢迎私信/评论/QQ(QQ号:3126715455)/wx(私信获取)

原文
抓取于
  1. structzuoye

    qq了,点个赞吧(☆▽☆)