LightOJ1214 Large Division
/*
LightOJ1214 Large Division
http://lightoj.com/login_main.php?url=volume_showproblem.php?problem=1214 数论 同余定理 题意:大整数取余
*
*
*
*
*/ #include <cstdio>
#include <cstring>
using namespace std;
char s[];
int main()
{
int t;
scanf("%d",&t);
long long b;
for(int i=;i<=t;i++)
{
printf("Case %d: ",i);
getchar();
scanf("%s",s);
scanf("%lld",&b);
int n=strlen(s);
long long num=0LL;
for(int i=;i<n;i++)
{
if(s[i]=='-')
continue;
num=(num*10LL+s[i]-'')%b;
}
if(num==0LL)
printf("divisible\n");
else
printf("not divisible\n");
}
return ;
}
LightOJ1214 Large Division的更多相关文章
- LightOJ1214 Large Division —— 大数求模
题目链接:https://vjudge.net/problem/LightOJ-1214 1214 - Large Division PDF (English) Statistics Forum ...
- LightOJ1214 Large Division 基础数论+同余定理
Given two integers, a and b, you should check whether a is divisible by b or not. We know that an in ...
- light oj 1214 - Large Division
1214 - Large Division PDF (English) Statistics Forum Time Limit: 1 second(s) Memory Limit: 32 MB G ...
- (大数 求余) Large Division Light OJ 1214
Large Division Given two integers, a and b, you should check whether a is divisible by b or not. We ...
- LightOJ 1214 Large Division
Large Division Given two integers, a and b, you should check whether a is divisible by b or not. We ...
- K - Large Division 判断a是否是b的倍数。 a (-10^200 ≤ a ≤ 10^200) and b (|b| > 0, b fits into a 32 bit signed integer). 思路:取余;
/** 题目:K - Large Division 链接:https://vjudge.net/contest/154246#problem/K 题意:判断a是否是b的倍数. a (-10^200 ≤ ...
- 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 ...
- 1214 - Large Division -- LightOj(大数取余)
http://lightoj.com/volume_showproblem.php?problem=1214 这就是一道简单的大数取余. 还想还用到了同余定理: 所谓的同余,顾名思义,就是许多的数被一 ...
- LightOJ 1214 Large Division 水题
java有大数模板 import java.util.Scanner; import java.math.*; public class Main { public static void main( ...
随机推荐
- int*与(int*)的差别
晚上被问到一个C++的问题: int **pa=new int* [5]; int *pb=new (int*)[5]; 上面两行代码的差别是什么? 分析与实验结果例如以下: (1)第一行代码能够在V ...
- selenium找到页面元素click没反应
问题描述:通过调试可以看到控制台已经找到了起诉入口页面元素,可是点击“我是原告”没有反应了,也没有报错 解决办法:登录时是跳进了两层的iframe中,需要跳出iframe才能找到我是原告.
- jsp:attribute
在传统 JSP 中,想要实现页面布局管理比较麻烦,为了解决在 JSP 中布局的问题,出现了很多开源软件,比如 Apache Tiles 和 SiteMesh 就是其中比较优秀的.但是使用开源软件实现布 ...
- yolo源码解析(3):进行简单跳帧
视频检测命令 ./darknet detector demo cfg/coco.data cfg/yolov3-tiny.cfg yolov3-tiny.weights ../../dataset/ ...
- Swift3.0 split函数切割字符串
我们先看函数的原型: public func split(separator: Self.Iterator.Element, maxSplits: Int = default, omittingEmp ...
- Hashmap 详解和迭代器问题
重点介绍HashMap.首先介绍一下什么是Map.在数组中我们是通过数组下标来对其内容索引的,而在Map中我们通过对象来对对象进行索引,用来索引的对象叫做key,其对应的对象叫做value.在下文中会 ...
- A - George and Accommodation
Problem description George has recently entered the BSUCP (Berland State University for Cool Program ...
- [转]Java设计模式学习心得
http://tech.it168.com/focus/200902/java-design/index.html http://tech.it168.com/j/2007-05-17/2007051 ...
- 使用新的CSS类型对象模型
el.attributeStyleMap.set('padding', CSS.px(42)); const padding = el.attributeStyleMap.get('padding') ...
- Android线性渐变
布局实现: 1. 在res中建立drawable文件夹. 2. 在drawable文件夹中建立shape.xml. 3. shape.xml的代码如下: <?xml version=" ...