当前位置:网站首页>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:39. 组合总和
- Improved deep embedded clustering with local structure preservation (Idec)
- 项目连接数据库遇到的问题及解决
- Pytest's collection use case rules and running specified use cases
- Advanced Computer Network Review(3)——BBR
- go-redis之初始化连接
- LeetCode:221. 最大正方形
- Booking of tourism products in Gansu quadrupled: "green horse" became popular, and one room of B & B around Gansu museum was hard to find
- What is an R-value reference and what is the difference between it and an l-value?
- 一改测试步骤代码就全写 为什么不试试用 Yaml实现数据驱动?
猜你喜欢
![[embedded] cortex m4f DSP Library](/img/83/ab421d5cc18e907056ec2bdaeb7d5c.png)
[embedded] cortex m4f DSP Library
![[OC-Foundation框架]--<Copy对象复制>](/img/62/c04eb2736c2184d8826271781ac7e3.png)
[OC-Foundation框架]--<Copy对象复制>

A convolution substitution of attention mechanism

【shell脚本】——归档文件脚本

自定义卷积注意力算子的CUDA实现
![[OC]-<UI入门>--常用控件-提示对话框 And 等待提示器(圈)](/img/af/a44c2845c254e4f48abde013344c2b.png)
[OC]-<UI入门>--常用控件-提示对话框 And 等待提示器(圈)

LeetCode41——First Missing Positive——hashing in place & swap
![[oc foundation framework] - < copy object copy >](/img/62/c04eb2736c2184d8826271781ac7e3.png)
[oc foundation framework] - < copy object copy >

Intel distiller Toolkit - Quantitative implementation 1

KDD 2022论文合集(持续更新中)
随机推荐
LeetCode:221. 最大正方形
[OC-Foundation框架]---【集合数组】
LeetCode:214. Shortest palindrome string
How to intercept the string correctly (for example, intercepting the stock in operation by applying the error information)
LeetCode41——First Missing Positive——hashing in place & swap
Compétences en mémoire des graphiques UML
使用latex导出IEEE文献格式
LeetCode:387. 字符串中的第一个唯一字符
Selenium+Pytest自动化测试框架实战
LeetCode:236. The nearest common ancestor of binary tree
多元聚类分析
[oc]- < getting started with UI> -- learning common controls
LeetCode:394. 字符串解码
Advanced Computer Network Review(4)——Congestion Control of MPTCP
LeetCode:214. 最短回文串
LeetCode:162. 寻找峰值
Guangzhou will promote the construction of a child friendly city, and will explore the establishment of a safe area 200 meters around the school
Advanced Computer Network Review(3)——BBR
xargs命令的基本用法
[Hacker News Weekly] data visualization artifact; Top 10 Web hacker technologies; Postman supports grpc