![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
暴力枚举
爱上键盘的小哥哥
这个作者很懒,什么都没留下…
展开
-
顺序三元组
给定一个长度为N的数组A=[A1, A2, ... AN],已知其中每个元素Ai的值都只可能是1, 2或者3。请求出有多少下标三元组(i, j, k)满足1 ≤ i i j k。Input 第一行包含一个整数N 第二行包含N个整数A1, A2, ... AN。(1 ≤ Ai ≤ 3) 对于30%的数据,1 ≤ N ≤ 100 对于80%的数据,1 ≤ N ≤ 10原创 2017-09-13 10:48:37 · 964 阅读 · 0 评论 -
New Year and Buggy Bot (暴力模拟,枚举)
Bob programmed a robot to navigate through a 2d maze.The maze has some obstacles. Empty cells are denoted by the character '.', where obstacles are denoted by '#'.There is a single robot in the maze. ...原创 2018-04-16 15:42:22 · 411 阅读 · 0 评论 -
Let's Chat
ACM (ACMers' Chatting Messenger) is a famous instant messaging software developed by Marjar Technology Company. To attract more users, Edward, the boss of Marjar Company, has recently added a new feat...原创 2018-03-29 16:37:04 · 1021 阅读 · 0 评论 -
Position in Fraction (模拟)
You have a fraction . You need to find the first occurrence of digit c into decimal notation of the fraction after decimal point. Input The first contains three single positive integ...原创 2018-04-18 16:15:38 · 260 阅读 · 0 评论 -
Easy Task ZOJ - 2969
Calculating the derivation of a polynomial is an easy task. Given a function f(x) , we use (f(x))' to denote its derivation. We use x^n to denote xn. To calculate the derivation of a polynomial, you ...原创 2018-04-18 16:32:59 · 150 阅读 · 0 评论 -
Light Bulbs ZOJ - 2976
Wildleopard had fallen in love with his girlfriend for 20 years. He wanted to end the long match for their love and get married this year. He bought a new house for his family and hired a company to ...原创 2018-04-18 17:02:58 · 306 阅读 · 0 评论 -
Cubes for Masha (模拟)
Absent-minded Masha got set of n cubes for her birthday.At each of 6 faces of each cube, there is exactly one digit from 0 to 9. Masha became interested what is the largest natural x such she can make...原创 2018-04-22 21:12:33 · 262 阅读 · 0 评论 -
Fibonacci-ish CodeForces - 633D
Yash has recently learnt about the Fibonacci sequence and is very excited about it. He calls a sequence Fibonacci-ish if the sequence consists of at least two elements f0 and f1 are arbitrary fn + ...原创 2018-04-07 10:13:27 · 235 阅读 · 0 评论 -
Months and Years
Everybody in Russia uses Gregorian calendar. In this calendar there are 31 days in January, 28 or 29 days in February (depending on whether the year is leap or not), 31 days in March, 30 days in April...原创 2018-04-19 11:11:55 · 469 阅读 · 0 评论 -
Floor problem FZU - 2104
In this problem, we have f(n,x)=Floor[n/x]. Here Floor[x] is the biggest integer such that no larger than x. For example, Floor[1.1]=Floor[1.9]=1, Floor[2.0]=2. You are given 3 positive integers n, ...原创 2018-04-13 18:57:29 · 113 阅读 · 0 评论 -
Solve equation FZU - 2102(进制转化)
You are given two positive integers A and B in Base C. For the equation: A=k*B+d We know there always existing many non-negative pairs (k, d) that satisfy the equation above. Now in this problem...原创 2018-04-13 20:03:38 · 159 阅读 · 0 评论 -
977A Wrong Subtraction(模拟)
Little girl Tanya is learning how to decrease a number by one, but she does it wrong with a number consisting of two or more digits. Tanya subtracts one from a number by the following algorithm: if th...原创 2018-05-08 20:58:49 · 740 阅读 · 0 评论 -
Mancala (模拟)
Mancala is a game famous in the Middle East. It is played on a board that consists of 14 holes. Initially, each hole has ai stones. When a player makes a move, he chooses a hole which contains a pos...原创 2018-05-09 21:41:03 · 744 阅读 · 0 评论 -
GCD Expectation ZOJ - 3868(暴力求解)
Edward has a set of n integers {a1, a2,...,an}. He randomly picks a nonempty subset {x1, x2,…,xm} (each nonempty subset has equal probability to be picked), and would like to know the expectation of [...原创 2018-04-25 16:51:56 · 209 阅读 · 0 评论 -
String Successor ZOJ - 3490(模拟)
The successor to a string can be calculated by applying the following rules: Ignore the nonalphanumerics unless there are no alphanumerics, in this case, increase the rightmost character in t...原创 2018-04-21 19:16:43 · 241 阅读 · 0 评论 -
Shuffle'm Up (模拟)
A common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks of poker chips, S1 and S2, each stack containin...原创 2018-05-08 19:34:17 · 199 阅读 · 0 评论 -
B. Phone Numbers(暴力)
Winters are just damn freezing cold in Nvodsk! That's why a group of n friends prefers to take a taxi, order a pizza and call girls. The phone numbers in the city consist of three pairs of digits (for...原创 2018-04-09 16:23:27 · 645 阅读 · 0 评论 -
Tic-Tac-Toe FZU - 2283(思维+暴力)
Kim likes to play Tic-Tac-Toe. Given a current state, and now Kim is going to take his next move. Please tell Kim if he can win the game in next 2 moves if both player are clever enough. Here “next ...原创 2018-04-07 21:05:51 · 314 阅读 · 0 评论 -
987A. Scarborough Fair
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No....原创 2018-03-06 17:43:53 · 357 阅读 · 0 评论 -
Magic Powder - 1
This problem is given in two versions that differ only by constraints. If you can solve this problem in large constraints, then you can just write a single solution to the both versions. If you find t原创 2017-11-12 19:45:24 · 400 阅读 · 0 评论 -
Substrings
You are given a number of case-sensitive strings of alphabetic characters, find the largest string X, such that either X, or its inverse can be found as a substring of any of the given strings.Input原创 2017-11-14 16:54:44 · 354 阅读 · 0 评论 -
SORT AGAIN(HDU2523)
Problem Description给你N个整数,x1,x2...xn,任取两个整数组合得到|xi-xj|,(0现在请你计算第K大的组合数是哪个(一个组合数为第K大是指有K-1个不同的组合数小于它)。 Input输入数据首先包含一个正整数C,表示包含C组测试用例.每组测试数据的第一行包含两个整数N,K。(1接下去一行包含N个整数,代表x1,x2..xn。(0原创 2017-12-27 23:13:17 · 199 阅读 · 0 评论 -
矩形A + B
Problem Description给你一个高为n ,宽为m列的网格,计算出这个网格中有多少个矩形,下图为高为2,宽为4的网格. Input第一行输入一个t, 表示有t组数据,然后每行输入n,m,分别表示网格的高和宽 ( n Output每行输出网格中有多少个矩形. Sample Input21 22 4 Sa原创 2017-12-28 09:14:02 · 566 阅读 · 0 评论 -
Complete the Word CodeForces - 716B
ZS the Coder loves to read the dictionary. He thinks that a word is nice if there exists a substring (contiguous segment of letters) of it of length 26 where each letter of English alphabet appears e...原创 2018-02-12 10:21:12 · 168 阅读 · 0 评论 -
898E. Squares and not squares(暴力)
Ann and Borya have n piles with candies and n is even number. There are ai candies in pile with number i.Ann likes numbers which are square of some integer and Borya doesn't like numbers which are squ...原创 2018-03-06 20:45:40 · 355 阅读 · 0 评论 -
打印大X
小明希望用星号拼凑,打印出一个大X,他要求能够控制笔画的宽度和整个字的高度。为了便于比对空格,所有的空白位置都以句点符来代替。要求输入两个整数m n,表示笔的宽度,X的高度。用空格分开(0<m<n, 3<n<1000, 保证n是奇数)要求输出一个大X例如,用户输入:3 9程序应该输出:***.....***5/11.***...***.3..***.***..1...***...原创 2018-02-13 17:10:29 · 253 阅读 · 0 评论 -
919A. Supermarket
We often go to supermarkets to buy some fruits or vegetables, and on the tag there prints the price for a kilo. But in some supermarkets, when asked how much the items are, the clerk will say that a y...原创 2018-02-13 20:36:49 · 374 阅读 · 0 评论 -
918A. Eleven
Eleven wants to choose a new name for herself. As a bunch of geeks, her friends suggested an algorithm to choose a name for her. Eleven wants her name to have exactly n characters. Her friend suggest...原创 2018-02-13 23:01:46 · 256 阅读 · 0 评论 -
Jamie and Alarm Snooze(暴力+思维)
Jamie loves sleeping. One day, he decides that he needs to wake up at exactly hh: mm. However, he hates waking up, so he wants to make waking up less painful by setting the alarm at a lucky time. He w...原创 2018-02-14 10:54:31 · 291 阅读 · 0 评论 -
A. Fafa and his Company
Fafa owns a company that works on huge projects. There are n employees in Fafa's company. Whenever the company has a new project to start working on, Fafa has to divide the tasks of this project among...原创 2018-02-20 17:57:07 · 433 阅读 · 0 评论 -
图着色问题
图着色问题是一个著名的NP完全问题。给定无向图 G = (V, E),问可否用K种颜色为V中的每一个顶点分配一种颜色,使得不会有两个相邻顶点具有同一种颜色?但本题并不是要你解决这个着色问题,而是对给定的一种颜色分配,请你判断这是否是图着色问题的一个解。输入格式:输入在第一行给出3个整数V(0 < V <= 500)、E(>= 0)和K(0 < K <= V),分别...原创 2018-03-12 15:43:20 · 1258 阅读 · 0 评论 -
人以群分
社交网络中我们给每个人定义了一个“活跃度”,现希望根据这个指标把人群分为两大类,即外向型(outgoing,即活跃度高的)和内向型(introverted,即活跃度低的)。要求两类人群的规模尽可能接近,而他们的总活跃度差距尽可能拉开。输入格式:输入第一行给出一个正整数N(2 <= N <= 105)。随后一行给出N个正整数,分别是每个人的活跃度,其间以空格分隔。题目保证这些数字以及...原创 2018-03-12 18:57:09 · 180 阅读 · 0 评论 -
互评成绩
学生互评作业的简单规则是这样定的:每个人的作业会被k个同学评审,得到k个成绩。系统需要去掉一个最高分和一个最低分,将剩下的分数取平均,就得到这个学生的最后成绩。本题就要求你编写这个互评系统的算分模块。输入格式:输入第一行给出3个正整数N(3< N <= 104,学生总数)、k(3<= k <= 10,每份作业的评审数)、M(<= 20,需要输出的学生数)。随后N行...原创 2018-03-12 19:23:01 · 346 阅读 · 0 评论 -
抢红包
没有人没抢过红包吧…… 这里给出N个人之间互相发红包、抢红包的记录,请你统计一下他们抢红包的收获。输入格式:输入第一行给出一个正整数N(<= 104),即参与发红包和抢红包的总人数,则这些人从1到N编号。随后N行,第i行给出编号为i的人发红包的记录,格式如下:K N1 P1 ... NK PK其中K(0 <= K <= 20)是发出去的红包个数,Ni是抢到红包的人的编号,Pi...原创 2018-03-12 19:46:07 · 293 阅读 · 0 评论 -
1003C. Intense Heat(暴力+前缀和)
The heat during the last few days has been really intense. Scientists from all over the Berland study how the temperatures and weather change, and they claim that this summer is abnormally hot. But an...原创 2018-07-08 09:30:32 · 901 阅读 · 0 评论