Ultraviolet A 10465-Homer Simpson

You can use a full backpack or greedy one. Greedy words: (1) if it happens to be T, update the maximum hamburger count (that is, the maximum number of A + B ). (2) If t is not collected, the maximum value of A + B is updated when T-Max is the

993-product of digits

Description: The result of multiplying a bunch of numbers from 1 to 9 is the input value. If not, the result is-1 # include # include int main () {// freopen ("a.txt", "r", stdin); int n, x; scanf ("% d", & N); While (n --) {scanf ("% d", & X); If

Ultraviolet A 10387-Billiard

We can see that the total horizontal distance is the number of collisions with the vertical side multiplied by the length of the horizontal side, that is, (a * m). Similarly, the total vertical distance is (B * n ).Therefore, the arc tangent value

Ultraviolet A 11205-the broken Pedometer

Calculate the minimum number of columns that can be distinguished from all rows, use the bit vector method to generate a subset, and then enumerate the minimum subset. Note that there may be more than one space between 0 and 1. Use the char array

Ultraviolet A 572-oil deposits

The simplest one in the figure, DFS ~ CodeAs follows: # Include # include # include # include # include # include using namespace STD; char A [100 + 2] [100 + 2]; int flag [100 + 2] [100 + 2]; void DFS (int x, int y) {If (! (A [x] [Y]-

Ultraviolet A 784-maze Registration

DFS ~ CodeAs follows: # Include # include # include # include # include # include using namespace STD; char A [30 + 5] [80 + 5]; int vis [30 + 5] [80 + 5]; void DFS (int x, int y) {if (a [x] [Y] = 'X' | Vis [x] [Y] = 1) return; if (A [x]

Ultraviolet a 757-gone fishing

Greedy + brute force: enumerate the locations that can be reached from near to far, and subtract the time consumed in the middle from the total time, in this way, it can be considered as a random transfer between various phishing sites (the actual

Ultraviolet A 10167-birthday cake

Brute force: a maximum of one hundred points. All points are brought into the equation, so that the number of points greater than zero and less than zero is the same (the number of points on both sides of the line is the same ). At the beginning,

Ultraviolet A 357-Let Me Count The Ways

A complete backpack problem. The Code is as follows: # Include # include using namespace std; long dp [30055]; int coin [5] = {1, 5, 10, 25, 50 }; int main () {int num; dp [0] = 1; for (int I = 0; I

Ultraviolet A 562-Dividing coins

Divide the coin into two heaps to minimize the difference between the two heaps of coins. 0-1 backpack, which can calculate all the sum of coins, and then start to explore 0 from Sum/2 (sum is the sum of all coins, until you find the biggest coin

Ultraviolet A 10130-supersale

In the end, the greatest value of everyone is the total value. The Code is as follows: #include #include #include #include using namespace std;int p[1002], w[1002], mw[102], dp[32];int main(){#ifdef test freopen("input.txt", "r", stdin);#endif

HDU 1735-word count

Greedy. As long as there are two zeros at the beginning, you need to determine the number of consecutive zeros at the end of the last row, sort by the number of zeros at the end of the last line from large to small (because it is necessary to

Ultraviolet A 10340-all in all

String Matching: a question that is full of water, but remember that the array has to be bigger. What makes me more depressing is that it took me half an hour to wait for the question I handed in last night, I have been waiting in the queue until

HDU 4190-Distributing Ballot Boxes

Greedy + binary, minimizing the maximum value. The value of ballot box B is certain. The number of votes is divided into two parts, so that the calculated Number of ballot boxes is always B. The Code is as follows: # Include int City [500001];

10370-abve Average

A wonderful day begins with a water question in the early morning ~ Count the number of students with an average score or higher. The Code is as follows: #include#include#include#include#include#includeusing namespace std;int main(){#ifdef test

Ultraviolet A 10267-Graphical Editor

Simple simulation + DFS questions. Note that the pixel at Initialization is an uppercase letter 'O' rather than a number '0 '. In addition, ensure that x1 The Code is as follows: #include #include #include #include #include using namespace std;int

Ultraviolet A 10382-Watering Grass

It is actually the deformation of the range coverage. Obviously, the rectangular area covered by the circle is the length of the intersection between the circle and the total area, which converts all the circles into line segments, in this way, the

Ultraviolet A 301-Transportation

Enumeration subset + backtracking. When enumerating sub-sets, You need to perform conditional judgment in each recursive process, instead of putting them at the end of the judgment as usual. The Code is as follows: #include #include #include

UV 193-graph coloring

Backtrack, enumerate the black and white situations of all vertices, and then determine the feasibility. The Code is as follows: #include #include #include #include #include #include using namespace std;int map[102][102], node[102], save[101], n, k,

Ultraviolet A 331-Mapping the Swaps

You can trace back (note that only two adjacent elements can be exchanged ). The Code is as follows: # Include # include # include # include # include # include using namespace std; int a [6], B [6], cct, fct, n; void dfs (int cur, int fi)

Total Pages: 64722 1 .... 56421 56422 56423 56424 56425 .... 64722 Go to: GO

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.