Skip to content

Instantly share code, notes, and snippets.

@g14a
Created October 6, 2018 16:17
Show Gist options
  • Save g14a/41efc009734b2ba7798030c261339c98 to your computer and use it in GitHub Desktop.
Save g14a/41efc009734b2ba7798030c261339c98 to your computer and use it in GitHub Desktop.
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<omp.h>
int main() {
int graph[200][200];
time_t t;
srand((unsigned) time(&t));
for (int m=0;m<200;m++) {
for(int o=0;o<200;o++) {
graph[m][o] = rand() % 2;
if(m==o) {
graph[m][o] = graph[o][m];
}
}
}
long double start = omp_get_wtime();
int i=0,j=0,k=0,l=0;
int count=0;
for(i=0;i<200;i++) {
for (j=i;j<200;j++) {
for(k=j;k<200;k++){
for(l=k;l<200;l++) {
if(graph[i][j] && i!=j) {
if(graph[i][k] && graph[j][k] && k!=j && k!=i) {
count++;
printf("[%d %d %d %d]\n", i, j, k, l);
}
}
}
}
}
}
printf("\n%Lf\n", omp_get_wtime()-start);
printf("Num : %d\n", count);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment