Submission #148466

#TimeUsernameProblemLanguageResultExecution timeMemory
148466이 대회 미분 되나요? (#200)FunctionCup Museum (FXCUP4_museum)C++17
100 / 100
90 ms9580 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...