提交记录 51434


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_dsh_v41_0919 noip18b. 【NOIP2018】货币系统 Accepted 100 17.888 ms 48 KB C++17 1.25 KB
提交时间 评测时间
2026-09-19 17:29:32 2026-09-19 17:31:53
#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;
}

//ppppppp

CompilationN/AN/ACompile OKScore: N/A

Testcase #132.05 us28 KBAcceptedScore: 5

Testcase #229.28 us28 KBAcceptedScore: 5

Testcase #329.12 us28 KBAcceptedScore: 5

Testcase #437.7 us28 KBAcceptedScore: 5

Testcase #536.73 us28 KBAcceptedScore: 5

Testcase #638.75 us28 KBAcceptedScore: 5

Testcase #744.09 us28 KBAcceptedScore: 5

Testcase #845.68 us28 KBAcceptedScore: 5

Testcase #953.86 us28 KBAcceptedScore: 5

Testcase #1061.25 us28 KBAcceptedScore: 5

Testcase #1126.7 us28 KBAcceptedScore: 5

Testcase #1225.8 us28 KBAcceptedScore: 5

Testcase #1325.93 us28 KBAcceptedScore: 5

Testcase #1440.09 us28 KBAcceptedScore: 5

Testcase #1538.86 us28 KBAcceptedScore: 5

Testcase #1640.44 us28 KBAcceptedScore: 5

Testcase #1717.457 ms48 KBAcceptedScore: 5

Testcase #1817.888 ms48 KBAcceptedScore: 5

Testcase #1917.65 ms48 KBAcceptedScore: 5

Testcase #2017.754 ms48 KBAcceptedScore: 5


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