Tiling UVALive
来源:互联网 发布:淘宝轮毂 编辑:程序博客网 时间:2024/05/19 03:28
Tiling UVALive - 6046
题目链接:https://cn.vjudge.net/problem/UVALive-6046
#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>#include <math.h>using namespace std;struct node{ int x,y;}a[100010];int gcd(int m,int n){ while (n != 0) { int t = m % n; m = n; n = t; } return m;}int main(){ int t; int tt=1; scanf("%d",&t); while(t--){ for (int i=0;i<3;i++){ scanf("%d%d",&a[i].x,&a[i].y); } int aa[10]; aa[0]=fabs(a[0].x*a[1].y-a[1].x*a[0].y); aa[1]=fabs(a[0].x*a[2].y-a[2].x*a[0].y); aa[2]=fabs(a[1].x*a[2].y-a[2].x*a[1].y); sort(aa,aa+3); int ss=gcd(aa[2],aa[1]); if (ss>aa[0]){ int qq=gcd(ss,aa[0]); printf("Case #%d: %d\n",tt++,qq); } else{ int qq=gcd(aa[0],ss); printf("Case #%d: %d\n",tt++,qq); } } return 0;}
阅读全文
0 0
- Tiling UVALive
- Tiling
- Tiling
- Tiling
- Tiling
- Tiling
- Tiling
- Tiling
- UVALive
- UVALive
- UVALive
- UVALive
- UVALive
- UVALive
- UVALive
- UVALive
- UVALive
- UVALive
- scrapy-redis集成scrapy-splash使用教程
- 图像特征的特点及其常用的特征提取与匹配方法
- TP语法
- PAT B1060. 爱丁顿数
- hdu 6047 Maximum Sequence
- Tiling UVALive
- Java日期格式转换
- 使用ViewPager的功能(解决切换Fragment状态不保存)
- SAP ABAP开发实用快捷键
- C#将项目的dll,打包到exe文件中,使用LoadResourceDll类
- Lua中的三目运算符
- 使用apache的commons.io包读取文件
- OpenCV3.0 + VS2013 配置一:基本配置
- Maven项目构建命令compile、test、package