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\)的矩阵可 ...
随机推荐
- 怎么把MVC的Controller拆分写到别的类库
以为很难…… 其实直接继承Controller 并且按MVC_Controllser规则命名. 然后网站项目引用该项目即可.
- Android init.rc执行顺序
转自:http://blog.csdn.net/kickxxx/article/details/7590665 1. 所有的action运行于service之前 2. 下面为各个section的执行 ...
- MVC4 遇到问题总结
1.路径编写: 举例1.<img src="../Login/VailCode" width="108" height="40"&g ...
- 图结构练习——最短路径(dijkstra算法(迪杰斯拉特))
图结构练习——最短路径 Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描述 给定一个带权无向图,求节点1到节点n的最短路径. ...
- 蛋疼的Fedora17
在公司给同事要安装ASM oracle 11g,说要在forder17上安装,于是乎我先在自己的虚拟机上安装了一个forder17,遇到了几个很蛋疼的问题: 1. 安装的时候没有创建普通用户 ...
- NBU expired Media,Media ID not found in EMM database
Subject:When attempting to expire a media in Veritas NetBackup (tm) 6.0 with the bpexpdate command, ...
- Bat脚本实现MySQL数据库SQL文件备份
@echo offecho 在线兑奖系统自动备份脚本(请勿关闭) 联系人: 电话::loopset /a "FDate=%date:~,4%%date:~5,2%%date:~8,2%&q ...
- 第二十三篇:在SOUI中使用LUA脚本开发界面
像写网页一样做客户端界面可能是很多客户端开发的理想. 做好一个可以实现和用户交互的动态网页应该包含两个部分:使用html做网页的布局,使用脚本如vbscript,javascript做用户交互的逻辑. ...
- ios内购
1.添加框架,storeKit.framework 需要真机调试 /* 内购五步: 1.请求可销售商品的列表 2.展示课销售的商品 3.点击购买 4.开具小票 5.创建交易对象并添加到交易队列 6.创 ...
- 智能车学习(十四)——K60单片机GPIO学习
一.头文件: #ifndef __MK60_GPIO_H__ #define __MK60_GPIO_H__ #include "MK60_gpio_cfg.h" /* * 定义管 ...