Codeforces round #170 (Div. 2) Problem B

Http://codeforces.com/contest/278/problem/ B /** Question: Number of strings: N 1 ≤ n ≤ 30. The length of each string cannot exceed 20 * There are 676 types of strings containing two characters, greater than 600, * So the strings of its

ZOJ 1558 Euro Efficiency

/* ACMer: MDK 18:20:35 Accepted 1558 C ++ 0 196 MDK */ # Include # Include # Include # Include # Include # Define maxn2005 Usingnamespace std;Int num [14] = {0}, opt [MAXN] = {0 };Int fun (int n){If (n = 0) return0;If (opt [n]) return opt [n];

Codeforces Round #173 (Div. 2) Problem B

B. Painting Eggs J draws n eggs, which can be bought to A and G respectively. The bid for each egg A and G is different, but the requirement is, the price difference between the eggs sold to A and G cannot exceed 500; /* I did not understand the

Tree-like dp hoj 2500

HOJ 2500 1 #define FOPEN freopen("/media/3CBCB387BCB33A6A/1.txt","r",stdin); 2 #define MAXN 203 3 int n; 4 short dp[MAXN][2]; 5 6 struct str_hash { 7 size_t operator () (conststring& str) const { 8 unsigned long __h =0; 9 for(size_t i

HDU 1398 (primary function)

/* The number of coin types is 1 ^ 2 ^ 2 ^ 2, 4 ^ 2... 17 ^ 2. Input n to find the number of combinations that can be combined into n; Similar to hdu1028, but only the original 1, 2, 3, 4 ,...... Changed to 1 ^ 2, 2 ^ 2, 3 ^ 2, 4 ^ 2 ......,

HDU 1431 prime number input table

Const int MAX = 100000001;Const int SQRT = sqrt (MAX );Bool prime [MAX] = {1, 1 };Int arr [MAX], len = 0; Prime Number: void set_prime(){int i, j;for (i = 2; i Judge the reply: inline bool Huiwen(int num){int tmp = 0;int bck = num;while (num){tmp

Summary on application of Weighted Median

I have read several median questions today and I feel that I should summarize them. Concept of weighted median: http://baike.baidu.com/view/1209446.htm Median: A one-dimensional plane is the minimum distance from a straight line to a

Swjtu1762 Imperfect Coverage

Http://acm.swjtu.edu.cn/JudgeOnline/showproblem? Problem_id = 17621762 Int main (){Int n; SCF (n );F (kk, n){Printf ("Case # % d:", kk + 1 );Int a, B, c, d;Scanf ("% d", & a, & B, & c, & d );Int sum = abs (a-c) + abs (B-d );If (! (Sum % 2

HDU 1709 (primary function)

/* Question: give a certain (n) Number of weights. Each weight is a1, a2, a3... An, Question: Find [1 ~ Sum (sum is the sum of weights) cannot be weighed; Key Issue: You can place weights on both sides of the balance, Put on the same end: a [j + k] +

HDU 1228 A + B

/* Bored I only blame myself for being too watery and it took a long time to answer questions; */ #include #include #include #include #include #include #include using namespace std;int change(char *s){if(!strcmp(s,"one"))return 1;if(!strcmp(s,"two")

HDU 1236 sorting

/* Another question Sort () application + strcmp () application; */ Http://acm.hdu.edu.cn/showproblem.php? Pid = 1236 click to open the link # Include # include # include # include # include # include # include # define maxn 1005 struct

HDU 1085 (primary function)

/* Initialize the SDK first, and then run it one by one; Pay attention to the changes in the I, j, and k ranges; Reference DanielGenerating Function)-TankyWoo */ # Include using namespace std; int a [10005], B [10005]; int main ()

USACO 1.4 Search Techniques

By MDK on 2011.11.16 8: 28Search Techniques Search TechnologySample Problem: NQueens [Traditional] PlaceNQueens onN x nChess board so that no queen is attacked by another queen.Example: Queen n's question Place n queens in the n * n chessboard so

HDU 1372 (BFS)

BFS: Start Point; Start search: When reading the first and leaving the team, the search range is four or eight points (some do not exist). The searched points are in the queue and the duration is + 1 until the read point is equal to the end point;

NSKeyedArchiver serialization and deserialization

NSString * homePath = NSHomeDirectory (); NSString * filePath = [homePath stringByAppendingPathComponent: @ "array. archiver "]; NSMutableData * mutableData = [NSMutableData data]; NSKeyedArchiver * archive = [[NSKeyedArchiver alloc] metadata:

Talk about yourself

It took about two weeks for the winter vacation to decide to give up ACM for postgraduate entrance exams. After a person's energy was limited, I was more eager for graduate students to give me a platform and continue to study algorithms. A lot of

Use of priority queues in STL

Reposted from C/C ++ programmer's house Original link:Use of priority queues in STL The queue features FIFO. Generally, queues are similar to queuing for shopping. Everyone is very orderly. the first person in the queue buys something first. The

UIImageView adaptive image size

Window size acquisition: CGRect screenBounds = [[UIScreenmainScreen] bounds]; // A Rect with the status bar is returned. CGRect rect = [[UIScreenmainScreen] applicationFrame]; // Rect that does not contain the status bar UIImageView: I. rounded

UILabel dynamic computing height

UILabel * label = [[UILabel alloc] initWithFrame: CGRectMake (,)]; // sets the number of automatic lines and line breaks. If it is 0, it indicates no limit [label setNumberOfLines: 0]; label. lineBreakMode = NSLineBreakByWordWrapping; // use the

SDK 6.0 TableView Cell Reuse

-(Id) dequeueReusableCellWithIdentifier :( NSString *) identifier;-(Id) dequeueReusableCellWithIdentifier :( NSString *) identifier forIndexPath :( NSIndexPath *) indexPath NS_AVAILABLE_IOS (6_0); // newer First:   -(Id)

Total Pages: 64722 1 .... 56081 56082 56083 56084 56085 .... 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.