提交记录 6858
| 提交时间 |
评测时间 |
| 2018-11-10 15:30:15 |
2020-08-01 00:50:59 |
#include <algorithm>
#include <cstdio>
#include <cstring>
#define N 110
#define SYS_MAX 25010
using namespace std;
int T, n, a[N], sys[SYS_MAX], f[SYS_MAX];
int main() {
//freopen("test.in", "r", stdin);
scanf("%d", &T);
while (T--) {
scanf("%d", &n);
for (int i = 1; i <= n; ++i) scanf("%d", a + i);
sort(a + 1, a + n + 1);
memset(f, 0, sizeof(f));
memset(sys, 0, sizeof(sys));
f[a[n] + 1] = 1;
int pnt = 1, ret = 0;
for (int i = 1; i <= a[n] + 1; ++i) {
if (f[i] && i != a[pnt]) {
sys[++ret] = a[pnt];
break;
}
if (i == a[pnt]) {
if (!f[i]) f[i] = 1, sys[++ret] = a[pnt];
++pnt;
}
if (f[i])
for (int j = 1; j <= ret; ++j)
if (sys[j] + i <= a[n])
f[sys[j] + i] = 1;
}
printf("%d\n", ret);
}
return 0;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 116.42 us | 212 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #2 | 132.57 us | 212 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #3 | 117.51 us | 212 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #4 | 116.89 us | 212 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #5 | 119.93 us | 212 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #6 | 121.16 us | 212 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #7 | 121.28 us | 212 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #8 | 121.32 us | 212 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #9 | 122.63 us | 212 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #10 | 117.61 us | 212 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #11 | 117.57 us | 212 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #12 | 121.84 us | 212 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #13 | 121.28 us | 212 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #14 | 132.18 us | 212 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #15 | 134.64 us | 212 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #16 | 126.96 us | 212 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #17 | 291.07 us | 212 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #18 | 283.73 us | 212 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #19 | 279.9 us | 212 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #20 | 275.83 us | 212 KB | Wrong Answer | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-04-09 09:40:47 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠