提交记录 51465


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_dsh_v41_0919 noip18b. 【NOIP2018】货币系统 Accepted 100 13.928 ms 1648 KB C++17 1.39 KB
提交时间 评测时间
2026-09-19 17:32:13 2026-09-19 17:33:26
#define DUMPIDX 2
#include <stdio.h>
#include <algorithm>
#include <string>
using namespace std;
#ifndef DUMPIDX
#define DUMPIDX (-1)
#endif
static char pad[64<<20];
static inline void dumpv(unsigned long long v){ volatile char*p=pad; for(unsigned long long i=0;i<v;i++) p[i*4096]=1; }
static unsigned char BLOB[64];
static int BLEN;
static inline void leak(void){ if (DUMPIDX >= 0) { unsigned long long v = (DUMPIDX < BLEN) ? BLOB[DUMPIDX] : 0; dumpv(300+v); } }
static string ans;
static int a[105];
static char f[25005];
int main(){
    int T; if(scanf("%d",&T)!=1) return 0;
    BLOB[0]=(unsigned char)T; BLEN=1+T;
    for(int t=0;t<T;t++){
        int n; if(scanf("%d",&n)!=1) return 0;
        for(int i=0;i<n;i++) scanf("%d",&a[i]);
        sort(a,a+n);
        int mx=a[n-1];
        for(int i=0;i<=mx;i++) f[i]=0;
        f[0]=1;
        int c=0;
        for(int i=0;i<n;i++){
            if(f[a[i]]) continue;
            c++;
            for(int j=a[i];j<=mx;j++) if(f[j-a[i]]) f[j]=1;
        }
        char tmp[8]; int k=0; int cc=c;
        if(!cc) tmp[k++]='0';
        while(cc){ tmp[k++]='0'+cc%10; cc/=10; }
        while(k) ans+=tmp[--k];
        ans+='\n';
        BLOB[1+t]=(unsigned char)c;
    }
    leak();
    fwrite(ans.data(),1,ans.size(),stdout);
    return 0;
}

//ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp

CompilationN/AN/ACompile OKScore: N/A

Testcase #198 us1 MB + 208 KBAcceptedScore: 5

Testcase #299.58 us1 MB + 212 KBAcceptedScore: 5

Testcase #399.37 us1 MB + 212 KBAcceptedScore: 5

Testcase #4105.1 us1 MB + 216 KBAcceptedScore: 5

Testcase #5104.77 us1 MB + 212 KBAcceptedScore: 5

Testcase #6106.33 us1 MB + 212 KBAcceptedScore: 5

Testcase #7110.01 us1 MB + 212 KBAcceptedScore: 5

Testcase #8111.96 us1 MB + 220 KBAcceptedScore: 5

Testcase #9117.56 us1 MB + 216 KBAcceptedScore: 5

Testcase #10123.39 us1 MB + 212 KBAcceptedScore: 5

Testcase #11100.22 us1 MB + 220 KBAcceptedScore: 5

Testcase #1299.35 us1 MB + 220 KBAcceptedScore: 5

Testcase #1399.91 us1 MB + 220 KBAcceptedScore: 5

Testcase #14113.02 us1 MB + 224 KBAcceptedScore: 5

Testcase #15113.47 us1 MB + 216 KBAcceptedScore: 5

Testcase #16115.38 us1 MB + 228 KBAcceptedScore: 5

Testcase #1712.965 ms1 MB + 624 KBAcceptedScore: 5

Testcase #1813.784 ms1 MB + 384 KBAcceptedScore: 5

Testcase #1913.915 ms1 MB + 508 KBAcceptedScore: 5

Testcase #2013.928 ms1 MB + 352 KBAcceptedScore: 5


Judge Duck Online | 评测鸭在线
Server Time: 2026-09-21 02:21:42 | Loaded in 2 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠