//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-5.2货币系统",
        "body": [
            "#include<bits/stdc++.h>",
            "using namespace std;",
            "int T,n,ans,a[105],dp[30005];",
            "int main(){",
            "    scanf(\"%d\",&T);",
            "    while(T--){",
            "    \tmemset(dp,-127,sizeof(dp));",
            "    \tscanf(\"%d\",&n);dp[0]=ans=0;",
            "\t\tfor(int i=1;i<=n;i++)scanf(\"%d\",&a[i]);",
            "\t\tfor(int i=1;i<=n;i++)",
            "\t\t    for(int j=a[i];j<=25000;j++)",
            "\t\t        dp[j]=max(dp[j],dp[j-a[i]]+1);",
            "\t\tfor(int i=1;i<=n;++i)ans+=dp[a[i]]==1;",
            "\t\tprintf(\"%d\\n\",ans);",
            "\t}",
            "}",
            ""
        ],
        "description": "插入 完全背包"
    }
}