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 ...
随机推荐
- topcoder srm 704 div1
1.对于一棵树上的一个节点$u$,定义$f(u)$表示树上距离$u$最远的节点到$u$的距离.给出每个节点的$f$值,构造出这棵树. 思路:找到树的主干,然后不在主干上的节点一定可以连接到主干的某个节 ...
- ARM MOV PC加8
缘由 今天在分析ARM伪指令ADR,书上说ADR通常会被一条ADD或SUB指令替代实现相同功能.我反汇编了一下确实如此会基于PC相对偏移的地址量读取到寄存器中,可是计算却发现对不上 如上图所示,ADR ...
- 操作 frames 框架下的 dom 内容。
2016-12-30 框架名: var obj=$(window.frames["wangpan"].document).find("a[menu=download_on ...
- Lintcode27-Reverse 3-digit Integer
Reverse a 3-digit integer. Example Example 1: Input: number = 123 Output: 321 Example 2: Input: numb ...
- hihoCoder 1515 分数调查(带权并查集)
http://hihocoder.com/problemset/problem/1515 题意: 思路: 带权并查集的简单题,计算的时候利用向量法则即可. #include<iostream&g ...
- linux_nmon监控方法
一.介绍 Nmon 工具是 IBM 提供的免费的在AIX与各种Linux操作系统上广泛使用的监控与分析工具.该工具可将服务器的系统资源耗用情况收集起来并输出一个特定的文件,并可利用 excel 分析工 ...
- 【Java】【THINK】
1. 新建类,应优先考虑“组织”对象,而不是继承.这样可以保持清爽. 2. Java对象&对象句柄: 声明了一个类型的变量也就是声明了一个该类型的对象.但是这个对象只是个抽象的概念,并不会在内 ...
- _itemmod_day_limit
控制玩家每天获得的物品上限 表说明 `comment` 备注 `entry` 物品 `limitCount`获取上限
- _talent_req
学习天赋时,将产生消耗,当玩家已经学习过该天赋时,不产生消耗 comment 备注 spellId 天赋技能ID reqId 消耗模板ID,对应_req表中reqId
- C# 用面向对象的思想去编程
再接上一篇博文,之前写的两篇博文虽然实现了功能,但是和控件之间的粘性太大,依赖于控件进行操作,所以这篇博文主要用面向对象的思想做一个Demo,将逻辑层与显示层剥离开 首先新建一个窗体文件,搭建界面完毕 ...