zoukankan      html  css  js  c++  java
  • codeforces 400 C Inna and Huge Candy Matrix【模拟】

    题意:给出一个矩形的三种操作,顺时针旋转,逆时针旋转,对称,给出原始坐标,再给出操作数,问最后得到的坐标

    画一下模拟一下操作就可以找到规律了

     1 #include<iostream>  
     2 #include<cstdio>  
     3 #include<cstring> 
     4 #include <cmath> 
     5 #include<stack>
     6 #include<vector>
     7 #include<map> 
     8 #include<set>
     9 #include<queue> 
    10 #include<algorithm>  
    11 using namespace std;
    12 
    13 #define foreach(i,c) for (__typeof(c.begin()) i = c.begin(); i != c.end(); ++i)
    14 
    15 typedef long long LL;
    16 const int INF = (1<<30)-1;
    17 const int mod=1000000007;
    18 const int maxn=100005;
    19 
    20 int main(){
    21     int N,M,x,y,z,p;
    22     cin>>N>>M>>x>>y>>z>>p;
    23     x=x%4;y=y%2;z=z%4;
    24     while(p--){
    25         int n,m;
    26         n=N;m=M;
    27         int u,v;
    28         cin>>u>>v;
    29         for(int i=0;i<x;i++){
    30             swap(u,v);
    31             swap(n,m);
    32             v=m+1-v;
    33         }
    34         if(y) v=m+1-v;
    35         for(int i=0;i<z;i++){
    36             swap(u,v);
    37             swap(n,m);
    38             u=n+1-u;            
    39         }
    40         printf("%d %d
    ",u,v);        
    41     }
    42     return 0;
    43 }
    View Code

    大中午的做模拟---好醒觉啊

    ----- 加油---go000000000000000

  • 相关阅读:
    fastjson 使用方法
    算法
    SHA算法
    MD5算法
    kindle推送服务
    DLL劫持
    Hook编程
    Hook技术
    权限验证
    虚拟机
  • 原文地址:https://www.cnblogs.com/wuyuewoniu/p/4478992.html
Copyright © 2011-2022 走看看