//Place your snippets for cpp here. Each snippet is defined under a snippet name and has a prefix, body and 
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the 
// same ids are connected.
// prefix 的格式要求是 acm-[一级标题编号].[二级标题编号][该代码片段的英文简称]
// description 的格式要求是 "插入 [该代码片段的中文名]"

{
    "黑匣子": {
        "prefix": "acm-2.1优先队列",
        "body": [
            "#include<bits/stdc++.h>",
            "#define itn int",
            "#define mian main",
            "using namespace std;",
            "int len,a[30005],piu,op;",
            "char s;",
            "priority_queue<int,vector<int>, greater<int> >sak;",
            "priority_queue<int,vector<int>,less<int> >b;",
            "int main(){",
            "    while(scanf(\"%c\",&s)){",
            "        if(s=='A'){",
            "            while(s!='(') scanf(\"%c\",&s);",
            "            scanf(\"%d\",&a[++len]);",
            "            getchar();",
            "            piu++;",
            "        }",
            "        if(s=='G'){",
            "            getchar();",
            "            getchar();",
            "\t\t\twhile(op<piu){",
            "            \top++;",
            "           \t \tb.push(a[op]);",
            "           \t \tsak.push(b.top());",
            "            \tb.pop();",
            "        \t}",
            "        \tprintf(\"%d \",sak.top());",
            "        \tb.push(sak.top());",
            "        \tsak.pop();",
            "        }",
            "        getchar();",
            "    } ",
            "    return 0;",
            "}",
            ""
        ],
        "description": "插入 黑匣子"
    }
}