STL

vectorのrotate 使い方

void rotate_test(){ VI A = {1,2,3,4,5,6,7}; // => {2, 3, 4, 5, 6, 7, 1} rotate(A.begin(), A.begin()+1, A.end()); debug(A); // => {1, 2, 3, 4, 5, 6, 7} // 6個先 rotate(A.begin(), A.begin()+6, A.end()); debug(A); // => {1, 2, 3, 4, 5, 6, 7} …