B. Mahmoud and a Triangle time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mahmoud has n line segments, the i-th of them has length ai. Ehab challenged him to use exactly 3 line segments to…
C. Mahmoud and a Message time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mahmoud wrote a message s of length n. He wants to send it as a birthday present to his friend Moaz who likes strin…
A. Mahmoud and Longest Uncommon Subsequence time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output While Mahmoud and Ehab were practicing for IOI, they found a problem which name was Longest comm…
bit masking is very common on the lower level code. #include <cstdio> #include <algorithm> #define MAXSIZE 205 char line[MAXSIZE]; int main() { //freopen("input.txt","r",stdin); int x,y, dir; // (dir&3) 0,1,2,3 -- right…
结构体:是一种用户自定义的数据类型 结构体定义 struct 结构体名 {     成员类型1  成员变量名1;     成员类型2  成员变量名2;      -. }; typedef   原类型名  新类型名; 起的别名首字母大写. 结构体数组: 同一种类型的结构体变量组成的数组 结构体数组的元素同样是通过下标访问 访问结构体变量的属性通过 . 结构体变量可以直接使用的,可以直接访问 把数组放在结构体当中,可以通过直接对结构体赋值实现对数组的直接赋值 结构体的内存分配:以最大的成员变量为标…
Fence Repair Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 32424 Accepted: 10417 Description Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,000) pla…
Safecracker Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 10165 Accepted Submission(s): 5213 Problem Description === Op tech briefing, 2002/11/02 06:42 CST === "The item is locked in a Klein saf…
排序练习--找出前m大的数字 Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 给定n个数字,找出前m大的数字.   输入  多组输入,每组输入格式如下. 第一行包含两个整数n m.(n<=100000, m>0) 第二行包含n个正整数. 输出  输出前m大的数字,若m>n输出ERROR.每组输出占一行. 示例输入 2 1 4 3 4 2 1 2 898989 23 示例输出 4 898989 23 基数排序 #incl…
problem description http://acm.hdu.edu.cn/showproblem.php?pid=1030 #include <cstdio> #include <cmath> #include <algorithm> int calPathLength(int x, int y) { //path length from 1 (1st line, lower) to a number in ith line is only differ by…
最近在学习shell编程,文中若有错误的地方还望各位批评指正. 先来看一个简单的求和函数 #!/bin/bash #a test about function f_sum 7 8 function f_sum(){ return $(($1+$2)); } f_sum 3 5; total=$(f_sum 3 6); echo $total,$?; 注意几个问题: 1.shell是逐行执行,所以要在函数声明之后才可调用,否则会有错误 2.我们要获得函数的返回值只能通过$?来获得,不可以通过变量拿…
Easy Summation                                                             Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)                                                                                          …
谨以此纪念去年在学海争锋上的演讲. ---------------------------------------------------- 基于ArcGIS for Server的服务部署分析 ---------------------------------------------- 1.基于ArcGIS for Server的服务部署分析 2.内容简介 3.ArcGIS for Server简介 4.关于ARCGIS for server,我不知道在大家的学习中是否有所涉猎,首先来看一下A…
D. Mahmoud and a Dictionary time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output Mahmoud wants to write a new dictionary that contains n words and relations between them. There are two types of…
整个晚上脑子都有点呆滞,想起申请注册好的博客还从来都不曾打理,上来添添生机.从哪里讲起呢,去年有那么一段时间整个人就陷在域里拔不出来,于是整理了一些文档,害怕自己糊里糊涂的脑子将这些东西会在一觉醒来全然忘光,是的,写是最好的印记. 书归正传喽,从安装和部署域开始吧,小主初学,若有不对之处,欢迎批评指正. windows server 2008 R2域中的第一台DC部署方法: 1.设置IP地址为静态IP地址 2.IP地址指向本地IP地址,DC域服务器的DNS服务器地址也同时指向本地IP. 3.选择…
(一)备份namenode的元数据 namenode中的元数据非常重要,如丢失或者损坏,则整个系统无法使用.因此应该经常对元数据进行备份,最好是异地备份. 1.将元数据复制到远程站点 (1)以下代码将secondary namenode中的元数据复制到一个时间命名的目录下,然后通过scp命令远程发送到其它机器 #!/bin/bash export dirname=/mnt/tmphadoop/dfs/namesecondary/current/`date +%y%m%d%H` if [ ! -d…
转自:http://free0007.iteye.com/blog/1131163 HTMLParser具有小巧,快速的优点,缺点是相关文档比较少(英文的也少),很多功能需要自己摸索.对于初学者还是要费一些功夫的,而一旦上手以后,会发现HTMLParser的结构设计很巧妙,非常实用,基本你的各种需求都可以满足.     这里我根据自己这几个月来的经验,写了一点入门的东西,希望能对新学习HTMLParser的朋友们有所帮助.(不过当年高考本人语文只比及格高一分,所以文法方面的问题还希望大家多多担待…
use fgets, and remove the potential '\n' in the string's last postion. (main point) remove redundancy there must be a stack, at first sight, you need a stack of type myNode, but think deeper, matrix multiplication is valid only if A.c=B.r, then the n…
for the backtracking part, thanks to the video of stanford cs106b lecture 10 by Julie Zelenski for the nice explanation of recursion and backtracking, highly recommended. in hdu 2553 cout N-Queens solutions problem, dfs is used. // please ignore, bel…
errors made, boundary conditions, <= vs < , decreasing vs increasing , ++, –, '0'/'1' vs 0/1 prototype of sum, return the starting position of c-style string containing the sum, just like sprintf return number of characters successfully read. p1=sum…
Hiking Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 932 Accepted Submission(s): 483 Special Judge Problem Description There are n soda conveniently labeled by 1,2,-,n. beta, their best friend…
Prime Path Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 14091 Accepted: 7959 Description The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit r…
棋盘问题 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 28474 Accepted: 14084 Description 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别.要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C. Input 输入含有多组测试数据. 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一…
MZL's Border Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 909 Accepted Submission(s): 297 Problem Description As is known to all, MZL is an extraordinarily lovely girl. One day, MZL was playing…
Walk Out Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 2724 Accepted Submission(s): 548 Problem Description In an n∗m maze, the right-bottom corner is the exit (position (n,m) is the exit). In e…
Have you learned something about segment tree? If not, don't worry, I will explain it for you.  Segment Tree is a kind of binary tree, it can be defined as this:  - For each node u in Segment Tree, u has two values: $L_u$ and $R_u$.  - If $L_u = R_u$…
H - Solve this interesting problem Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 5323 Appoint description:  System Crawler  (2015-07-28) Description Have you learned something about segment tr…
Wormholes Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 35235   Accepted: 12861 Description While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way p…
Encoding Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 32145 Accepted Submission(s): 14263 Problem Description Given a string containing only 'A' - 'Z', we could encode it using the following me…
A Mathematical Curiosity Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 31177 Accepted Submission(s): 9988 Problem Description Given two integers n and m, count the number of pairs of integers (a…
Elevator Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 51396 Accepted Submission(s): 28377 Problem Description The highest building in our city has only one elevator. A request list is made up w…