Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <omp.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <iostream>
- #include <time.h>
- #include <vector>
- using namespace std;
- void mascara(int mask,int n)
- {
- if (mask==(1<<(n+1))-1)
- return;
- for (int i = 0; i < n; ++i)
- if(!(mask&(1<<i)))
- for (int j = i+1; j < n; ++j)
- if(!(mask&(1<<j)))
- mascara(mask | 1<<i | 1<<j,n);
- }
- int main ()
- {
- clock_t t1,t2;
- t1=clock();
- //omp_set_num_threads(2);
- #pragma omp parallel for
- for (int i = 0; i < 4; ++i)
- mascara(1<<12,12);
- t2=clock();
- cout<<endl<<"demoro:"<<(t2-t1)/1000<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement