题意: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 ;
}

codeforces668b //Little Artem and Dance// Codeforces Round #348的更多相关文章

  1. Codeforces Round #348 (VK Cup 2016 Round 2, Div. 2 Edition) D. Little Artem and Dance 模拟

    D. Little Artem and Dance 题目连接: http://www.codeforces.com/contest/669/problem/D Description Little A ...

  2. Codeforces Round #348(VK Cup 2016 - Round 2)

    A - Little Artem and Presents (div2) 1 2 1 2这样加就可以了 #include <bits/stdc++.h> typedef long long ...

  3. Codeforces Round #348 (VK Cup 2016 Round 2, Div. 2 Edition) D

    D. Little Artem and Dance time limit per test 2 seconds memory limit per test 256 megabytes input st ...

  4. Codeforces Round #348 (VK Cup 2016 Round 2, Div. 2 Edition) D. Little Artem and Dance

    题目链接: http://codeforces.com/contest/669/problem/D 题意: 给你一个初始序列:1,2,3,...,n. 现在有两种操作: 1.循环左移,循环右移. 2. ...

  5. Codeforces Round #348 (VK Cup 2016 Round 2, Div. 1 Edition) C. Little Artem and Random Variable 数学

    C. Little Artem and Random Variable 题目连接: http://www.codeforces.com/contest/668/problem/C Descriptio ...

  6. Codeforces Round #348 (VK Cup 2016 Round 2, Div. 2 Edition) E. Little Artem and Time Machine 树状数组

    E. Little Artem and Time Machine 题目连接: http://www.codeforces.com/contest/669/problem/E Description L ...

  7. Codeforces Round #348 (VK Cup 2016 Round 2, Div. 2 Edition) C. Little Artem and Matrix 模拟

    C. Little Artem and Matrix 题目连接: http://www.codeforces.com/contest/669/problem/C Description Little ...

  8. Codeforces Round #348 (VK Cup 2016 Round 2, Div. 2 Edition) B. Little Artem and Grasshopper 模拟题

    B. Little Artem and Grasshopper 题目连接: http://www.codeforces.com/contest/669/problem/B Description Li ...

  9. Codeforces Round #348 (VK Cup 2016 Round 2, Div. 2 Edition) A. Little Artem and Presents 水题

    A. Little Artem and Presents 题目连接: http://www.codeforces.com/contest/669/problem/A Description Littl ...

随机推荐

  1. scrapy - Request 中的回调函数不执行

    在 scrapy 中, scrapy.Request(url, headers=self.header, callback=self.parse) 调试的时候,发现回调函数 parse_detail  ...

  2. dp入门(LIS,LCS)

    LCS

  3. SpringBoot 解决HttpServletRequest只能读取一次

    业务逻辑,通过filter读取请求的request,获取token,并将token传递后面流程使用 BodyReaderHttpServletRequestWrapper: public class ...

  4. 【分布式事务】spring cloud集成lcn解决分布式事务

    参考地址:https://blog.csdn.net/u010882691/article/details/82256587 参考地址:https://blog.csdn.net/oyh1203/ar ...

  5. Java程序运行机制及开发环境

    Java既是编译型语言,又是解释型语言 java源文件首先需要通过javac编译生成后缀名为.class的字节码文件(与平台无关,只面向JVM),然后使用Java虚拟机将字节码解释成特定平台上的机器码 ...

  6. SAP月结操作讲解

    SAP月结操作讲解 https://wenku.baidu.com/view/ac6fe45d312b3169a451a4b9.html   步聚 操作内容 事务码 是否必须 操作时间 月/年结 1 ...

  7. HDU 4312 Meeting point-2(切比雪夫距离转曼哈顿距离)

    http://acm.hdu.edu.cn/showproblem.php?pid=4312 题意:在上一题的基础上,由四个方向改为了八个方向. 思路: 引用自http://blog.csdn.net ...

  8. Java的反射机制Reflect

    简介: 动态获取类的信息.动态调用对象的方法的功能叫做:Java 的反射(Reflection)机制. Reflection是不同于C++等静态语言,而被视为准动态语言的关键性质.反射机制允许程序在运 ...

  9. ros 节点关闭后重启

    加入参数 respawn="true"

  10. Python:ModuleNotFoundError: No module named 'windows'

    pymouse安装后,又出现了ModuleNotFoundError: No module named 'windows'的错误 解决: 下载安装pyhook:http://www.lfd.uci.e ...