Doing HomeworkTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission (s): 3958 Accepted Submission (s): 1577
Problem DescriptionIgnatius has just come back school from the 30th ACM/ICPC. now he has a lot of
Idea: Data StructureAnalysis:1. The question is given to the central sequence and post sequence of a binary tree to find the value of the leaf node in the shortest path from the root node to the leaf node, if multiple paths output the smallest leaf
Hat's FibonacciTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission (s): 5590 Accepted Submission (s): 1866
Problem DescriptionA Fibonacci sequence is calculated by adding the previous two members the
/** 1284_1.c ** Created on: July 15, July 29, 2013 * Author: Administrator */# include int f [35001]; // It can be larger than 32767. Int main () {int I, j; f [0] = 1; for (I = 1; I int f [35001]; // It can be larger than 32767. Int main () {int I,
Two offline line segments.
I didn't think of the game ....
Scanning array, I from 1 to n, line segment tree maintenance from 1 to I every approximate number (1 ~ 50000) the most recent position where the line segment tree stores the maximum number
Sender: applies for the shared memory area and writes data to the shared memory area.
Sender. c
# Include # include # include # include # include # include # define BUFSIZ 102400 int main () {int shmid =-1; char * viraddr; char buffer [BUFSIZ];
During the competition, I used an array with a suffix, but T.
After the game, I read the question report and said that the suffix array seems to be the time of your constant. I have calculated the complexity O (T * Q * n ). This is 10 ^ 8, but
Problem DescriptionIgnatius had a nightmare last night. he found himself in a labyrinth with a time bomb on him. the labyrinth has an exit, Ignatius shocould get out of the labyrinth before the bomb explodes. the initial exploding time of the bomb
The sum problemTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission (s): 12104 Accepted Submission (s): 3666
Problem DescriptionGiven a sequence 1, 2, 3,... N, your job is to calculate all the possible
In fact, this question is similar to the tree array and the number of line segments at the airport.
This offline processing is currently under visual testing, and many questions are maintained in the tree array.
Question: Give a sequence, and then
# Include # include # include # include # include # include # define N 10001 using namespace std; int head [N], num, dfs [N], low [N], n, m, idx, bridge [N], bum; struct edge {int st, ed, next;} E [N * 20]; void addedge (int x, int y) {E [num].
When trying to use
Srand (time (0 ))
Rand ()
When a random number is generated, many of the generated numbers are "same ".
Tested: srand (seed); rand () generates a random number. When seed is the same, the random number is the same.
Therefore, the
The second group of data is relatively large. If it is simply sorted, direct retrieval times out because all data is traversed each time.
N/200 = 500, indicating that up to 500 people of the same age can be found, while M = 100 is relatively small,
Drawing PicturesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 125536/65536 K (Java/Others)Total Submission (s): 467 Accepted Submission (s): 207
Problem DescriptionDr. Skywind is drawing a picture, using his favorite six colors, namely red,
I don't know why I can't use C ++ for input and output, but I just need to change it to C... # Include # include // ============================================#define maxn 50020 int c [maxn]; int a [maxn]; int n; int t; int lowbit (int x) {return
--> This is a classic problem, but the game gets stuck due to a large number of problems...
It turns out that there is a formula for calculating this problem:
Q [I] is the I-th generalized Pentagon number.
# Include using namespace std; const
# Include # include int main () {char s [100] [100]; char str [100]; int cas = 1; int n; int I, j, k; while (scanf ("% s", str )! = EOF) {n = 0; while (str [0]! = '9') {strcpy (s [n ++], str); scanf ("% s", str) ;}int flag = 1; for (I = 0; I
# Include # include # include # include # include # include using namespace std; const int INF = 0x7fffffff; const int maxn = 1100; struct Edge {int from, to, dist ;}; // struct HeapNode {int d, u; bool operator rhs. d ;}}; int n, m; // point,
Ubiquitous ReligionsTime Limit: 5000 MS Memory Limit: 65536 KTotal Submissions: 20547 Accepted: 10082
Description
There are so many different religions in the world today that it is difficult to keep track of them all. You are interested in finding
Question: give you a maximum of 100 strings. Find the longest and more than half of the string's public substrings. If there are multiple strings, output them in Lexicographic Order.
Train of Thought: First combine the strings, add a character that
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