Đăng nhập để hỏi chi tiết


Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
#include <iostream>
#include <algorithm>
#define N 205
using namespace std;
int main() {
//freopen("CHOPSTICKS.INP", "r", stdin);
//freopen("CHOPSTICKS.OUT", "w", stdout);
int n, a[N]; cin >> n;
for (int i=1; i<=n; ++i) cin >> a[i];
bool b[N];
fill(b, b+N, false);
int res = 0;
for (int i=1; i<=n; ++i) {
if (b[a[i]]) ++ res;
b[a[i]] ^= 1;
}
cout << res;
}
$\\$
`\bb\color{green}{\text{@Daoanhviet96}}`
Hãy giúp mọi người biết câu trả lời này thế nào?
Bảng tin