java有大数模板

import java.util.Scanner;
import java.math.*;
public class Main {
public static void main(String[] args) {
Scanner cin =new Scanner(System.in);
int T=cin.nextInt();
BigInteger c=BigInteger.valueOf(0);
for(int i=1;i<=T;++i){
BigInteger a=cin.nextBigInteger();
BigInteger b=cin.nextBigInteger();
b=b.abs();
a=a.mod(b);
System.out.print("Case "+i+": ");
if(a.compareTo(c)==0)System.out.println("divisible");
else System.out.println("not divisible");
}
}
}

LightOJ 1214 Large Division 水题的更多相关文章

  1. LightOJ 1214 Large Division

    Large Division Given two integers, a and b, you should check whether a is divisible by b or not. We ...

  2. light oj 1214 - Large Division

    1214 - Large Division   PDF (English) Statistics Forum Time Limit: 1 second(s) Memory Limit: 32 MB G ...

  3. light oj 1214 - Large Division 大数除法

    1214 - Large Division Given two integers, a and b, you should check whether a is divisible by b or n ...

  4. 1214 - Large Division -- LightOj(大数取余)

    http://lightoj.com/volume_showproblem.php?problem=1214 这就是一道简单的大数取余. 还想还用到了同余定理: 所谓的同余,顾名思义,就是许多的数被一 ...

  5. LightOJ 1248 Dice (III) (水题,期望DP)

    题意:给出一个n面的色子,问看到每个面的投掷次数期望是多少. 析:这个题很水啊,就是他解释样例解释的太...我鄙视他,,,,, dp[i] 表示 已经看到 i 面的期望是多少,然后两种选择一种是看到新 ...

  6. lightoj 1020 (博弈水题)

    lightoj 1020 A Childhood Game 链接:http://lightoj.com/volume_showproblem.php?problem=1020 题意:一堆石子有 m 个 ...

  7. LightOJ 1023 Discovering Permutations 水题

    http://www.lightoj.com/volume_showproblem.php?problem=1023 题意:26字母全排列 思路:用next_permutation或者思维想一下都可以 ...

  8. codeforces 558B B. Amr and The Large Array(水题)

    题目链接: B. Amr and The Large Array time limit per test 1 second memory limit per test 256 megabytes in ...

  9. 二分--LIGHTOJ 1088查找区间(水题)

    #include <iostream> #include <cstdio> #include <cmath> using namespace std; const ...

随机推荐

  1. php 中 isset()函数 和 empty()函数的区别

    首先这两个函数都是用来测试变量的状态: isset()函数判断一个变量是否在 如果存在返回true  否则返回false empty()函数判断一个变量是否为空,如果为空返回true 否则返回fals ...

  2. 一个基本jquery的评论留言模块

    <div class="productDiscuss"> <div class="title"><span class=" ...

  3. mysql索引使用笔记

    1.使用explain语句查看性能mysql> explain select product_id from orders where order_id in (123, 312, 223, 1 ...

  4. ZeroMQ/jzmq安装使用

    环境: No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 12.04.2 LTS Release: 12 ...

  5. Boost format

    浅尝boost之format 概述      std::string是个很不错的东东,但实际使用时基本在每个程序里都会遇到不愉快的事情:格式化字符串.我甚至由于这个原因在代码里引入平台有关的MFC,A ...

  6. OSG-3.4.0 简要说明(Readme)

    欢迎来到OpenSceneGraph(OSG)世界. Welcome to the OpenSceneGraph (OSG). 对于项目最新信息, 以及如何编译和运行库和示例的更多细节, 可以查看OS ...

  7. Boost 1.62.0 编译参数

    # Copyright Vladimir Prus 2002-2006.# Copyright Dave Abrahams 2005-2006.# Copyright Rene Rivera 2005 ...

  8. Boost IPC Persistence Of Interprocess Mechanisms 例子

    下面这一段摘抄自 Boost 1_55_0 的文档,显然标注了 每一个的生命期. One of the biggest issues with interprocess communication m ...

  9. C# dynamic

    [TestMethod] public void DynamicTest() { dynamic Customer = new ExpandoObject(); Customer.Name = &qu ...

  10. ios音频视频资料--备用

    视频播放 MediaPlayer.framework MPMoviePlayerViewController VS MPMoviePlayerController MPMoviePlayerViewC ...