uvaoj1225Digit Counting(暴力)】的更多相关文章

Trung is bored with his mathematics homeworks. He takes a piece of chalk and starts writing a sequenceof consecutive integers starting with 1 to N (1 < N < 10000). After that, he counts the number oftimes each digit (0 to 9) appears in the sequence.…
Parallelogram Counting 刚学hash还不会用,看到5000ms的时限于是想着暴力来一发应该可以过.以前做过类似的题,求平行四边形个数,好像是在CF上做的,但忘了时限是多少了,方法是一样的. 题意:给出n个点坐标,求平面中有多少个平行四边形. 思路:我们知道,平行四边形的条件是两条边平行且相等.我们把每条边分解成x和y方向的向量,只要两条边对应相等就可以了,于是预处理所有的边,然后排序,然后相等的肯定在一起,所以用试探法往前,注意每个平形四边形都被记录了两次,所以答案是总数量…
题意:输入一张照片,给出人物的特征,判断有多少个人. .O. /|\ (.) 思路:按照3*3的图统计,只要有一个点符合就加1 #include<cstdio> #include<iostream> #include<algorithm> using namespace std; typedef long long ll; const int maxn=1e2+10; int T,n,m; char s[maxn][maxn]; bool check(int x,int…
题目链接:传送门 题目: Counting Cliques Time Limit: / MS (Java/Others) Memory Limit: / K (Java/Others) Total Submission(s): Accepted Submission(s): Problem Description A clique is a complete graph, in which there is an edge between every pair of the vertices.…
Description We are given a figure consisting of only horizontal and vertical line segments. Our goal is to count the number of all different rectangles formed by these segments. As an example, the number of rectangles in the Figures 1 and 2 are 5 and…
只想出来 $O(nlogn\times 160)$ 的复杂度,没想到还能过~ Code: #include <cstdio> #include <vector> #include <algorithm> #define N 200004 #define ll long long #define setIO(s) freopen(s".in","r",stdin) using namespace std; int n; vector…
ZOJ3944 People Counting ZOJ3939 The Lucky Week 1.PeopleConting 题意:照片上有很多个人,用矩阵里的字符表示.一个人如下: .O. /|\ (.) 占3*3格子,句号“.”为背景.没有两个人完全重合.有的人被挡住了一部分.问照片上有几个人. 题解: 先弄个常量把3*3人形存起来,然后6个部位依次找,比如现在找头,找到一个头,就把这个人删掉(找这个人的各个部位,如果在该部位位置的不是这个人的身体,就不删),删成句号,疯狂找就行了. 代码:…
Counting Rectangles Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 1043 Accepted: 546 Description We are given a figure consisting of only horizontal and vertical line segments. Our goal is to count the number of all different rectangles…
Counting Cliques Time Limit: 8000/4000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 539    Accepted Submission(s): 204 Problem Description A clique is a complete graph, in which there is an edge between every pair…
Problem Description Recently, Mr. Xie learn the concept of happy number. A happy number is a number contain all digit 7 or only 1 digit other than 7. For example, 777 is a happy number because 777 contail all digit 7, 7177 and 87777 both happy number…