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( ...
随机推荐
- redhat gitlab的搭建
http://www.cnblogs.com/derekchen/p/5870723.html 1.新建 /etc/yum.repos.d/gitlab-ce.repo,添加以下内容 [gitlab- ...
- css让文字旋转270度
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD ...
- 设计一部iphone手机用面向对象的方法
main.m //编辑字体大小command + < //编译执行快捷键 com + R #import <Foundation/Foundation.h> #import &quo ...
- poj1028--动态规划--Ignatius and the Princess III
Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K ...
- cxf调用WebService
一.用CXF调用WebService的几种方式,参考: http://cxf.apache.org/docs/how-do-i-develop-a-client.html 二.JaxWsProxyFa ...
- 最详细的CentOS 6与7对比(一):常见设置对比
本主题将从3个角度进行对比 常见设置(CentOS 6 vs CentOS 7) 服务管理(Sysvinit vs Upstart vs Systemd) 性能测试(cpu/mem/io/oltp) ...
- 关于H5优化的一些问题
required修改默认提示 : <form action="abc.php"> <input type="text" required o ...
- 实现第三方登录(QQ、微信、微博)
第三方登录,就是使用大家比较熟悉的比如QQ.微信.微博等第三方软件登录自己的网站,这可以免去注册账号.快速留住用户的目的,免去了相对复杂的注册流程.下边就给大家讲一下怎么使用PHP开发QQ登录的功能. ...
- Pop3协议详解
POP3全称为Post Office Protocol version3,即邮局协议第3版.它被用户代理用来邮件服务器取得邮件.POP3采用的也是C/S通信 模型 用户从邮件服务器上接收邮件的典型 ...
- Sublime Text3 插件记录
插件官网 其他插件安装之前,先安装 Package Control: 快捷键Ctrl+`或View > Show Console打开控制台. 输入以下 Python 代码,回车. import ...