1. 程式人生 > >hdu 4722 Good Numbers(找規律)

hdu 4722 Good Numbers(找規律)



Problem Description If we sum up every digit of a number and the result can be exactly divided by 10, we say this number is a good number.
You are required to count the number of good numbers in the range from A to B, inclusive.
Input The first line has a number T (T <= 10000) , indicating the number of test cases.
Each test case comes with a single line with two numbers A and B (0 <= A <= B <= 1018
).
Output For test case X, output "Case #X: " first, then output the number of good numbers in a single line.
Sample Input 2 1 10 1 20
Sample Output Case #1: 0 Case #2: 1 Hint The answer maybe very large, we recommend you to use long long instead of int.

相關推薦

hdu 4722 Good Numbers(規律)

Problem Description If we sum up every digit of a number and the result can be exactly divided by 10, we say this number is a good number. You are requir

hdu 5513 三分+規律

和精度鬥智鬥勇的一晚上,以為保留兩位小數精度要求不會很大,結果卡了一晚上,這道題是說給你N個點構成的一個凸多邊形,對於每個點畫一個圓,要求相鄰兩個圓必須相切,求所有圓的面積最小值為多少。這道題剛開始卡在fixed上,因為資料量比較大,所以每次用fixed會超時,改成scanf以後就好了,

hdu 1021 Fibonacci Again(規律)

題目: Problem Description There are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2). Input Input consis

HDU 6172 Array Challenge 規律+矩陣快速冪

題目 分析       這道題目一看就想到矩陣快速冪。可以先把hn算出來,進而把bn,an都算出來。但是發現一個問題,題目中是要求⌊an−−√⌋對1e9+7取模之後的值。但是開根號沒法取模啊,所

HDU 5793 A Boring Question (規律 : 快速冪+乘法逆元)

cnblogs and ott miss 逆元 找規律 -- for while A Boring Question Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Ot

2017多校第7場 HDU 6129 Just do it 規律

ble nbsp bool name def ons spa esp bre 題目鏈接:http://acm.hdu.edu.cn/showproblem.php?pid=6129 題意:求a序列後m次xor前綴和 解法: 手動對1位置對每個位置的貢獻打表發現 第一次 貢

hdu 6129 Just do it 規律

-- std div its 題解 turn 個數 using const 題意很好理解 問你一個數組 按照他的規則處理m次之後是什麽樣的 看到這道題我一開始也沒什麽思路 但是我列了五個數 把它們m≤4的都算出來之後發現 如果m把化成二進制的這一位是1

HDU 6154 CaoHaha's staff 思維 規律

ble fin namespace math break while set call closed   題目鏈接: http://acm.hdu.edu.cn/showproblem.php?pid=6154   題目描述: 圍成一個面積不小於S的多邊形, 最少需要多少根

2017中國大學生程序設計競賽 - 網絡選拔賽 HDU 6154 CaoHaha's staff(幾何規律

hdu number ngs malle else ios you friend style Problem Description "You shall not pass!"After shouted out that,the Force Staff appered i

HDU 6198 number number number 矩陣快速冪 規律

for spa iostream pri amp span ios const isp   題目鏈接: http://acm.hdu.edu.cn/showproblem.php?pid=6198   題目描述: 給你一個k, 你可以用K個斐波那契數列中的數來構造一個數,

題解報告:hdu 1564 Play a game(規律博弈)

正整數 lse CI character square placed eight 技術 分享 題目鏈接:http://acm.hdu.edu.cn/showproblem.php?pid=1564 Problem Description New Year is Coming

HDU 1273 漫步森林(數學 規律

n-1 pac ron break ++ inpu don its can 傳送門: http://acm.hdu.edu.cn/showproblem.php?pid=1273 漫步森林 Time Limit: 2000/1000 MS (Java/Others)

HDU 1041 Computer Transformation(規律加大數乘)

esp ios ctype nsf printf stream ont tac tran 主要還是找規律,然後大數相乘 #include<stdio.h> #include<string.h> #include<math.h> #inc

HDU 6267 Master of Random (規律

題意: 給你n(n<=1e5)個節點。第i個節點的父親是隨機的,範圍為0~i-1。 定義一棵樹的值為    其中val[i]為以i為根的子樹的所有點的權值之和。 給你a[i](i=1~n)(每個點的權值),求所有可能的樹的平均值。

HDU 3788——ZOJ問題(規律

題目連結 從樣例中找到其規律 就是第一次出現z的之前字元的個數 ×第一次出現z和最後出現j之間的‘o’的個數(且不能為空)=最後出現j之後的字元個數Accepted;(同理zoj也適用) #include<iostream> #include<set> #incl

HDU 2147 kiki's game 博弈規律

傳送門 這個自己畫一下 NP 圖看看就知道,只有行列都是奇數的時候才會輸,否則都是贏 #include <bits/stdc++.h> using namespace std; int main() { int n, m; while (cin >> n

hdu 1799 迴圈多少次? 【打表+規律

Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submis

HDU-2041-超級樓梯(水/Fibonacci數列/規律

有一樓梯共M級,剛開始時你在第一級,若每次只能跨上一級或二級,要走上第M級,共有多少種走法? Input 輸入資料首先包含一個整數N,表示測試例項的個數,然後是N行資料,每行包含一個整數M(1<=M<=40),表示樓梯的級數。 Output 對於每個測試例

Sum HDU 4704(數論+費馬小定理+規律

分類:數論+費馬小定理+找規律 題意:給出N,s(k)=num(x1,x2,x3...,xk).s(k)==將N分成k組得數量。給出N問(s(1)+s(2)....s(N))%mod得值。 思路:看懂題意手動模擬算以下前面幾個= = N=1 s(1)=1 ans=1

Hdu 6198 number number number 矩陣快速冪+規律

We define a sequence FF : ⋅⋅ F0=0,F1=1F0=0,F1=1 ; ⋅⋅ Fn=Fn−1+Fn−2 (n≥2)Fn=Fn−1+Fn−2 (n≥2) . Give you an integer kk , if a positive number