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的更多相关文章

  1. Codeforces Round #439 (Div. 2)【A、B、C、E】

    Codeforces Round #439 (Div. 2) codeforces 869 A. The Artful Expedient 看不透( #include<cstdio> in ...

  2. Codeforces Round #439 (Div. 2)

    A. The Artful Expedient 题目链接:http://codeforces.com/contest/869/problem/A 题目意思:给你两个数列,各包含n个数,现在让你从上下两 ...

  3. Codeforces Round #439 (Div. 2) 题解

    题目链接  Round 439 div2 就做了两道题TAT 开场看C题就不会 然后想了好久才想到. 三种颜色挑出两种算方案数其实是独立的,于是就可以乘起来了. E题想了一会有了思路,然后YY出了一种 ...

  4. Codeforces Round #439 (Div. 2) A B C

    强哉qls,这场div2竟是其出的!!! A. The Artful Expedient 暴力 ^ ,判断是否出现,有大佬根据亦或的性质推出 Karen 必赢,太强啦23333333333333. # ...

  5. 【Codeforces Round #439 (Div. 2) B】The Eternal Immortality

    [链接] 链接 [题意] 求b!/a!的最后一位数字 [题解] b-a>=20的话 a+1..b之间肯定有因子2和因子5 答案一定是0 否则暴力就好 [错的次数] 在这里输入错的次数 [反思] ...

  6. 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 ...

  7. 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 ...

  8. 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 ...

  9. Codeforces Round #439 (Div. 2) Problem A (Codeforces 869A) - 暴力

    Rock... Paper! After Karen have found the deterministic winning (losing?) strategy for rock-paper-sc ...

随机推荐

  1. 洛谷 P4549 【模板】裴蜀定理

    https://www.luogu.org/problemnew/show/P4549 (1)证明方程ax+by=gcd(a,b)(a,b为常数;a>0,b>0;a,b,x,y为整数)有解 ...

  2. 洛谷 P1042 乒乓球

    P1042 乒乓球 var s:string; a1:array[1..50000] of char; i,n,x,y:longint; procedure f1; begin while not e ...

  3. [转]Java8 lambda表达式及新特新

    分享自:Vincent package info.liuwenjun.test; import org.junit.Test; import java.util.*; import java.util ...

  4. ubuntu下安装无线网卡去驱动Qualcomm-Atheros-QCA9377

    文件(文档和压缩包):http://pan.baidu.com/s/1mhktFT2

  5. MySql中查询语句实现分页功能

    import java.util.*;import java.sql.*; public class FruitDao {    private Connection conn;    private ...

  6. Django中多表的增删改查操作及聚合查询、F、Q查询

    一.创建表 创建四个表:书籍,出版社,作者,作者详细信息 四个表之间关系:书籍和作者多对多,作者和作者详细信息一对一,出版社和书籍一对多 创建一对一的关系:OneToOne("要绑定关系的表 ...

  7. P1216 [USACO1.5]数字三角形 Number Triangles

    题目描述 观察下面的数字金字塔. 写一个程序来查找从最高点到底部任意处结束的路径,使路径经过数字的和最大.每一步可以走到左下方的点也可以到达右下方的点. 7 3 8 8 1 0 2 7 4 4 4 5 ...

  8. ES-windos环境搭建(3)-kibana

    简介 Kibana是一个为ElasticSearch 提供的数据分析的 Web 接口.可使用它对日志进行高效的搜索.可视化.分析等各种操作. 下载 打开elasticseach官网,单击downloa ...

  9. (十四)maven之启动tomcat

    前言:在网上找了好几种方法启动web项目.比较好用的是:①在Project Facets勾上Dynamic....,但是这个方法会改变项目结构(把WebContent的东西都弄出来了):②使用jett ...

  10. Servlet和JSP之JSTL学习

    JSTL JSTL就是JSP标准标签库(JavaServer Pages Standard Tag Library, JSTL)是一个定制标签库的集合,用来解决像遍历Map或集合.条件测试.XML处理 ...