Codeforces Round #574 (Div. 2)
作者:互联网
A - Drinks Choosing
int cnt[1005];
void test_case() {
int n, k;
scanf("%d%d", &n, &k);
for(int i = 1; i <= n; ++i) {
int x;
scanf("%d", &x);
++cnt[x];
}
int cnt2 = 0;
for(int i = 1; i <= k; ++i)
cnt2 += cnt[i] / 2;
printf("%d\n", (n + 1) / 2 + cnt2);
}
标签:case,cnt,int,void,d%,Codeforces,574,Div,1005 来源: https://www.cnblogs.com/KisekiPurin2019/p/12256262.html