fork(1) download
  1. #include <stdio.h>
  2. #include <vector>
  3. #include <algorithm>
  4. using namespace std;
  5. int getRegIndex(int num,vector<int> &reg){
  6. reg.resize(reg.size()+1);
  7. return reg.size()-1;
  8. }
  9. int main() {
  10. vector<int> reg;
  11. for(int i=0;i<10;++i){
  12. int x=getRegIndex(1,reg);
  13. reg[x]=getRegIndex(2,reg);
  14. }
  15. return 0;
  16. }
Runtime error #stdin #stdout 0s 3268KB
stdin
Standard input is empty
stdout
Standard output is empty