If the string is used, it will be a lot of trouble.
# Include # include using namespace STD; int main () {int t; CIN> T; while (t --) {int N; cin> N; string ID, start, end; CIN> ID> Start> end; string idstart, idend, startmin, endmax; idstart =
Description One steps through Integer Points of the straight line. the length of a step must be nonnegative and can be by one bigger than, equal to, or by one smaller than the length of the previous step.
What is the minimum number of steps in order
# Include # include # include # include using namespace STD; char STR [1010]; int modd; # define maxn 9999 # define maxsize 10 # define dlen 4 class bignum {PRIVATE: int A [1010]; // The number of digits that can be controlled for a large number
How many
Time Limit: 2000/1000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)Total submission (s): 1028 accepted submission (s): 403Problem descriptiongive you n (n How many kinds of necklaces total have. (If two necklaces can equal by
Oulipo
Time limit:1000 ms
Memory limit:65536 K
Total submissions:17128
Accepted:6892
Description
The French author Georges perec (1936-1982) once wrote a book, la disparition, without the letter'E'. He was a
Problem descriptionone measure of ''unsortedness ''in a sequence is the number of pairs of entries that are out of order with respect to each other. for instance, in the letter sequence '''daabec'', this measure is 5, since D is greater than four
Ant trip
Time Limit: 2000/1000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)
Total submission (s): 819 accepted submission (s): 312
Problem descriptionant country consist of N towns. There are m roads connecting the towns.
Ant Tony,
Problem description I learned a lot about IP addresses in my online courses. IP is short for Internet Protocol. Sometimes we use IP to refer to our IP address. Now an IPv4 address is represented by a 32-bit unsigned integer, which is usually
DescriptionA Boolean matrix has the parity property when each row and each column has an even sum, I. e. contains an even number of BITs which are set. here's a 4x4 matrix which has the parity property:
1 0 1 00 0 0 01 1 1 10 1 0 1
The sums of the
Problem description a certain army is trained in the new recruits queue. The new recruits are numbered sequentially from the beginning and lined up in a row. The training rules are as follows: one to two records from the beginning, when the column
Question: Find the maximum cycle length for a graph.
Simple DFS
A point appears only once in a ring.
Assume that a point is the starting point of a possible ring, and then move down the starting point to mark a distance to the starting point.
If the
Problem descriptionignatius likes to write words in reverse way. Given a single line of text which is written by Ignatius, you showould reverse all the words and then output them.
Inputthe input contains several test cases. The first line of the
Problem descriptiona subsequence of a given sequence is the given sequence with some elements (possible none) left out. given a sequence X = another sequence z = is a subsequence of X if there exists a strictly
Increasing sequence of indices of X
Relocation
Time limit:1000 ms
Memory limit:65536 K
Total submissions:1479
Accepted:597
Description
Emma and Eric are moving to their new house they bought after returning from their honeymoon. fortunately,
Remainder
Time Limit: 6000/3000 MS (Java/others) memory limit: 65536/32768 K (Java/Others)
Total submission (s): 2039 accepted submission (s): 436 problem descriptioncoco is a clever boy, who is good at mathematics. however, he is puzzled by a
Description
A Benedict monk no. 16 writes down the decimal representations of all natural numbers between and includingMAndN,M≤N. How do 0's Will he write down?
Input
Input consists of a sequence of lines. Each line contains two unsigned 32-bit
N 0th day, there areN-1People and 1 bloodsucker. every day, two and only two of them meet. nothing will happen if they are of the same species, that is, a people meets a people or a bloodsucker meets a bloodsucker.Otherwise, people may be
Conquer a new region
Time Limit: 8000/4000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)
Total submission (s): 647 accepted submission (s): 174 problem descriptionthe wheel of the History rolling forward, our King conquered a new region
Returns the shortest distance between two points.
// Memset (MAP, 0x1ffffff, sizeof (MAP); // The initialization method is incorrect.
The correct method for using memset is that the initial value is an 8-digit value. For example, memset (MAP, 0x3f,
Water ..
# Include using namespace STD; const int n = 105; const int INF = 0x1fffffff; int map [N] [N]; int d [N]; int flag [N]; int n, m; void Init () {for (INT I = 0; I d [I]) {min = d [I]; Index = I ;}} flag [Index] = 1; for (INT I = 1; I d
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