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实现单向链表

    供参考,代码还可继续打磨 同时放在了我的github上:https://github.com/hheedat/demo/blob/master/learn_php/58_linked_list.php ...

  2. php 中文字符串首字母的获取函数

    这篇文章介绍了php 中文字符串首字母的获取函数,有需要的朋友可以参考一下 function chineseFirst($str) { $str= iconv("UTF-8",&q ...

  3. live 写博

    1           2           3           4           5         1       2       3       4       5         ...

  4. PYTHON代码摘录

    文件处理 #典型的读取文件代码 row_data = {} with open('PaceData.csv') as paces: column_heading = paces.readline(). ...

  5. MVC 中 使用TagBuilder扩展HtmlHelper

    TagBuilder就是标签建造器,我们就用它来建造属于我们自己标签生成函数. 无废话,直接上代码 例: using System.Web.Mvc; public static class HtmlE ...

  6. Python的设计模式学习

    1.工厂模式 #encoding=utf-8 __author__ = 'kevinlu1010@qq.com' class ADD(): def getResult(self,*args): ret ...

  7. 【gitlab】版本管理工具

  8. 解决Matlab启动时 " Can't check 9.0 VCRTs The application has failed to start because……" 的错误

    注:转载或引用请注明出处 今天在winserver 2012 r2 上安装matlab 2016b , 安装完成运行时提示: ERROR: Cnn't check 9.0 VCRTs <star ...

  9. cocos-html5 JS 写法基础 语言核心

    转载:http://blog.csdn.net/leasystu/article/details/18735797 cocos2dx 3.0 js继承:John Resiq的继承写法解析 CCClas ...

  10. easyui源码翻译1.32--Droppable(放置)

    前言 使用$.fn.droppable.defaults重写默认值对象.下载该插件翻译源码 源码 /** * jQuery EasyUI 1.3.2 * *翻译:lbq --放置 拉伸 */ (fun ...