fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. int main(int argc, const char *argv[])
  5. {
  6. typedef bool element;
  7. std::vector<element> data(40<<20);
  8.  
  9. volatile element cumul = data[0];
  10.  
  11. for (int j=0; j<1<<9; j++)
  12. {
  13. #pragma omp parallel for reduction (^: cumul)
  14. for (int i=0; i<data.size(); i++)
  15. cumul ^= data[i];
  16. }
  17.  
  18. std::cout << cumul << std::endl;
  19.  
  20. return 0;
  21. }
  22.  
Time limit exceeded #stdin #stdout 5s 7844KB
stdin
Standard input is empty
stdout
Standard output is empty