提交记录 32500
| 提交时间 |
评测时间 |
| 2026-08-14 11:10:43 |
2026-08-14 11:10:52 |
#include <stdio.h>
#include <stdlib.h>
int a[105]; char dp[26000];
int cmp(const void *x, const void *y){ return *(int*)x - *(int*)y; }
int main(){
int T; scanf("%d", &T);
while(T--){
int n; scanf("%d", &n);
int i; for(i=0;i<n;i++) scanf("%d", &a[i]);
qsort(a, n, sizeof(int), cmp);
int mx = a[n-1];
for(i=0;i<=mx;i++) dp[i]=0;
dp[0]=1;
int ans=0;
for(i=0;i<n;i++){
if(!dp[a[i]]) ans++;
for(int v=a[i];v<=mx;v++) if(dp[v-a[i]]) dp[v]=1;
}
printf("%d\n", ans);
}
return 0;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 33.59 us | 20 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #2 | 34.33 us | 20 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #3 | 44.4 us | 20 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #4 | 46.18 us | 20 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #5 | 46.28 us | 20 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #6 | 47.63 us | 20 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #7 | 56.2 us | 20 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #8 | 58.56 us | 20 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #9 | 90.59 us | 20 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #10 | 80.25 us | 20 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #11 | 45.33 us | 20 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #12 | 52.69 us | 20 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #13 | 56.5 us | 20 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #14 | 146.99 us | 20 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #15 | 102.27 us | 20 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #16 | 149.16 us | 20 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #17 | 22.896 ms | 40 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #18 | 22.942 ms | 40 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #19 | 23.508 ms | 40 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #20 | 23.098 ms | 40 KB | Accepted | Score: 5 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-09-11 19:22:04 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠