HDU 5050
http://acm.hdu.edu.cn/showproblem.php?pid=5050
大数gcd
import java.io.* ;
import java.math.* ;
import java.util.* ;
import java.text.* ; public class Main
{
public static void main(String[] args)
{
Scanner cin=new Scanner (new BufferedInputStream(System.in)) ;
BigInteger A,B ;
int t=cin.nextInt() ;
for (int cas= ;cas<=t ;cas++)
{
A=cin.nextBigInteger() ;
B=cin.nextBigInteger() ;
System.out.print("Case #"+cas+": ") ;
System.out.println(A.gcd(B).toString()) ;
}
}
}
HDU 5050的更多相关文章
- hdu 5050 大数
http://acm.hdu.edu.cn/showproblem.php?pid=5050 大数模板最大公约数 信kuangbin,能AC #include <cstdio> #incl ...
- Hdu 5050 Divided Land
题目要求就是做求两个二进制数的gcd,如果是用java的话,这题很简单.但也可以用C++做,只能先给自己留下这个坑了,还在研究c++的做法. import java.math.BigInteger; ...
- HDU 5050 Divided Land(进制转换)
题意 给你两个二进制数m,n 求他们的最大公约数 用二进制表示 0<m,n<2^1000 先把二进制转换为十进制 求出最大公约数 再把结果转换为二进制 数比較大要用到大数 ...
- HDU - 5050 (大数二进制gcd)
It's time to fight the local despots and redistribute the land. There is a rectangular piece of land ...
- hdu 5050 java程序求大数最大公约数
import java.io.*; import java.math.*; import java.util.*; import java.text.*; public class Main { pu ...
- HDU 5045 5047 5050 5053(上海网络赛E,F,I,L)
HDU 5045 5047 5050 5053 太菜了,名额差点没保住.吓尿..赶紧开刷树链抛分 5045:状压DP.压缩10个人.因为两个人不能差2以上,所以能够用01表示 5047:推推公式就可以 ...
- HUD 5050 Divided Land
http://acm.hdu.edu.cn/showproblem.php?pid=5050 题目大意: 给定一个矩形的长和宽,把这个矩形分成若干相等的正方形,没有剩余.求正方形的边长最长是多少. 解 ...
- 【HDU 3483】 A Very Simple Problem (二项式展开+矩阵加速)
A Very Simple Problem Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Ot ...
- HDU 3466(01背包变种
http://acm.hdu.edu.cn/showproblem.php?pid=3466 http://www.cnblogs.com/andre0506/archive/2012/09/20/2 ...
随机推荐
- guava学习--Optional可空类型
转载:http://www.cnblogs.com/whitewolf/p/4231783.html Null sucks 回到本文主题Optional.在我日常编程中NullPointerExcep ...
- formvalidator4.1.3 使用过程中一些问题的解决
在使用formvalidator4.1.3 插件时 发现 正常情况调用时没有问题的,但是我们的项目中需要把css .js 之类的静态资源用单独的域名加载. 那么问题就来了在 该插件中 有一段这样的 ...
- Floyd 算法的动态规划本质
[转载自:http://www.cnblogs.com/chenying99/p/3932877.html] Floyd–Warshall(简称Floyd算法)是一种著名的解决任意两点间的最短路径(A ...
- 在ASP.NET MVC中使用CKEditor和CkFinder
在你需要使用editor控件的页面头部添加: <head> ... <script type="text/javascript" src="/ckedi ...
- 绑定本地Service并与之通信-----之二
import android.os.Bundle;import android.os.IBinder;import android.app.Activity;import android.app.Se ...
- cstring 的重载
#include <iostream> #include <windows.h> using namespace std; +; class MyString { public ...
- C#中三种定时器对象的比较
·关于C#中timer类 在C#里关于定时器类就有3个1.定义在System.Windows.Forms里2.定义在System.Threading.Timer类里3.定义在System.Timers ...
- Oracle内置函数内容整理
--绝对值select abs(-100) from dual; --取余select mod(8,3) from dual; --取整,大于该数的最小整数(上限值)select ceil(12.0) ...
- POJ 2255 Tree Recovery 树的遍历,分治 难度:0
http://poj.org/problem?id=2255 #include<cstdio> #include <cstring> using namespace std; ...
- IPTables系列:如何配置Ubuntu 14.04中的IPTables防火墙
IPTables基本命令 在向大家介绍复杂防火墙规则之前,还是先上一些简单的料,让大家对IPTables最为基本的命令有一些简单了解. 首先要说明的是IPTables命令必需以root权限运行,这意味 ...