#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
const int N = 1000;
vector<int> v(N);
int main(){
int n, m;
cin>>n>>m;
for(int i = 0; i < n; i++){
v[i] = i + 1;
}
int p,q;
for(int i = 0; i < m; i++){
cin>>p>>q;
vector<int> :: iterator it =find(v.begin(),v.end(),p);
v.erase(it);
v.insert(it + q, p);
}
for(int i = 0; i < n; i++){
cout<<v[i]<<‘ ‘;
}
return 0;
}
原文地址:https://www.cnblogs.com/blink-cz/p/12688676.html
时间: 2024-11-09 00:53:05