博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
cf-123B
阅读量:4286 次
发布时间:2019-05-27

本文共 767 字,大约阅读时间需要 2 分钟。

    题目

#include 
#include
#include
typedef long long ll;using namespace std;int main() { ll a, b, x, y, x1, y1, x2, y2; cin >> a >> b >> x1 >> y1 >> x2 >> y2; x = x1, y = y1; // xuan zhuang 45 du x1 = x + y; y1 = y - x;// cout << x1 << " " << y1 << endl; x = x2, y = y2; // xuan zhuang 45 du x2 = x + y; y2 = y - x;// cout << x2 << " " << y2 << endl; a *= 2; b *= 2; x1 = x1 / a + (x1 > 0); // 判断 x1 ,x2,y1,y2 shi fou zai tong yi ce ,if yes ,+1 ;or + 0; x2 = x2 / a + (x2 > 0); y1 = y1 / b + (y1 > 0); y2 = y2 / b + (y2 > 0);// cout << x1 << " " << x2 << " " << y1 << " " << y2 << endl; cout << max(abs(y2 - y1), abs(x2 - x1)) << endl; // de dao jie guo qu zui da zhi return 0;}

你可能感兴趣的文章
常用泰勒展开
查看>>
vector length_error
查看>>
Shell脚本处理浮点数的运算和比较实例
查看>>
bash shell for循环1到100
查看>>
latex中长公式换行,很好的办法
查看>>
nohup命令
查看>>
make 操作技巧指南--gcc版本设置
查看>>
sort和sortrows对矩阵排序
查看>>
matlab专区--------------matlab里面如何保留小数特定位数
查看>>
Matlab 绘图坐标轴刻度设置小数位数
查看>>
Matlab 条形图绘制 以及 添加误差棒 改变条形图形状
查看>>
cmake基本用法
查看>>
matlab 增加或减少图例 legend 线的长度
查看>>
matlab:把cell中的某个元素删去
查看>>
matlab 集合运算 交集 并集 差集
查看>>
C++ 给vector去重的三种方法
查看>>
map的详细用法
查看>>
C++初始化函数列表
查看>>
STL各种排序
查看>>
#include<map>
查看>>