fork download
  1. #include <iostream>
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. int a[2000][2000];
  7. bool booleanArray[2000][2000];
  8.  
  9. queue<pair<int,int>> Q;
  10. cout<<"Size of int array: "<<sizeof(a)<<endl;
  11. cout<<"Size of boolean array: "<<sizeof(booleanArray)<<endl;
  12. cout<<"Deafult value of Q"<<sizeof(Q)<<endl;
  13.  
  14. for(int i=0;i<2000;i++){
  15. for(int j=0;j<2000;j++)
  16. Q.push({i,j});
  17. }
  18. cout<<"Total size of queue: "<<Q.size()*sizeof(Q)<<endl;
  19. return 0;
  20. }
Success #stdin #stdout 0s 47808KB
stdin
Standard input is empty
stdout
Size of int array: 16000000
Size of boolean array: 4000000
Deafult value of Q80
Total size of queue: 320000000