2015 Multi-University Training Contest 2

1002 Buildings

特别拐弯抹角的平面几何模拟计算

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
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<string>
#include<queue>
#include<stack>
#include<set>
#include<map>

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
const int maxn=210;
const int inf=0x7fffffff;
const double eps=1e-3;

int N,M;


int main()
{
int x,y;
while(~scanf("%d%d%d%d",&N,&M,&x,&y))
{
if (M<N)
{
swap(N,M);
swap(x,y);
}
int t0=(N+1)>>1;
int up=x-1;
int down=N-x;
int left=y-1;
int right=M-y;
//cout<<t0<<endl;
if ((N&1)&&N==M&&x==y&&x==(N+1)/2)
printf("%d\n",t0-1);
/*else if (min(up,down)>t0)
printf("%d\n",min(max(left,right),min(up,down)));*/
else
{
x=min(x,N-x+1);
y=min(y,M-y+1);
t0=max(t0,min(N-x,y));
t0=min(t0,(M+1)/2);
printf("%d\n",t0);
}

}
return 0;
}

2015 Multi-University Training Contest 2

https://devblog.citruxonve.net/posts/19dec2a1/

Author

Semprathlon / Simfae Dean

Posted on

07/24/2015

Updated on

07/19/2023

Licensed under

Comments