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<vector>
using namespace std;
#define ll long long
ll res;
vector<int> v;
long long CountSimilarPairs(std::vector<int> B, std::vector<int> T, std::vector<int> G) {
int N = B.size();
v = vector<int>(111, 0);
for (int i = 0; i < N; i++)
res += v[B[i]]++;
v = vector<int>(111, 0);
for (int i = 0; i < N; i++)
res += v[T[i]]++;
v = vector<int>(111, 0);
for (int i = 0; i < N; i++)
res += v[G[i]]++;
v = vector<int>(11111, 0);
for (int i = 0; i < N; i++)
res -= v[B[i] * 101 + T[i]]++;
v = vector<int>(11111, 0);
for (int i = 0; i < N; i++)
res -= v[B[i] * 101 + G[i]]++;
v = vector<int>(11111, 0);
for (int i = 0; i < N; i++)
res -= v[T[i] * 101 + G[i]]++;
v = vector<int>(1111111, 0);
for (int i = 0; i < N; i++)
res += v[B[i] * 10203 + T[i] * 101 + G[i]]++;
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |