STL相关

STL相关

最近每次打比赛用到STL的时候都想去查查,来防止写错,因此浪费了大量的时间,遂决定写篇博客,到时候直接在博客查阅。

queue 队列

methods in code

#include<stdio.h>
#include<queue>
struct node{int x,y;};
std::queue<node> Q;
int main()
{
    Q.push((node){1,1}),Q.push((node){2,2});
    printf("size:%d\n",Q.size());//=>size:2
    printf("队首x元素:%d\n队尾x元素:%d\n",Q.front().x,Q.back().x);
    //=>队首x元素:1
    //=>队尾x元素:2
    while(!Q.empty())Q.pop();
    return 0;
}

string 字符串

methods in code

#include<Pigeons.h>
#include<gugugu>

详解

见洛谷博客:https://www.luogu.com.cn/blog/xjzsq/stlstring-zi-fu-chuan

map