青岛站 比赛日程相关题

emmm ,青岛站没能做出来的题目  很遗憾,也很对不起 队友

 

#include <bits/stdc++.h>
using namespace std;
const int N = 1e4;

int mp[N][N];

//1 1 8 8 mx = 4 my = 4
void draw(int stx,int sty,int edx,int edy)
{
    int mx = (stx+edx) / 2;
    int my = (sty+edy) / 2;
    if(edx == mx && edy == my) {
        mp[mx][my] = 1;
        return ;
    }
    draw(stx, sty, mx, my);
    for(int i=stx; i<=mx; i++) {
        for(int j=my+1; j<=edy; j++) {
            mp[i][j] = mp[i][j-my] + my;
            // cout << i <<" "<< j <<" " << mp[i][j] << " " << mp[i][j-my] <<endl;
        }
    }
    for(int i=mx+1; i<=edx; i++) {
        for(int j=sty; j<=my; j++) {
            mp[i][j] = mp[i-mx][j] + mx;
        }
    }
    for(int i=mx+1; i<=edx; i++) {
        for(int j=my+1; j<=edy; j++) {
            mp[i][j] = mp[i-mx][j-my];
        }
    }
    
    //draw(stx, my+1, mx, edy);
    //draw(mx+1, sty, edx, my);
    //draw(mx+1, my+1, edx, edy);
}
void print()
{
    for(int i=1; i<=8; i++) {
        for(int j=1; j<=8; j++) {
            printf("%d%c", mp[i][j], j==8?'\n':' ');
        }
    }
}

void init() 
{
    draw(1, 1, 1024, 1024);    
}

int main()
{
    init();
    print();
    return 0;
}

 

posted @ 2018-11-04 20:07  Draymonder  阅读(146)  评论(0编辑  收藏  举报