题意:2种操作,转动或者奇偶位互换。

不论怎么交换,1的后两位一定是3,3的后两位一定是5。因此只要记录1,2的位置。

//#pragma comment(linker,"/STACK:1024000000,1024000000")
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<vector>
#include<cmath>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<algorithm>
#include <stack>
using namespace std;
const int SZ=,INF=0x7FFFFFFF;
int arr[SZ]; int turn(int x)
{
if((x&)==)return x-;
else
{
return x+;
}
} int main()
{
std::ios::sync_with_stdio();
//freopen("d:\\1.txt","r",stdin);
//for(;scanf("%d",&n)!=EOF;)
{
int n,m;
cin>>n>>m;
int one=,two=;
for(int i=;i<m;++i)
{
int type;
cin>>type;
if(type==)
{
int step;
cin>>step;
one=(one+n+step-)%n+;
two=(two+n+step-)%n+;
}
else
{
one=turn(one);
two=turn(two);
}
}
for(int i=;i<n/;++i)
{
arr[(one+*i-)%n+]=+*i;
arr[(two+*i-)%n+]=+*i;
}
for(int i=;i<=n;++i)
{
if(i!=)cout<<" ";
cout<<arr[i];
}
cout<<endl;
}
return ;
}

最新文章

  1. 怎么用XMind辅助电商工作
  2. PHP之session与cookie
  3. Beanstalk消息队列的实现
  4. 【POJ 3241】Object Clustering 曼哈顿距离最小生成树
  5. 新浪微博客户端(47)-在TextView中插入表情
  6. 教你安装CentOS 6.5如何选择安装包
  7. JavaScript高级程序设计之元素大小
  8. iOS学习之Object-C语言类和对象
  9. Sublime Text—设置浏览器快捷键
  10. java的真相
  11. Asp.net: WebForm基础上构建Mvc的方法
  12. JAVA中的继承和覆盖
  13. BootStrap——模态框
  14. PostgreSQL学习手册(常用数据类型)
  15. 直方图均衡化CImg实现
  16. datepickerpopup时间限制选取
  17. Fiddler工具的界面说明
  18. 【swoole】使用swoole简单实现TCP服务
  19. composer学习之路01
  20. FeatureTools

热门文章

  1. 查看Windows系统信息
  2. Selenium Webdriver弹出框的种种类型
  3. CentOS7下Docker中构建可以自动发布到项目的Tomcat容器
  4. Python3 tkinter基础 LabelFrame Radiobutton 形成两组不相互限制的单选按钮
  5. 真心觉得没有必要使用dock和kde桌面
  6. 【配置详解】Quartz配置文件详解
  7. 使用TestServer测试ASP.NET Core API
  8. 3、iptables扩展及使用
  9. 【译】第39节---EF6-数据库命令日志
  10. python基础-PyYaml操作yaml文件