当前位置:网站首页>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;
}
边栏推荐
- LeetCode:394. 字符串解码
- 【文本生成】论文合集推荐丨 斯坦福研究者引入时间控制方法 长文本生成更流畅
- 【shell脚本】——归档文件脚本
- BMINF的后训练量化实现
- Chapter 1 :Application of Artificial intelligence in Drug Design:Opportunity and Challenges
- Cesium draw points, lines, and faces
- Unsupported operation exception
- [oc]- < getting started with UI> -- learning common controls
- opencv+dlib实现给蒙娜丽莎“配”眼镜
- [OC-Foundation框架]---【集合数组】
猜你喜欢

Advance Computer Network Review(1)——FatTree

Advance Computer Network Review(1)——FatTree

After reading the programmer's story, I can't help covering my chest...
![[OC foundation framework] - [set array]](/img/b5/5e49ab9d026c60816f90f0c47b2ad8.png)
[OC foundation framework] - [set array]

Intel distiller Toolkit - Quantitative implementation 1

A convolution substitution of attention mechanism

Selenium+Pytest自动化测试框架实战(下)

SimCLR:NLP中的对比学习

MYSQL卸载方法与安装方法
![[OC]-<UI入门>--常用控件-提示对话框 And 等待提示器(圈)](/img/af/a44c2845c254e4f48abde013344c2b.png)
[OC]-<UI入门>--常用控件-提示对话框 And 等待提示器(圈)
随机推荐
LeetCode:836. 矩形重叠
Ijcai2022 collection of papers (continuously updated)
Advance Computer Network Review(1)——FatTree
[oc foundation framework] - < copy object copy >
一篇文章带你了解-selenium工作原理详解
多元聚类分析
[oc]- < getting started with UI> -- common controls - prompt dialog box and wait for the prompt (circle)
Compétences en mémoire des graphiques UML
Leetcode: Sword finger offer 48 The longest substring without repeated characters
An article takes you to understand the working principle of selenium in detail
五层网络体系结构
LeetCode:236. 二叉树的最近公共祖先
UML diagram memory skills
Computer graduation design PHP Zhiduo online learning platform
Intel Distiller工具包-量化实现3
【shell脚本】使用菜单命令构建在集群内创建文件夹的脚本
Using label template to solve the problem of malicious input by users
Show slave status \ read in G_ Master_ Log_ POS and relay_ Log_ The (size) relationship of POS
xargs命令的基本用法
[embedded] cortex m4f DSP Library