当前位置:网站首页>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;
}
边栏推荐
- Intel distiller Toolkit - Quantitative implementation 1
- [MySQL] multi table query
- Computer graduation design PHP Zhiduo online learning platform
- opencv+dlib实现给蒙娜丽莎“配”眼镜
- Advanced Computer Network Review(4)——Congestion Control of MPTCP
- CUDA实现focal_loss
- Post training quantification of bminf
- Intel Distiller工具包-量化实现1
- Philosophical enlightenment from single point to distributed
- LeetCode41——First Missing Positive——hashing in place & swap
猜你喜欢

MYSQL卸载方法与安装方法

Computer graduation design PHP Zhiduo online learning platform

Mongodb installation and basic operation
![[text generation] recommended in the collection of papers - Stanford researchers introduce time control methods to make long text generation more smooth](/img/10/c0545cb34621ad4c6fdb5d26b495ee.jpg)
[text generation] recommended in the collection of papers - Stanford researchers introduce time control methods to make long text generation more smooth

UML diagram memory skills

CUDA implementation of self defined convolution attention operator

Mise en œuvre de la quantification post - formation du bminf

Booking of tourism products in Gansu quadrupled: "green horse" became popular, and one room of B & B around Gansu museum was hard to find

Compétences en mémoire des graphiques UML

Improved deep embedded clustering with local structure preservation (Idec)
随机推荐
项目连接数据库遇到的问题及解决
Nacos 的安装与服务的注册
Advanced Computer Network Review(5)——COPE
力扣每日一题(二)
Selenium+pytest automated test framework practice (Part 2)
如何正确截取字符串(例:应用报错信息截取入库操作)
Niuke winter vacation training 6 maze 2
LeetCode:214. 最短回文串
Digital people anchor 618 sign language with goods, convenient for 27.8 million people with hearing impairment
LeetCode:387. The first unique character in the string
LeetCode:41. 缺失的第一个正数
MongoDB 的安装和基本操作
How to intercept the string correctly (for example, intercepting the stock in operation by applying the error information)
KDD 2022 paper collection (under continuous update)
Intel Distiller工具包-量化实现1
[MySQL] multi table query
随手记01
[embedded] print log using JLINK RTT
A convolution substitution of attention mechanism
What is an R-value reference and what is the difference between it and an l-value?