codeforces round #234B(DIV2) C Inna and Huge Candy Matrix
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility> using namespace std; typedef pair<int,int> Point; int n,m; void clockwise_rotate(Point &cell, int x){
for(int i = ; i < x; ++ i){
int tmp = cell.first;
cell.first = cell.second;
cell.second = n-tmp + ;
swap(n,m);
}
} void horizontal_rotate(Point &cell, int y){
if(y==) cell.second = m - cell.second +;
} int main(){
int x,y,z,p;
cin >> n >> m >> x >> y >> z >> p;
x %=; y %=; z %= ;
int tmp_n = n,tmp_m = m;
for(int i = ; i < p; ++ i){
n = tmp_n; m =tmp_m;
int cellX,cellY;
cin >> cellX >> cellY;
Point cell = make_pair(cellX,cellY);
clockwise_rotate(cell,x);
horizontal_rotate(cell,y);
clockwise_rotate(cell,-z);
cout<<cell.first<<" "<<cell.second<<endl;
}
return ;
}
codeforces round #234B(DIV2) C Inna and Huge Candy Matrix的更多相关文章
- codeforces round #234B(DIV2) A Inna and Choose Options
#include <iostream> #include <string> #include <vector> using namespace std; ; ,,, ...
- codeforces round #234B(DIV2) B Inna and New Matrix of Candies
#include <iostream> #include <vector> #include <string> #include <algorithm> ...
- codeforces C. Inna and Huge Candy Matrix
http://codeforces.com/problemset/problem/400/C 题意:给你一个n*m的矩阵,然后在矩阵中有p个糖果,给你每个糖果的初始位置,然后经过x次顺时针反转,y次旋 ...
- codeforces C. Inna and Huge Candy Matrix 解题报告
题目链接:http://codeforces.com/problemset/problem/400/C 题目意思:给出一个n行m列的矩阵,问经过 x 次clockwise,y 次 horizontal ...
- codeforces 400 C Inna and Huge Candy Matrix【模拟】
题意:给出一个矩形的三种操作,顺时针旋转,逆时针旋转,对称,给出原始坐标,再给出操作数,问最后得到的坐标 画一下模拟一下操作就可以找到规律了 #include<iostream> #inc ...
- Codeforces Round #539 div2
Codeforces Round #539 div2 abstract I 离散化三连 sort(pos.begin(), pos.end()); pos.erase(unique(pos.begin ...
- 【前行】◇第3站◇ Codeforces Round #512 Div2
[第3站]Codeforces Round #512 Div2 第三题莫名卡半天……一堆细节没处理,改一个发现还有一个……然后就炸了,罚了一啪啦时间 Rating又掉了……但是没什么,比上一次好多了: ...
- Codeforces Round#320 Div2 解题报告
Codeforces Round#320 Div2 先做个标题党,骗骗访问量,结束后再来写咯. codeforces 579A Raising Bacteria codeforces 579B Fin ...
- Codeforces Round #564(div2)
Codeforces Round #564(div2) 本来以为是送分场,结果成了送命场. 菜是原罪 A SB题,上来读不懂题就交WA了一发,代码就不粘了 B 简单构造 很明显,\(n*n\)的矩阵可 ...
随机推荐
- .net学习笔记---xml基础知识
一.XML简介 XML是一种标记语言,用于描述数据,它提供一种标准化的方式来来表示文本数据.XML文档以.xml为后缀.需要彻底注意的是XML是区分大小写的. 先从一个简单的XML例子来了解下xml基 ...
- JAVA基础学习之final关键字、遍历集合、日期类对象的使用、Math类对象的使用、Runtime类对象的使用、时间对象Date(两个日期相减)(5)
1.final关键字和.net中的const关键字一样,是常量的修饰符,但是final还可以修饰类.方法.写法规范:常量所有字母都大写,多个单词中间用 "_"连接. 2.遍历集合A ...
- 【PHP Cookie&&Session】
大部分的人都知道Cookie,但是可能不了解Session,现在对这两者进行解释. 问题的提出: 有些网站会提示用户在一定的时间之内免登陆,这是用的什么技术?答案是Cookie技术. 有些购物网站会提 ...
- 安装oracle 12c RAC遇到的一些问题
(1) 安装grid软件,停止在38%很长时间不动,日志显示正常 解决方法: 由于是虚拟机安装,设置的内存为600M,关闭虚拟机,把内存调成1GB,问题解决~在38%Linking RMAN Ut ...
- nexus私有仓库搭建
步骤: 下载安装JDK(注意可用版本) .查看CentOS自带JDK是否已安装,输入: yum list installed |grep java 一般来说,如果是新装CentOS系统的话,不会有JD ...
- HP SAN Switch光纖交換機命令行畫zone
有時候我們無法登陸網頁交互界面去操縱交換機,如下提供了命令行方式從交換機劃zone 1.創建別名 alicreate "SummaryDB_N", "211,14; 21 ...
- Bootstrap看厌了?试试Metro UI CSS吧
(此文章同时发表在本人微信公众号"dotNET每日精华文章",欢迎右边二维码来关注.) 题记:Bootstrap作为一款超级流行的前端框架,已经成为很多人的首选,不过有时未免有点审 ...
- 装饰模式/decorator模式/结构型模式
装饰模式Decorator 定义 为对象动态的增加新的功能,实现要求装饰对象和被装饰对象实现同一接口或抽象类,装饰对象持有被装饰对象的实例. java实现要点 定义一个接口或抽象类,作为被装饰者的抽象 ...
- user-select
样式详查 http://www.css88.com/book/css/properties/user-interface/user-select.htm 1, user-select: none ...
- Spring官网改版后下载
Spring官网改版后找了好久都没有找到直接下载Jar包的链接,下面汇总些网上提供的方法,亲测可用. 1.直接输入地址,改相应版本即可:http://repo.springsource.org/lib ...