当前位置:网站首页>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 2
- IJCAI2022论文合集(持续更新中)
- 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+pytest automated test framework practice
- Advanced Computer Network Review(3)——BBR
- Mise en œuvre de la quantification post - formation du bminf
- Leetcode: Jianzhi offer 03 Duplicate numbers in array
- [OC]-<UI入门>--常用控件-UIButton
- What is the role of automated testing frameworks? Shanghai professional third-party software testing company Amway
- LeetCode:124. Maximum path sum in binary tree
猜你喜欢

Computer graduation design PHP Zhiduo online learning platform
![[OC foundation framework] - string and date and time >](/img/75/e20064fd0066810135771a01f54360.png)
[OC foundation framework] - string and date and time >

Nacos 的安装与服务的注册

LeetCode:124. Maximum path sum in binary tree

Intel distiller Toolkit - Quantitative implementation 3

CUDA realizes focal_ loss

Advanced Computer Network Review(3)——BBR

Post training quantification of bminf

Once you change the test steps, write all the code. Why not try yaml to realize data-driven?

Pytest's collection use case rules and running specified use cases
随机推荐
LeetCode:剑指 Offer 42. 连续子数组的最大和
Notes 01
What is MySQL? What is the learning path of MySQL
【每日一题】搬运工 (DFS / DP)
LeetCode:221. 最大正方形
What is an R-value reference and what is the difference between it and an l-value?
随手记01
Tdengine biweekly selection of community issues | phase III
ant-design的走马灯(Carousel)组件在TS(typescript)环境中调用prev以及next方法
[OC-Foundation框架]--<Copy对象复制>
多元聚类分析
LeetCode:41. Missing first positive number
LeetCode:236. The nearest common ancestor of binary tree
BMINF的后训练量化实现
LeetCode:236. 二叉树的最近公共祖先
Different data-driven code executes the same test scenario
How to effectively conduct automated testing?
Mongodb installation and basic operation
Using label template to solve the problem of malicious input by users
LeetCode41——First Missing Positive——hashing in place & swap