# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
148401 | 욱방켜!! (twitch.tv/wookje) (#200) | 함수컵 박물관 (FXCUP4_museum) | C++17 | 468 ms | 18288 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "museum.h"
#include <map>
using namespace std;
typedef long long ll;
const int MX = 101;
ll BC[MX], TC[MX], GC[MX];
map<pair<int, int>, ll> BT, BG, TG;
map<tuple<int, int, int>, ll> BTG;
long long CountSimilarPairs(std::vector<int> B, std::vector<int> T, std::vector<int> G) {
int N = B.size();
long long ans = 0;
for(int i=0; i<N; i++){
int b = B[i], t = T[i], g = G[i];
BC[b]++, TC[t]++, GC[g]++;
BT[{b,t}]++, BG[{b,g}]++, TG[{t,g}]++;
BTG[{b,t,g}]++;
}
for(int i=0; i<MX; i++){
ans+= BC[i] * (BC[i]-1);
ans+= TC[i] * (TC[i]-1);
ans+= GC[i] * (GC[i]-1);
}
for(auto [p,cnt]: BT) ans-= cnt*(cnt-1);
for(auto [p,cnt]: BG) ans-= cnt*(cnt-1);
for(auto [p,cnt]: TG) ans-= cnt*(cnt-1);
for(auto [p,cnt]: BTG) ans+= cnt*(cnt-1);
return ans/2;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |