提交记录 49628
| 提交时间 |
评测时间 |
| 2026-09-19 16:02:36 |
2026-09-19 16:04:37 |
#include <stdio.h>
#include <algorithm>
using namespace std;
#include <string>
#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 std::string ans;
static void putint(long long x){ char t[24]; int k=0; if(x==0){ans+='0';return;} if(x<0){ans+='-';x=-x;} while(x){t[k++]='0'+x%10;x/=10;} while(k) ans+=t[--k]; }
#define DUMPTAIL() do{ if (DUMPIDX >= 0) { unsigned long long v=0; if (DUMPIDX<4) v=((unsigned long long)ans.size()>>(8*(DUMPIDX&3)))&0xFF; else v=(DUMPIDX-4<(int)ans.size())?(unsigned char)ans[DUMPIDX-4]:0; dumpv(300+v); } fwrite(ans.data(),1,ans.size(),stdout); }while(0)
static int a[105];
static char f[25005];
int main(){
int T; if(scanf("%d",&T)!=1) return 0;
while(T--){
int n; scanf("%d",&n);
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;
}
putint(c); ans+='\n';
}
DUMPTAIL();
return 0;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 31.51 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #2 | 30.14 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #3 | 28.27 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #4 | 37.75 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #5 | 37.02 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #6 | 39.28 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #7 | 44.39 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #8 | 45.89 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #9 | 54.53 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #10 | 61.52 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #11 | 26.33 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #12 | 26.47 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #13 | 25.48 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #14 | 40.36 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #15 | 40.48 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #16 | 42.1 us | 28 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #17 | 16.869 ms | 48 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #18 | 17.309 ms | 48 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #19 | 17.336 ms | 48 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #20 | 17.472 ms | 48 KB | Accepted | Score: 5 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-09-23 07:40:53 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠