답안 #148710

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
148710 2019-09-01T04:58:36 Z TLEWA맞(#3625, H_Squad, sungjune222, str0ct) 함수컵 박물관 (FXCUP4_museum) C++17
컴파일 오류
0 ms 0 KB
#include "museum.h"
#include <bits/stdc++.h>
using namespace std;
int n,check[103][103][103],brr[103],trr[103],grr[103];;
long long combi(int p)
{
	return (long long)p*(p-1)/2;
}
long long CountSimilarPairs(std::vector<int> B, std::vector<int> T, std::vector<int> G)
{
	n=B.size();
	long long ans=0;
	for(int i=0;i<n;i++)
	{
		check[B[i]][T[i]][G[i]]++;
	} for(int i=1;i<=100;i++)
	{
		for(int j=1;j<=100;j++)
		{
			int imsi=0;
			for(int k=1;k<=100;k++)
			{
				ans-=combi(check[i][j][k]);
				imsi+=check[i][j][k];
			} ans-=combi(imsi);
		}
	} for(int j=1;j<=100;j++)
	{
		for(int k=1;k<=100;k++)
		{
			int imsi=0;
			for(int i=1;i<=100;i++)
			imsi+=check[i][j][k];
			ans-=combi(check[i][j][k]);
		}
	} for(int i=1;i<=100;i++)
	{
		for(int k=1;k<=100;k++)
		{
			int imsi=0;
			for(int j=1;j<=100;j++)
			imsi+=check[i][j][k];
			ans-=combi(check[i][j][k]);
		}
	}
	for(int i=0;i<n;i++)
	{
		brr[B[i]]++; trr[T[i]]++; grr[G[i]]++;
	} for(int i=1;i<=100;i++)
	{
		ans+=combi(brr[i])+combi(trr[i])+combi(grr[i]);
	} return ans;
}

Compilation message

museum.cpp: In function 'long long int CountSimilarPairs(std::vector<int>, std::vector<int>, std::vector<int>)':
museum.cpp:34:21: error: 'i' was not declared in this scope
    ans-=combi(check[i][j][k]);
                     ^
museum.cpp:43:24: error: 'j' was not declared in this scope
    ans-=combi(check[i][j][k]);
                        ^