提交记录 10210
提交时间 |
评测时间 |
2019-08-22 10:44:34 |
2020-08-01 02:03:10 |
#include<cstdio>
#include<iostream>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
const int MAXN=100+7,MAXA=25000;
int a[MAXN],vis[MAXA+7],n,m,T;
int main(){
scanf("%d",&T);
while(T--){
m=0; memset(vis,0,sizeof(vis));
scanf("%d",&n);
for(int i=1;i<=n;++i) scanf("%d",&a[i]);
sort(a+1,a+1+n);
vis[0]=1;
for(int i=1;i<=n;++i){
if(vis[a[i]]) continue;
++m;
for(int j=0;j<=MAXA-a[i];++j){
if(vis[j]){
vis[j+a[i]]=1;
}
}
}
printf("%d\n",m);
}
return 0;
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 641.52 us | 132 KB | Accepted | Score: 5 | 显示更多 |
Testcase #2 | 617.05 us | 132 KB | Accepted | Score: 5 | 显示更多 |
Testcase #3 | 622.61 us | 132 KB | Accepted | Score: 5 | 显示更多 |
Testcase #4 | 992 us | 132 KB | Accepted | Score: 5 | 显示更多 |
Testcase #5 | 872.4 us | 132 KB | Accepted | Score: 5 | 显示更多 |
Testcase #6 | 858.2 us | 132 KB | Accepted | Score: 5 | 显示更多 |
Testcase #7 | 1.146 ms | 132 KB | Accepted | Score: 5 | 显示更多 |
Testcase #8 | 1.208 ms | 132 KB | Accepted | Score: 5 | 显示更多 |
Testcase #9 | 1.385 ms | 132 KB | Accepted | Score: 5 | 显示更多 |
Testcase #10 | 1.346 ms | 132 KB | Accepted | Score: 5 | 显示更多 |
Testcase #11 | 1.415 ms | 132 KB | Accepted | Score: 5 | 显示更多 |
Testcase #12 | 1.426 ms | 132 KB | Accepted | Score: 5 | 显示更多 |
Testcase #13 | 1.388 ms | 132 KB | Accepted | Score: 5 | 显示更多 |
Testcase #14 | 1.913 ms | 132 KB | Accepted | Score: 5 | 显示更多 |
Testcase #15 | 2.085 ms | 132 KB | Accepted | Score: 5 | 显示更多 |
Testcase #16 | 1.826 ms | 132 KB | Accepted | Score: 5 | 显示更多 |
Testcase #17 | 17.402 ms | 132 KB | Accepted | Score: 5 | 显示更多 |
Testcase #18 | 18.245 ms | 132 KB | Accepted | Score: 5 | 显示更多 |
Testcase #19 | 17.936 ms | 132 KB | Accepted | Score: 5 | 显示更多 |
Testcase #20 | 18.587 ms | 132 KB | Accepted | Score: 5 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-12-05 10:31:42 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠