Submission #851621

# Submission time Handle Problem Language Result Execution time Memory
851621 2023-09-20T09:36:06 Z wuuvy FunctionCup Museum (FXCUP4_museum) C++17
Compilation error
0 ms 0 KB
#include <stdio.h>
#include <stdlib.h>
#include "museum.h"

long long CountSimilarPairs(std::vector<int> B, std::vector<int> T, std::vector<int> G) {
	int n = B.size();
	int cnt=0;
	for (int i=0;i<n;i++)
    {
        for (int j=i+1;j<n;j++)
        {
            if (B[i]==B[j] || T[i]==T[j] || G[i]==G[j])
                cnt++;
        }
    }
	return cnt;
}

static int N;
static std::vector<int> Badge, Tshirt, Gift;

static void my_assert(int TF, const char* message){
	if(!TF){ puts(message); exit(1); }
}

int main(){
	my_assert(scanf("%d", &N) == 1, "Error: Invalid Input");
	my_assert(2 <= N && N <= 200000, "Error: Invalid Input");

	for(int i=0; i<N; i++){
		int a;
		my_assert(scanf("%d", &a) == 1, "Error: Invalid Input");
		my_assert(1 <= a && a <= 100, "Error: Invalid Input");
		Badge.push_back(a);
	}
	for(int i=0; i<N; i++){
		int a;
		my_assert(scanf("%d", &a) == 1, "Error: Invalid Input");
		my_assert(1 <= a && a <= 100, "Error: Invalid Input");
		Tshirt.push_back(a);
	}
	for(int i=0; i<N; i++){
		int a;
		my_assert(scanf("%d", &a) == 1, "Error: Invalid Input");
		my_assert(1 <= a && a <= 100, "Error: Invalid Input");
		Gift.push_back(a);
	}

	printf("%lld\n", CountSimilarPairs(Badge, Tshirt, Gift));
	return 0;
}

Compilation message

/usr/bin/ld: /tmp/cch1eua5.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cczUfNq4.o:museum.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status