Submission #3238

# Submission time Handle Problem Language Result Execution time Memory
3238 2013-08-29T12:42:40 Z BothEarRim 쉬운 문제 (GA3_easy) C++
Compilation error
0 ms 0 KB
#include <stdio.h>
#include <assert.h>
#include <malloc.h>
#include <cmath>

int CountPair(int N, int *A)
{
	int res = 0;

	for(int i=0; i<N-1; i++)
		for(int j=i+1; j<N; j++)
			if(A[j] % A[i] == 0) res++;

	return res;
}

int main(){
	int i, tmp;

	int N;
	tmp = scanf("%d", &N);
	assert(tmp == 1);

	int *A = (int*) malloc( sizeof(int) * N );
	for(i = 0; i < N; i++){
		tmp = scanf("%d", &A[i]);
		assert(tmp == 1);
	}

	printf("%d\n", CountPair(N, A));
	return 0;
}

Compilation message

/tmp/cczve5Je.o: In function `main':
easy.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccapXH16.o:grader.cpp:(.text.startup+0x0): first defined here
collect2: ld returned 1 exit status