提交记录 51434
| 提交时间 |
评测时间 |
| 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
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 32.05 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #2 | 29.28 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #3 | 29.12 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #4 | 37.7 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #5 | 36.73 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #6 | 38.75 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #7 | 44.09 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #8 | 45.68 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #9 | 53.86 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #10 | 61.25 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #11 | 26.7 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #12 | 25.8 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #13 | 25.93 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #14 | 40.09 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #15 | 38.86 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #16 | 40.44 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #17 | 17.457 ms | 48 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #18 | 17.888 ms | 48 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #19 | 17.65 ms | 48 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #20 | 17.754 ms | 48 KB | Accepted | Score: 5 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-09-21 03:10:56 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠