Submission #148423

# Submission time Handle Problem Language Result Execution time Memory
148423 2019-09-01T04:21:34 Z CHT를 사랑하는 모임(#3587, moonrabbit2, Retro3014, gs18115) FunctionCup Museum (FXCUP4_museum) C++17
0 / 100
9 ms 512 KB
#include "museum.h"
#include <bits/stdc++.h>
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef long double db;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<db,db> pdb;
typedef tuple<int,int,int,int> TP;
typedef vector<vector<ll>> mat;
const int N=105;
const ll mod=1e9+7;
int n;
ll ans,b[N],t[N],g[N],bt[N][N],tg[N][N],bg[N][N],btg[N][N][N];
long long CountSimilarPairs(std::vector<int> B, std::vector<int> T, std::vector<int> G) {
	n=B.size();
	for(int i=0;i<n;i++){
		b[B[i]]++; t[T[i]]++; g[G[i]]++;
		bt[B[i]][T[i]]++; tg[T[i]][G[i]]++; bg[B[i]][G[i]]++;
		btg[B[i]][T[i]][G[i]]++;
	}
	for(int i=1;i<=100;i++){
		ans+=b[i]*(b[i]-1LL)/2LL;
		ans+=g[i]*(g[i]-1LL)/2LL;
		ans+=t[i]*(t[i]-1LL)/2LL;
	}
	for(int i=1;i<=100;i++) for(int j=1;j<=100;j++){
		ans-=bt[i][j]*(bt[i][j]-1LL)/2LL;
		ans-=tg[i][j]*(tg[i][j]-1LL)/2LL;
		ans-=bg[i][j]*(bg[i][j]-1LL)/2LL;
	}
	for(int i=1;i<=100;i++) for(int j=1;j<=100;j++) for(int k=1;k<=100;k++){
		ans+=btg[i][j][k]*(btg[i][j][k]-1LL);
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 8 ms 384 KB Output is correct
2 Correct 8 ms 512 KB Output is correct
3 Incorrect 9 ms 512 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 8 ms 384 KB Output is correct
2 Correct 8 ms 512 KB Output is correct
3 Incorrect 9 ms 512 KB Output isn't correct
4 Halted 0 ms 0 KB -