This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "museum.h"
#include <bits/stdc++.h>
using namespace std;
const int MX = 105;
int n, cnt[MX][MX][MX];
int &get(int a, int b, int c, int msk)
{
if (!(msk & 1))
a = 0;
if (!(msk & 2))
b = 0;
if (!(msk & 4))
c = 0;
return cnt[a][b][c];
}
long long CountSimilarPairs(vector<int> b, vector<int> t, vector<int> g)
{
int n = b.size();
long long ans = 0;
for (int i = 0; i < n; i++)
for (int msk = 1; msk < 8; msk++)
ans += ((__builtin_popcount(msk) & 1) ? 1 : -1) * (get(b[i], t[i], g[i], msk)++);
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |