You are viewing a single comment's thread. Return to all comments →
I also had used vector only but, i am getting segementation fault though, i dont know what is wrong!?
vector>s(n);
vector<int>m; int lastAns=0; for(int i=0;i<queries.size();i++){ if(queries[i][0]==1){ int re=(queries[i][1]^lastAns)%n; s[re].push_back(queries[i][2]); } else{ int re=(queries[i][1]^lastAns)%n; lastAns=s[re][queries[i][2]]; m.push_back(lastAns); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Dynamic Array
You are viewing a single comment's thread. Return to all comments →
I also had used vector only but, i am getting segementation fault though, i dont know what is wrong!?
vector>s(n);