hiho week 114 register

Ended

Participants:295

Verdict:Accepted
Score:100 / 100
Submitted:2016-09-06 18:47:46

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
struct mat
{
    int mp[101][101];
};
bool cmp(const mat&a,const mat&b,int x1,int y1,int x2,int y2 )
{
    for (int i=x1; i<=x2; i++)
        for (int j=y1; j<=y2; j++)
            if (a.mp[i][j]!=b.mp[i][j])
                return (a.mp[i][j]<b.mp[i][j]);
    return false;
}
void rota(mat &m,int x1,int y1,int x2,int y2)
{
    mat tmp;
    for (int i=x1; i<=x2; i++)
        for (int j=y1; j<=y2; j++)
            tmp.mp[j-y1+1+x1-1][x2-i+1+y1-1]=m.mp[i][j];
    for (int i=x1; i<=x2; i++)
        for (int j=y1; j<=y2; j++)
            m.mp[i][j]=tmp.mp[i][j];
}
void rotate_block(mat &m,int n,int x1,int y1,int x2,int y2)
{
    int n1=(x2-x1+1)/2;
    int n2=(y2-y1+1)/2;
    for (int i=x1; i<n1+x1; i++)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX