Codeforces Round #439 (Div. 2) B. The Eternal Immortality
B. The Eternal Immortality
题目链接http://codeforces.com/contest/869/problem/B
解题心得:题意就是给出a,b,问(a!)/(b!)的个位数,要注意0,5两个数,只要a,b相差超过5个位数就只能是0,其实没有看到相差5看到相差10也可以的,然后又暴力跑一个末位数就可以了。
/*这里跑的是相差10位*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll a,b;
scanf("%lld%lld",&a,&b);
if(b-a >= 10)
{
printf("0");
return 0;
}
ll k = 1;
for(ll j=a+1;j<=b;j++)
{
ll z = j%10;
k *= z;
k %= 10;
}
printf("%lld",k);
return 0;
}
Codeforces Round #439 (Div. 2) B. The Eternal Immortality的更多相关文章
- Codeforces Round #439 (Div. 2)【A、B、C、E】
Codeforces Round #439 (Div. 2) codeforces 869 A. The Artful Expedient 看不透( #include<cstdio> in ...
- Codeforces Round #439 (Div. 2)
A. The Artful Expedient 题目链接:http://codeforces.com/contest/869/problem/A 题目意思:给你两个数列,各包含n个数,现在让你从上下两 ...
- Codeforces Round #439 (Div. 2) 题解
题目链接 Round 439 div2 就做了两道题TAT 开场看C题就不会 然后想了好久才想到. 三种颜色挑出两种算方案数其实是独立的,于是就可以乘起来了. E题想了一会有了思路,然后YY出了一种 ...
- Codeforces Round #439 (Div. 2) A B C
强哉qls,这场div2竟是其出的!!! A. The Artful Expedient 暴力 ^ ,判断是否出现,有大佬根据亦或的性质推出 Karen 必赢,太强啦23333333333333. # ...
- 【Codeforces Round #439 (Div. 2) B】The Eternal Immortality
[链接] 链接 [题意] 求b!/a!的最后一位数字 [题解] b-a>=20的话 a+1..b之间肯定有因子2和因子5 答案一定是0 否则暴力就好 [错的次数] 在这里输入错的次数 [反思] ...
- Codeforces Round #439 (Div. 2) Problem E (Codeforces 869E) - 暴力 - 随机化 - 二维树状数组 - 差分
Adieu l'ami. Koyomi is helping Oshino, an acquaintance of his, to take care of an open space around ...
- Codeforces Round #439 (Div. 2) Problem C (Codeforces 869C) - 组合数学
— This is not playing but duty as allies of justice, Nii-chan! — Not allies but justice itself, Onii ...
- Codeforces Round #439 (Div. 2) Problem B (Codeforces 869B)
Even if the world is full of counterfeits, I still regard it as wonderful. Pile up herbs and incense ...
- Codeforces Round #439 (Div. 2) Problem A (Codeforces 869A) - 暴力
Rock... Paper! After Karen have found the deterministic winning (losing?) strategy for rock-paper-sc ...
随机推荐
- [软件工程基础]2017.11.03 第七次 Scrum 会议
具体事项 项目交接燃尽图 每人工作内容 成员 已完成的工作 计划完成的工作 工作中遇到的困难 游心 #10 搭建可用的开发测试环境:#9 阅读分析 PhyLab 后端代码与文档:#8 掌握 Larav ...
- compare `lvs/haproxy/nginx`
特性 LVS Nginx Haproxy 工作层 四层(传输层TCP/UDP) 七层(应用层) 四层.七层 应用范围 基于TCP和UDP之上的协议都可以 Http.mail HTTP.TCP之上应用 ...
- IIS发布MVC应用程序问题
1.IIS7.5详细错误 HTTP 错误 500.19 - Internal Server Error 无法访问请求的页面,因为该页的相关配置数据无效 重复定义了“system.web.extensi ...
- javascript要点(上)
立即执行函数 即Immediately Invoked Function Expression (IIFE),正如它的名字,就是创建函数的同时立即执行.它没有绑定任何事件,也无需等待任何异步操作: ( ...
- js获取窗口参数
window.onscroll=function getScrollTop(){ console.log(scrollTop) if(document.documentElement&& ...
- Nginx pathinfo模式配置
正常配置 location ~ \.php$ { fastcgi_pass ; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $docu ...
- Spring AOP初步总结(一)
学习AOP有段时间了,一直没空总结一下,导致有些知识点都遗忘了,之后会把以前学过的Spring核心相关的知识点总结一轮... 先大体介绍下Spring AOP的特点(均摘自"Spring i ...
- Objective-C Data Encapsulation
All Objective-C programs are composed of the following two fundamental elements: Program statements ...
- 将生成的Excel表发送到邮箱
本文接上一篇,将得到的Excel表发送到邮箱.. 在上一篇中,本人使用的是直接从数据库中获取数据,然后包装成Excel表.现在将该Excel表发送到目的邮箱,如果需要跟上篇一样,定时每天某时刻发送,就 ...
- Azure 项目构建 - 用 Azure 认知服务在微信公众号上搭建智能会务系统
通过完整流程详细介绍了如何在Azure平台上快速搭建基于微信公众号的智慧云会务管理系统. 此系列的全部课程 https://school.azure.cn/curriculums/11 立即访问htt ...