답안 #148670

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
148670 2019-09-01T04:54:00 Z Welcome to osu!(#3734, easrui, CodePlatina, jhwest2) 함수컵 박물관 (FXCUP4_museum) C++17
컴파일 오류
0 ms 0 KB
#include "museum.h"
int a[101],b[101],c[101],ab[101][101],bc[101][101],ac[101][101],abc[101][101][101];
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++){
        ans += a[B[i]]+b[T[i]]+c[G[i]]-ab[B[i]][T[i]]-bc[T[i]][G[i]]-ac[B[i]][G[i]]+abc[B[i]][T[i]][G[i]];
        a[B[i]]++;
        b[T[i]]++;
        c[G[i]]++;
        ab[B[i]][T[i]]++;
        bc[T[i]][G[i]]++;
        ac[B[i]][G[i]]++;
        abc[B[i]][T[i]][G[i]]++;
	}
	return ans;
}

Compilation message

museum.cpp: In function 'long long int CountSimilarPairs(std::vector<int>, std::vector<int>, std::vector<int>)':
museum.cpp:4:20: error: expected unqualified-id before 'long'
  int N = B.size(), long long ans=0;
                    ^~~~
museum.cpp:6:9: error: 'ans' was not declared in this scope
         ans += a[B[i]]+b[T[i]]+c[G[i]]-ab[B[i]][T[i]]-bc[T[i]][G[i]]-ac[B[i]][G[i]]+abc[B[i]][T[i]][G[i]];
         ^~~
museum.cpp:15:9: error: 'ans' was not declared in this scope
  return ans;
         ^~~