codeforces 527A Playing with Paper
来源:互联网 发布:windows git 自动更新 编辑:程序博客网 时间:2024/05/20 01:08
点击打开链接
题意:给出一个矩形,求能分割出多少个正方形。分析:长的除以短的就是这个矩形能割出几个正方形,如果剩下一部分,就又回到了原来的问题。
注意超出了int的范围!
#include<stdio.h>#include<algorithm>using namespace std;int main(){ long long a,b; scanf("%I64d%I64d",&a,&b); if(a<b) { long long w=a; a=b; b=w; } long long s=0; while(a%b) { s+=a/b; long long m=max(b,a%b); long long n=min(b,a%b); a=m; b=n; } printf("%I64d\n",s+a/b); return 0;}
阅读全文
0 0
- Codeforces 527A Playing with Paper
- CodeForces 527A Playing with Paper
- codeforces 527A Playing with Paper
- 527A. Playing with Paper
- 527A. Playing with Paper
- CodeForces 527A Playing with Paper 折纸游戏
- A. Playing with Paper
- A. Playing with Paper
- A-Playing with Paper
- A-Playing with Paper
- 527A. Playing with Paper【math】
- Codeforces Round #296 (Div. 2) A. Playing with Paper
- Codeforces Round #296 (Div. 2) -----A. Playing with Paper
- A. Playing with Paper( Codeforces Round #296 (Div. 2) 水题)
- Playing with Paper
- CF527A Playing with Paper
- codeforces--12.29--A. Playing with Dice
- codeforces 378A Playing with Dice
- 有关FPGA硬件加速平台资料
- POJ3021
- 序列化和反序列化
- 90. Subsets II 子集列举
- Vue.js常用的语法(一)
- codeforces 527A Playing with Paper
- PDF转CAD的技巧以及转换后的编辑方法
- 分类中数据不平衡问题的解决经验
- ngnix 作为django项目的web服务器
- untiy射线(简单追踪的实现)
- win7 安装tf
- 网易 最大奇约数
- Egret
- ArrayList源码解析——JDK1.8