hiho week 177 register

Ended

Participants:499

Verdict:Accepted
Score:100 / 100
Submitted:2017-11-22 17:47:02

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 <bits/stdc++.h>
using namespace std;
struct node
{
    int x,y;
}b[1001000];
int n,m,cnt;
void dfs(int x,int y,int tmp,int now)
{
    if(tmp==1)tmp=2;
    if(now>=n)return;
        b[cnt].x=x+tmp;
        b[cnt++].y=y-tmp;
         b[cnt].x=x+tmp;
        b[cnt++].y=y+tmp;
        dfs(x+tmp,y-tmp,tmp/2,now+1);
        dfs(x+tmp,y+tmp,tmp/2,now+1);
}
int find1(int x,int y)
{
    int ans=0;
    for(int i=0;i<cnt;i++)
    {
        if(b[i].x<=x&&b[i].y<=y)
        {
           // cout<<b[i].x<<" "<<b[i].y<<" "<<i<<endl;
            ans++;}
    }
    return ans;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX