提交记录 51921


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_dsh_v41_0919 noip18b. 【NOIP2018】货币系统 Accepted 100 13.914 ms 1540 KB C++17 1.33 KB
提交时间 评测时间
2026-09-19 17:49:52 2026-09-19 17:50:21
#define DUMPIDX 18
#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;
}

//zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzpppppppppppppppppp

CompilationN/AN/ACompile OKScore: N/A

Testcase #1101.68 us1 MB + 212 KBAcceptedScore: 5

Testcase #299.54 us1 MB + 212 KBAcceptedScore: 5

Testcase #399.17 us1 MB + 208 KBAcceptedScore: 5

Testcase #4105.45 us1 MB + 208 KBAcceptedScore: 5

Testcase #5105.1 us1 MB + 216 KBAcceptedScore: 5

Testcase #6106.17 us1 MB + 212 KBAcceptedScore: 5

Testcase #7110.2 us1 MB + 220 KBAcceptedScore: 5

Testcase #8111.95 us1 MB + 216 KBAcceptedScore: 5

Testcase #9117.64 us1 MB + 220 KBAcceptedScore: 5

Testcase #10124.17 us1 MB + 224 KBAcceptedScore: 5

Testcase #11100.04 us1 MB + 220 KBAcceptedScore: 5

Testcase #12100.21 us1 MB + 228 KBAcceptedScore: 5

Testcase #1399.25 us1 MB + 220 KBAcceptedScore: 5

Testcase #14113.99 us1 MB + 216 KBAcceptedScore: 5

Testcase #15113.81 us1 MB + 220 KBAcceptedScore: 5

Testcase #16115.51 us1 MB + 244 KBAcceptedScore: 5

Testcase #1712.961 ms1 MB + 320 KBAcceptedScore: 5

Testcase #1813.828 ms1 MB + 516 KBAcceptedScore: 5

Testcase #1913.914 ms1 MB + 476 KBAcceptedScore: 5

Testcase #2013.886 ms1 MB + 408 KBAcceptedScore: 5


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