The complete format of printf format control:%-0 M. n l or H charactersThe following describes the composition formats:① %: Indicates the starting symbol of the format description, which is indispensable.②-: "Yes" indicates the left-aligned output.
// Purely recursive formula. Pay attention to the question requirements, if you want to know 2, evaluate 1 // do not apply recursive errors. # include # include # include using namespace STD; const double exp = 2.718281828; char a, B;
// Network stream -- maximum stream // The condition for termination is that the path cannot be added to the residual network. // you need to consider multiple sides. # include # include # include # define INF 2000000000 using namespace
// Data Structure -- stack // open a number first and mark the number as the couple number // start from 1 ~ 2n is pushed into the stack one by one, and the couple array is called to check whether it can be merged with the top element of the stack
// Network stream-use the largest stream in the diagram for big match // connect the device to the source point // socket (plug) connect to the sink // The adapter is connected to the socket, and the weight is INF // converts the largest
// BFS breadth-first search, combined with data structure queues # include # include using namespace STD; int arr [200000]; int vis [200000]; // accessed array queue q1, Q2; // use a Data Structure queue to save search space int deep;
// Simple question. You can use # include using namespace STD; bool check (int n, bool arr [100] [100]) { int sum; for (INT I = 0; I { sum = 0; for (Int J = 0; j { sum + = arr [I] [J]; } If (sum % 2! = 0) return false; } for (INT I = 0; I {
// Simple search question // train of thought: when reading the image, open a flag to mark the one-size-fits-all symbols and coordinates of the image, and record the number of these symbols. // If two different symbols are found, an error is
Problem descriptionGiven a positive integer N, you should output the most right digit of N ^ n.
InputThe input contains several test cases. The first line of the input is a single integer T which is the number of test cases. t test cases follow.
# Include using namespace STD; char STR [10000]; char map [1000] [21]; int main () { int N; while (CIN> N) { If (n = 0) break; CIN> STR; int r = strlen (STR) /n; int p = 0; for (INT I = 1; I { if (I % 2! = 0) { for (Int J = 1; j map [I]
Question 1 ~
Problem descriptionAn inch worm is at the bottom of a well n inches deep. it has enough energy to climb u inches every minute, but then has to rest a minute before climbing again. during the rest, it slips down d inches. the process
// Calculate the reverse logarithm, and use the merge sort to calculate the O (nlgn) should be faster than the enumeration, but it should not be reflected in this question, but it is a waste of space, sort by training and merging # include #
// Search for the longest path of a tree in depth first # include # include # include using namespace STD; int _ max; int N, K, U, V, D; struct edge { int U, V, D; edge (INT Uu, int VV, int dd) {u = Uu; V = vv; D = dd ;}}; vector E [10
1. Planning and Design:(1) Independent {Tagshow (Event)} "> Plan and design the network structure and formulate performance optimization policies;(2) design the network topology, including {Tagshow (Event)} "> Vro, network {Tagshow (Event)} ">
// Question of the color type of the Line Segment tree // This question can be easily implemented by modifying the line segment tree in reverse order, this is a clever practice // You can also maintain the line segment tree by recording the Left
// Line segment tree // records the left continuous number and the right continuous number for each interval, and maximum continuity // The maximum continuity is used to determine whether a qualified range exists. // The left and right continuity
// Single-source shortest path. The final answer should be the maximum value from the starting point to the shortest path of other nodes. # include # include using namespace STD; const int INF = 50000000; int G [105] [105]; bool flag [105];
// String processing // a strange question, the key is to judge the end and check empty rows. // STL can save a lot of trouble. # include # include # include using namespace STD; string S1, S2; bool checkempty (string Str) // check
// BFS width-first search // G [x] [y] [k] indicates that the path is (x, y) then, the optimal value of K-step flight is supported. # include # include # include # include using namespace STD; const int max = 102; const int dir [4] [2] =
// Treap calculates the K decimal number // thanks to the guidance of jsh Daniel. // The reason why this question can be done with treap is that there is a condition in the meaning of the question, the query interval does not contain any
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