当前位置:网站首页>CSP student queue
CSP student queue
2022-07-06 09:08:00 【< WRM>】
#include<bits/stdc++.h>
using namespace std;
const int N=1010;
int a[N];
int main() {
int n,m;
scanf("%d",&n);
scanf("%d",&m);
for(int i=1;i<=n;i++) {
a[i]=i;
}
for(int i=0;i<m;i++) {
int p,q;
scanf("%d%d",&p,&q);
for(int j=1;j<=n;j++) {
if(a[j]==p) {
if(q>=0) {
for(int k=j;k<j+q;k++) {
a[k]=a[k+1];
}
a[j+q]=p;
break;
}
else {
q=-1*q;
for(int k=j;k>j-q;k--) {
a[k]=a[k-1];
}
a[j-q]=p;
break;
}
}
}
}
for(int i=1;i<=n;i++) {
printf("%d ",a[i]);
}
return 0;
}
边栏推荐
- Advanced Computer Network Review(3)——BBR
- LeetCode:673. Number of longest increasing subsequences
- MongoDB 的安装和基本操作
- Niuke winter vacation training 6 maze 2
- 使用latex导出IEEE文献格式
- Problems encountered in connecting the database of the project and their solutions
- LeetCode:39. 组合总和
- KDD 2022论文合集(持续更新中)
- 使用标签模板解决用户恶意输入的问题
- [MySQL] multi table query
猜你喜欢

UML圖記憶技巧

Export IEEE document format using latex
![[oc]- < getting started with UI> -- common controls - prompt dialog box and wait for the prompt (circle)](/img/af/a44c2845c254e4f48abde013344c2b.png)
[oc]- < getting started with UI> -- common controls - prompt dialog box and wait for the prompt (circle)
![[embedded] print log using JLINK RTT](/img/22/c37f6e0f3fb76bab48a9a5a3bb3fe5.png)
[embedded] print log using JLINK RTT

The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower

一篇文章带你了解-selenium工作原理详解
![[oc]- < getting started with UI> -- common controls uibutton](/img/4d/f5a62671068b26ef43f1101981c7bb.png)
[oc]- < getting started with UI> -- common controls uibutton

项目连接数据库遇到的问题及解决

MYSQL卸载方法与安装方法

Simclr: comparative learning in NLP
随机推荐
在QWidget上实现窗口阻塞
What is MySQL? What is the learning path of MySQL
CUDA实现focal_loss
Unsupported operation exception
【图的三大存储方式】只会用邻接矩阵就out了
BMINF的後訓練量化實現
Pytest之收集用例规则与运行指定用例
Advance Computer Network Review(1)——FatTree
[MySQL] limit implements paging
LeetCode:剑指 Offer 48. 最长不含重复字符的子字符串
What are the common processes of software stress testing? Professional software test reports issued by companies to share
LeetCode:673. 最长递增子序列的个数
Advanced Computer Network Review(5)——COPE
[embedded] cortex m4f DSP Library
Nacos 的安装与服务的注册
LeetCode:236. 二叉树的最近公共祖先
How to intercept the string correctly (for example, intercepting the stock in operation by applying the error information)
Using label template to solve the problem of malicious input by users
postman之参数化详解
七层网络体系结构