SHARE
TWEET

Untitled

a guest Feb 21st, 2012 304 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <cstdlib>
  2. #include <iostream>
  3. #include <vector>
  4. #include <llvm/ADT/SmallVector.h>
  5.  
  6. int main()
  7. {
  8.     typedef std::vector<int> Vector;
  9.     // typedef llvm::SmallVector<int,10> Vector;
  10.    
  11.     int sum = 0;
  12.     for (int i=0; i<10000000; ++i)
  13.     {
  14.         int sz = rand() % 10;
  15.         Vector v;
  16.         for (int i=0; i<sz; ++i)
  17.             v.push_back(rand()%10);
  18.         sum += std::accumulate(v.begin(), v.end(), 0);
  19.     }
  20.     std::cout << sum;
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top