ACM: uva 11361 -&…
来源:互联网 发布:网络延迟多少ms算正常 编辑:程序博客网 时间:2024/06/05 04:23
Investigating Div-Sum Property
An integer is divisible by 3 if the sum of its digits is alsodivisible by 3. For example, 3702 is divisible by 3 and 12(3+7+0+2)is also divisible by 3. This property also holds for the integer9.
In this problem, we will investigate this property for otherintegers.
Input
The first line of input is aninteger
Output
For each case, output the number of integers in therange [A,
Sample Input
3
1 20 1
1 20 2
1 1000 4
Output for Sample Input
20
5
64
题意: 给出一个范围[a, b];, 判断这个范围内的数有多少个满足要求, 要求: 数能整除K, 每位数相加和
解题思路: (一道好题)
代码:
#include <cstdio>
#include <iostream>
#include <cstring>
using namespace std;
#define MAX 105
typedef long long ll;
int a, b, k;
int dp[15][MAX][MAX], num[15];
ll pow[15];
void init()
{
}
int DP(int d, int m1, int m2, int flag) //flag: 标记最高位和区分状态
{
}
int solve(int a)
{
}
int main()
{
//
}
- ACM: uva 11361 -&…
- ACM: uva 11210 &n…
- ACM: uva 11389 -&…
- ACM: uva 1325 -&n…
- ACM: uva 10827 -&…
- ACM: uva 10763 -&…
- ACM: uva 1432 -&n…
- ACM: uva 1362 -&n…
- ACM: uva 1069 -&n…
- ACM: uva 11426 -&…
- ACM: 极其简单题 uva&nb…
- ACM: uva 10253 - Series-Parallel…
- ACM: LA 3266 -&nb…
- ACM: poj 2786 -&n…
- ACM: poj 3972 -&n…
- ACM: uva 1335 - Beijing Guards
- ACM: uva 10391 - Compound Words
- ACM: uva 10534 - Wavio Sequence
- ACM: uva 11538 - Chess Queen
- ACM: uva 11401 - Triangle Counti…
- ACM: uva 11375 - Matches
- ACM: uva 11174 - Stand in a Line
- ACM: uva 1362 -&n…
- ACM: uva 11361 -&…
- ACM: uva 1073 - Glenbow Museum
- ACM: uva 10253 - Series-Parallel…
- ACM: uva 1069 -&n…
- ACM: uva 11426 -&…
- java之ReentrantLock公平锁和非公平锁
- 洛谷P1156 垃圾陷阱
- Python中List二维数组
- 禁用cookie后session是如何设置的(第一个)