题意:告诉一个数n,然后求出所有的位数和,插在n的尾部,重复求t次,判断最终的数是否能被11整除。

分析:直接模拟的过程,并且模拟的除的过程,却TLE,以为是方法错了,因为每次都得循环求一遍位数和;

PS:

1、能被11整除:就是求偶数位和-奇数位和的差,如果差能被11整除,就是能够被11整除。比如35816, 3 - 5 + 8 - 1 + 6 = 11,能被11整除;

2、能被7整除:若一个整数的个位数字截去,再从余下的数中,减去个位数的2倍,如果差是7的倍数,则原数能被7整除。比如133,13 - 3 * 2 = 7,是7倍数;

3、能被3整除:所有位数的和是3的倍数;

坑点:

没想到的是如果用 long long 会TLE,我们一般在不太清楚是否超int的情况下,直接用long long,没想到会卡在这里。。。幸好改了

HDU 5373 (大水坑题---被11整除原来有规律)的更多相关文章

  1. (能被11整除的数的特征)The shortest problem --hdu

    链接: http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1005&cid=595 若一个整数的个位数字截去,再从余下的数中 ...

  2. HDU 5373(2015多校7)-The shortest problem(模拟%11)

    题目地址:pid=5373">HDU 5373 题意:给你一个数n和操作次数t,每次操作将n的各位数之和求出来放在n的末尾形成新的n,问t次操作后得到的n能否够被11整除. 思路:就是 ...

  3. hdu 5373 The shortest problem(杭电多校赛第七场)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5373 The shortest problem Time Limit: 3000/1500 MS (J ...

  4. HDU 5373 The shortest problem (数学)

    题意:给定两个数的n和m,有一种操作,把 n 的各位数字加起来放到 n后面形成一个新数n,问重复 m 次所得的数能否整除 11. 析:这个题首先要知道一个规律奇数位的和减去偶数位的和能被11整除的数字 ...

  5. hdu 1715 大菲波数 高精度和运算,水

    1.hdu 1715  大菲波数 2.链接:http://acm.hdu.edu.cn/showproblem.php?pid=1715 3.总结:水 #include<iostream> ...

  6. leecode刷题(11)-- 反转字符串

    leecode刷题(11)-- 反转字符串 反转字符串 描述: 编写一个函数,其作用是将输入的字符串反转过来. 示例 1: 输入: "hello" 输出: "olleh& ...

  7. hdu 1015 Safecracker 水题一枚

    题目链接:HDU - 1015 === Op tech briefing, 2002/11/02 06:42 CST === "The item is locked in a Klein s ...

  8. 2015 Multi-University Training Contest 7 hdu 5373 The shortest problem

    The shortest problem Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Oth ...

  9. HDU 3726 Graph and Queries 平衡树+前向星+并查集+离线操作+逆向思维 数据结构大综合题

    Graph and Queries Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Other ...

随机推荐

  1. Ajax实现原理详解

    Ajax:Asynchronous javascript and xml,实现了客户端与服务器进行数据交流过程.使用技术的好处是:不用页面刷新,并且在等待页面传输数据的同时可以进行其他操作. 这就是异 ...

  2. fork &vfork --陈皓

    http://coolshell.cn/articles/7965.html http://coolshell.cn/articles/12103.html#more-12103 前两天有人问了个关于 ...

  3. 2016年12月23日 星期五 --出埃及记 Exodus 21:18

    2016年12月23日 星期五 --出埃及记 Exodus 21:18 "If men quarrel and one hits the other with a stone or with ...

  4. 【转】ini载入保存类,操作INI配置文件方便的很

    /****************************************************************** * * ^_^ 恶猫 独门商标 挖哈哈 * * QQ:\> ...

  5. CentOS的网络配置(终端环境)

    在虚拟机中安装了Server版的CentOS,用于做Hadoop相关的实验.Server版的CentOS默认是没有桌面环境的,eth0的网络默认也没有开启,需要我们手动启动网络. 关键配置说明 网络和 ...

  6. 使用clusterprofile做聚类分析

    library(clusterProfiler ) #cat test.txt gene_symbol EXOSC10ARHGEF10LVWA5B1SRRM1PTAFRCSMD2SH3GLB1GBP6 ...

  7. implicit operator

    class Digit { public Digit(double d) { val = d; } public double val; // ...other members // User-def ...

  8. Google Protocol Buffer的安装与.proto文件的定义

    什么是protocol Buffer呢? Google Protocol Buffer( 简称 Protobuf) 是 Google 公司内部的混合语言数据标准. 我理解的就是:它是一种轻便高效的结构 ...

  9. window绝对路径与相对路径

    绝对路径:是从盘符开始的路径,形如C:\windows\system32\cmd.exe相对路径:是从当前路径开始的路径,假如当前路径为C:\windows要描述上述路径,只需输入system32\c ...

  10. android 5.0 水波纹 实现

    1. 定义一个普通圆角背景的xml; rounded_corners.xml <?xml version="1.0" encoding="utf-8"?& ...