codeforces668b //Little Artem and Dance// Codeforces Round #348
题意: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的更多相关文章
- 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 ...
- 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 ...
- 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 ...
- 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. ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
随机推荐
- Python3基础 response.read 输出网页的源代码
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- HihoCoder 1636 Pangu and Stones(区间DP)题解
题意:合并石子,每次只能合并l~r堆成1堆,代价是新石堆石子个数,问最后能不能合成1堆,不能输出0,能输出最小代价 思路:dp[l][r][t]表示把l到r的石堆合并成t需要的最小代价. 当t == ...
- CF983B XOR-pyramid
设\(xorx[l][r]\)表示题目中\(f(l,r)\)的值,则可以得出 \[ xorx[i][j]=xorx[i][j-1] \oplus xorx[i+1][j] \] 设\(maxx[l][ ...
- nginx 配置 https 请求
1,先去这个网站申请一下证书 https://certmall.trustauth.cn/Home/Member/index/id/1521167511.html 上面会教你怎么去做. 2,就是配置自 ...
- K8S 安装笔记
1. 准备CentOS7环境 #关闭防火墙 # systemctl disable firewalld # systemctl stop firewalld #安装etcd, kubernetes(会 ...
- .net core 问题:413 Request Entity Too Large nginx
https://stackoverflow.com/questions/38698350/increase-upload-file-size-in-asp-net-core The other ans ...
- 杭电hdu-6168 Numbers
这一题是考察排序与后续数据处理的题.我是用了map来给“和”做标记,把确定为a数组内数的数两两求和.给这些和标记,这样就可以很好的处理带有重复数的数据了~~ 贴个碼: #include<iost ...
- sublime插件开发手记
原:http://blog.hickwu.com/sublime插件开发手记 标题: sublime插件开发手记 时间: 2014-01-05 14:58:02 正文: 插件基本结构 基本插件实现 ...
- HDU 5919 Sequence II(主席树+区间不同数个数+区间第k小)
http://acm.split.hdu.edu.cn/showproblem.php?pid=5919 题意:给出一串序列,每次给出区间,求出该区间内不同数的个数k和第一个数出现的位置(将这些位置组 ...
- [转][c++][跨平台]c++跨平台开发小结
转自:https://blog.csdn.net/dj0379/article/details/53577135 linux编程与windows编程的差异之处: 1. 文件与目录的大小写以及路径分隔符 ...