-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathPIZZALOC.cpp
78 lines (47 loc) · 1.22 KB
/
PIZZALOC.cpp
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#include<iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
struct point
{
int x;
int y;
};
struct solitare
{
point p;
int num;
};
bool calcDistance(point p1,point p2,int R)
{
double d=sqrt((p1.x-p2.x)*(p1.x-p2.x) + (p2.y-p1.y)*(p2.y-p1.y));
double b=(double)R;
if(d<b)
return true;
return false;
}
int main()
{
int K,R;
scanf("%d%d",&K,&R);
int M;
scanf("%d",&M);
point a[M];
for(int i=0;i<M;i++)
scanf("%d%d",&a[i].x,&a[i].y);
int f=(int)pow(2.0,(double)M);
int subset[f][M];
memset(subset,0,sizeof(subset));
for(int i=0;i<f;i++)
{
for(int j=0;j<M;j++)
{
if(i&1<<j)
subset[i][j]=1;
}
}
int N;
scanf("%d",&N);
solitare s[N];
for(int i=0;i<N;i++)
scanf("%d%d%d",&s[i].p.x,&s[i].p.y,&s[i].num);