# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
3238 | BothEarRim | 쉬운 문제 (GA3_easy) | C++98 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
}