fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6. int n = 2; // For Example n = 2
  7.  
  8. // Big-O = 40n + 42 ...
  9. // Big-O = 40*2 + 42 = 122 == The Output :)
  10.  
  11. int bigO = 0;
  12.  
  13. bigO++;
  14. for(int i=0; bigO++, i<10; bigO++, ++i){
  15. bigO++;
  16. for(int a=0; bigO++, a<n; bigO++, ++a){
  17. bigO++;
  18. bigO++;
  19. }
  20. }
  21.  
  22. cout << bigO << endl;
  23.  
  24. }
Success #stdin #stdout 0.01s 2680KB
stdin
Standard input is empty
stdout
122