fork(1) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. long long answer = 0;
  6.  
  7. long long temp = clock();
  8.  
  9. for (int i = 1; i < 10000000; i++) {
  10. answer += (long long) sqrt(i);
  11. }
  12.  
  13. cout << "Clock cycles taken: " << clock() - temp << endl;
  14. cout << "CPS: " << CLOCKS_PER_SEC << endl;
  15. cout << "Time taken is " << (double) ((clock() - temp)) / CLOCKS_PER_SEC << endl;
  16. cout << answer << endl;
  17. }
Success #stdin #stdout 0.09s 4452KB
stdin
Standard input is empty
stdout
Clock cycles taken: 85971
CPS: 1000000
Time taken is 0.086014
21076851175