Tag: Code Io. Net app C # objectException Overview (exception)Exception type: each exception type is a class.A total of 2 major categories: system. systemexception, system. applicationexceptionIf we want to customize an exception, we can derive the
Binary Tree depth code (c)
Address: http://blog.csdn.net/caroline_wendy
Question: Enter the root node of a binary tree to find the depth of the tree.
Select the deepest left and right subtree, and thenRecursionAdd 1.
Code:
/* * main.cpp * *
Sometimes, when we want to request a large amount of data from some external devices or networks, the external devices may need to process the data for a long time before it can be transferred back to the computer. At this time, we just have a silly
// Here, I will summarize the operations related to resource files.
// 1. It is common to obtain the file stream corresponding to the resource file, and then convert it to the corresponding file
// A typical practice is to load the specified
Link to the question: Ultraviolet A 11246-K-Multiple Free set
N, k. To obtain a subset of an element not greater than n, the number of elements in the subset must be as many as possible, and the number of elements not included must meet the
Question:
There are t paths. Take n steps from s to e to find the shortest path.
Ideas:
I read someone else's...
Let's take a look at Floyd's core idea: edge [I] [j] = min (edge [I] [j], edge [I] [k] + edge [k] [j])The shortest path from I to j is
Ultraviolet A 10831-Gerg's Cake
Question Link
In other words, given a and p, ask if there is any solution for x ^ 2% p =.
Train of Thought: Find the leap mark. If the value is greater than or equal to 0, there is a solution. If the value is less
Sometimes, if you do not understand the question, you will not be able to answer questions (this is not nonsense ...)
This question is really disgusting. It is very simple and hard to understand !!
Question:
This question is indeed a bit difficult
Ultraviolet A 11768-Lattice Point or Not
Question Link
Given two vertices to form a line segment, these points are in the form of a very bit, and the positive number points fall on this line.
Train of Thought: first form a x + B y = c for the linear
Translation:
It is quite simple to generate OpenSSL that supports VS on Windows, but simple things are twists and turns. I will write down this twists and turns here to reduce the pain points in future experiments.
(It's really emotional to speak
Question link: Click the open link
#include
#include
#include
#include #include
#include
using namespace std;#define N 105int n,m,a,b,c;char s[N][N];set
myset;bool inmap(int x,int y){return
# Include
Int main () {int n; // positive integer nint I; // for Loop int myR = 1; // ensure myR ^ 2 n) {myR = I; printf ("myR % d \ n", myR); break ;}// enumerate for (I = 0; I
Link to the question: uva 10368-Euclid's Game
Two numbers are given. Two people are playing a game. Each operation starts with stan and several small numbers can be taken from the maximum number, that is, a-kb, a is a relatively large number, B is
Here are n values of x, y, and c, which means that the interval [x, y] is colored in C, but the color will be covered, after the dyeing operation is complete, ask you how many segments each color has and output the color id and segment count
The question is a poster posted on the wall. The first poster will be covered by the last one, and you will be asked how many posters can be seen at the end.
1
In this way, the time-out will not be mentioned first. The memory will not be able
(1) incremental Constructor
# Include
# Include using namespace std; const int MAXN = 1000; int A [MAXN], n; void print_subset (int n, int * A, int cur) {for (int I = 0; I n; print_subset (n, A, 0); return 0 ;}
(2) bit vector method
#
Ultraviolet A 1434-YAPTCHA
Question Link
Question: Find the answer to the formula in the question
Ideas:When 3?K+ 7 when it is not a prime number, then (3?K+ 6 )! (Because we can certainly find two factors to multiply)Therefore, the original
Find the longest route to and from.
Two SPFA times, and then select the maximum number of rounds and forth between a certain point. (Directed Graph)
Dijkstra + the adjacent matrix makes it easier to establish an undirected graph.
I use SPFA + two
Source: HDU 1281 board games
Some points cannot be attacked when they can be put in the car. Find out which points must be put in the car and cannot get the largest match.
Ideas: each vertex in the row-column matching matrix first finds the largest
Ultraviolet A 1436-Counting heaps
Question Link
Given the structure of a tree, place 1-N numbers in it. The value of the parent node must be smaller than that of the child node.
Train of Thought: f [u] indicates the case where u is the subtree, then
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.