提交记录 8432
提交时间 |
评测时间 |
2019-02-16 22:23:02 |
2020-08-01 01:18:44 |
#include<cstdio>
#include<algorithm>
#include<cstring>
#define Rint register int
using namespace std;
const int N = 103, M = 25003;
int t, n, ans, a[N];
bool f[M];
int main(){
scanf("%d", &t);
while(t --){
memset(f, 0, sizeof f); ans = 0;
scanf("%d", &n);
for(Rint i = 1;i <= n;i ++)
scanf("%d", a + i);
sort(a + 1, a + n + 1);
f[0] = 1;
for(Rint i = 1;i <= n;i ++)
if(!f[a[i]]){
++ ans;
for(Rint j = a[i];j <= 25000;j ++)
f[j] |= f[j - a[i]];
}
printf("%d\n", ans);
}
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 384.67 us | 40 KB | Accepted | Score: 5 | 显示更多 |
Testcase #2 | 369.75 us | 40 KB | Accepted | Score: 5 | 显示更多 |
Testcase #3 | 367.74 us | 40 KB | Accepted | Score: 5 | 显示更多 |
Testcase #4 | 553.93 us | 40 KB | Accepted | Score: 5 | 显示更多 |
Testcase #5 | 494.89 us | 40 KB | Accepted | Score: 5 | 显示更多 |
Testcase #6 | 478.61 us | 40 KB | Accepted | Score: 5 | 显示更多 |
Testcase #7 | 631.82 us | 40 KB | Accepted | Score: 5 | 显示更多 |
Testcase #8 | 643.66 us | 40 KB | Accepted | Score: 5 | 显示更多 |
Testcase #9 | 754.1 us | 40 KB | Accepted | Score: 5 | 显示更多 |
Testcase #10 | 760.46 us | 40 KB | Accepted | Score: 5 | 显示更多 |
Testcase #11 | 986.31 us | 40 KB | Accepted | Score: 5 | 显示更多 |
Testcase #12 | 1.015 ms | 40 KB | Accepted | Score: 5 | 显示更多 |
Testcase #13 | 974.75 us | 40 KB | Accepted | Score: 5 | 显示更多 |
Testcase #14 | 1.363 ms | 40 KB | Accepted | Score: 5 | 显示更多 |
Testcase #15 | 1.491 ms | 40 KB | Accepted | Score: 5 | 显示更多 |
Testcase #16 | 1.311 ms | 40 KB | Accepted | Score: 5 | 显示更多 |
Testcase #17 | 8.12 ms | 40 KB | Accepted | Score: 5 | 显示更多 |
Testcase #18 | 8.273 ms | 40 KB | Accepted | Score: 5 | 显示更多 |
Testcase #19 | 8.151 ms | 40 KB | Accepted | Score: 5 | 显示更多 |
Testcase #20 | 8.439 ms | 40 KB | Accepted | Score: 5 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-12-05 10:14:39 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠