自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

fuckohmylove的专栏

我的名字不应该打那么猥琐的,靠,竟然不能改了

  • 博客(36)
  • 收藏
  • 关注

原创 图形验证码的生成

import java.awt.BasicStroke;import java.awt.Color;import java.awt.Font;import java.awt.Graphics2D;import java.awt.image.BufferedImage;import java.io.IOException;import java.io.OutputStream

2016-07-23 09:35:25 285

原创 汇编语言 2位十六进制数(字符),转换成数值保存到字节变量num(需要用逻辑左移指令或乘法指令)

;This is the structure of a main module using simplified segment directives.8086.MODEL SMALL,C.STACK 100.DATA;......Place data declarations heredb "$$$$$$"num db 0c1 db 0c2 db 0db

2016-05-17 20:45:51 1586

原创 poj 1190 生日蛋糕

生日蛋糕      Description7月17日是Mr.W的生日,ACM-THU为此要制作一个体积为Nπ的M层生日蛋糕,每层都是一个圆柱体。设从下往上数第i(1 Ri+1且Hi > Hi+1。由于要在蛋糕上抹奶油,为尽可能节约经费,我们希望蛋糕外表面(最下一层的下底面除外)的面积Q最小。令Q = Sπ请编

2015-12-25 20:37:24 349

原创 KMP算法

#include #include using namespace std;int next[20];//如果除首字符之外的字符只出现一次,那么next值就为0,如果出现的次数不为1,那么就求出第一次出现的位置char text[20]="BBC ";char p[20]="ABCDABD";void getNext(char *p,int *next)  {    i

2015-12-22 20:44:05 290

原创 pat 1003. Emergency (25)

As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams in each city and the l

2015-12-13 15:43:14 271

原创 PAT PAT 1023. Have Fun with Numbers (20)

Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication. Double it we will obtain 246913578, which happens to be another 9-digit number con

2015-12-13 15:12:11 330

原创 FZU 2148 Moon Game

DescriptionFat brother and Maze are playing a kind of special (hentai) game in the clearly blue sky which we can just consider as a kind of two-dimensional plane. Then Fat brother starts to draw N

2015-12-01 18:39:45 5562

原创 FZU Fire Game

DescriptionFat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid of this board is consisting of grass or just empty and

2015-11-29 14:49:45 278

原创 hdu 5569

matrixProblem DescriptionGiven a matrix with n rows and m columns ( n+m is an odd number ), at first , you begin with the number at top-left corner (1,1) and you want to go to the number a

2015-11-22 14:53:29 4306

原创 poj 1068

ParencodingsTime Limit: 1000MS Memory Limit: 10000KDescriptionLet S = s1 s2...s2n be a well-formed string of parentheses. S can be encoded in two different ways:q By an int

2015-11-18 10:34:21 220

原创 poj 2586 Y2K Accounting Bug

Y2K Accounting BugTime Limit: 1000MS Memory Limit: 65536K   DescriptionAccounting for Computer Machinists (ACM) has sufferred from the Y2K bug and lost some vital d

2015-11-17 16:43:50 242

原创 POJ 1328

Radar InstallationTime Limit: 1000MS Memory Limit: 10000K   DescriptionAssume the coasting is an infinite straight line. Land is in one side of coasting, sea in the

2015-11-15 16:08:56 290

原创 POJ 2965

The Pilots Brothers' refrigeratorTime Limit: 1000MS Memory Limit: 65536K     DescriptionThe game “The Pilots Brothers: following the stripy elephant” has a qu

2015-11-13 13:10:36 244

原创 Poj 1753

Flip GameTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 36059 Accepted: 15728DescriptionFlip game is played on a rectangular 4x4 field with two-sided pie

2015-11-10 19:48:08 656

原创 HDU 2102

HOT~ 杭电2015级新生如何加入ACM集训队?A计划Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 13806    Accepted Submission(s): 3428Problem Descrip

2015-10-06 16:04:36 318

原创 ccf z型扫描

在图像编码的算法中,需要将一个给定的方形矩阵进行Z字形扫描(Zigzag Scan)。给定一个n×n的矩阵,Z字形扫描的过程如下图所示:  对于下面的4×4的矩阵,  1 5 3 9  3 7 5 6  9 4 6 4  7 3 1 3  对其进行Z字形扫描后得到长度为16的序列:  1 5 3 9 7 3 9 5 4 7 3 6 6 4 1 3  请实现一个Z

2015-09-13 12:32:22 485

原创 ccf 201403-2 窗口

在某图形操作系统中,有 N 个窗口,每个窗口都是一个两边与坐标轴分别平行的矩形区域。窗口的边界上的点也属于该窗口。窗口之间有层次的区别,在多于一个窗口重叠的区域里,只会显示位于顶层的窗口里的内容。  当你点击屏幕上一个点的时候,你就选择了处于被点击位置的最顶层窗口,并且这个窗口就会被移到所有窗口的最顶层,而剩余的窗口的层次顺序不变。如果你点击的位置不属于任何窗口,则系统会忽略你这次点击。 

2015-09-12 11:15:20 254

原创 人生中的第一个dp(poj 1163)

The Triangle   Description73 88 1 02 7 4 44 5 2 6 5(Figure 1)Figure 1 shows a number triangle. Write a program that ca

2015-09-11 20:38:34 207

原创 HDU 5427

A problem of sortingProblem DescriptionThere are many people's name and birth in a list.Your task is to print the name from young to old.(There is no pair of two has the same age.) Inp

2015-09-08 20:41:06 407

原创 poj 2635

The Embarrassed Cryptographer      DescriptionThe young and very promising cryptographer Odd Even has implemented the security module of a large system with thousan

2015-08-14 09:57:48 222

原创 ccf 最优灌溉(其实和hdu里的1863 畅通工程)原理一样

雷雷承包了很多片麦田,为了灌溉这些麦田,雷雷在第一个麦田挖了一口很深的水井,所有的麦田都从这口井来引水灌溉。  为了灌溉,雷雷需要建立一些水渠,以连接水井和麦田,雷雷也可以利用部分麦田作为“中转站”,利用水渠连接不同的麦田,这样只要一片麦田能被灌溉,则与其连接的麦田也能被灌溉。  现在雷雷知道哪些麦田之间可以建设水渠和建设每个水渠所需要的费用(注意不是所有麦田之间都可以建立水渠)。请问灌溉

2015-08-14 09:50:26 480

原创 ccf 集合竞价(只有80十分,而且还是参考大神的代码才做出来的)

某股票交易所请你编写一个程序,根据开盘前客户提交的订单来确定某特定股票的开盘价和开盘成交量。  该程序的输入由很多行构成,每一行为一条记录,记录可能有以下几种:  1. buy p s 表示一个购买股票的买单,每手出价为p,购买股数为s。  2. sell p s 表示一个出售股票的卖单,每手出价为p,出售股数为s。  3. cancel i表示撤销第i行的记录。  如果开盘价

2015-08-13 20:38:03 1005

原创 poj 3009 Curling 2.0

Curling 2.0      DescriptionOn Planet MM-21, after their Olympic games this year, curling is getting popular. But the rules are somewhat different from ours. The

2015-08-11 08:52:30 166

原创 poj 2559 求连续的最大矩形面积(也可用于ccf最大连续矩形面积)

这是大神的解释:维护一个left数组,left[i]表示第i个矩形向左最多能延伸到第left[i]个矩形,且初始时left[i]=i,那么,对于矩形i,如果h[left[i]-1]>=h[i],我们可以直接跳到left[left[i]-1],而不用再去和h[left[left[i]-1]+1],h[left[left[i]-1]+2]...h[left[i]-1]去比较因为,我们维护的

2015-08-10 19:49:15 418

原创 POJ 2488 A Knight's Journey

A Knight's Journey      DescriptionBackgroundThe knight is getting bored of seeing the same black and white squares again and again and has decided to make a jour

2015-08-10 15:18:25 267

原创 HDU 2553 N皇后问题

N皇后问题Problem Description在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。你的任务是,对于给定的N,求出有多少种合法的放置方法。 Input共有若干行,每行一个正整数N≤10,表示棋盘和皇后的数量;如果N=0,表示结束。 Output共有若

2015-08-09 20:38:48 216

原创 HDU 1677 二分法进行判断

虽然是理解了二分,但是我觉得它所采用的意思应该是和我想的是一样的,但是我自己提交就是WA这是采用二分:bool cmp(node a,node b){    if(a.w!=b.w)    {        return a.w    }else{        return a.h>b.h;    }}int result(int n){   

2015-08-08 17:09:26 248

原创 优先队列和普通队列的小小不同

杭电1026 Ignatius and the Princess ITime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 14463    Accepted Submission(s): 4576Special Judge

2015-07-31 21:17:36 1153 1

原创 今天搞了一个下午,总算是把并查集了解了一点

杭电1325 Is It A Tree?Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 17660    Accepted Submission(s): 3969Problem DescriptionA

2015-07-31 16:26:20 221

原创 杭电诡异的楼梯,参考了大神的代码,整理了好久的思路才做出来

Hogwarts正式开学以后,Harry发现在Hogwarts里,某些楼梯并不是静止不动的,相反,他们每隔一分钟就变动一次方向.比如下面的例子里,一开始楼梯在竖直方向,一分钟以后它移动到了水平方向,再过一分钟它又回到了竖直方向.Harry发现对他来说很难找到能使得他最快到达目的地的路线,这时Ron(Harry最好的朋友)告诉Harry正好有一个魔法道具可以帮助他寻找这样的路线,而那个魔法道

2015-07-28 10:13:35 658

原创 今天学到了枚举

poj 1753 翻转游戏题意:求最少的步骤使得图中全为白色或者黑色      DescriptionFlip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One side

2015-07-27 10:25:57 275

原创 今天学到了两个函数

头文件:stdlibitoa(int n,char *s,int x)//把整数转化为字符串n为被转化的数,s为转化的结果,x为转化过程中的进制int n = atoi(char *s)//把字符串转化为整数s为被转化的字符串

2015-07-25 11:17:13 244

翻译 哎!不愧是大神啊

#include#include#include #include #include using namespace std;int month[2][13] = {{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}                  , {0, 31, 29, 31, 30, 31, 30, 31,

2015-07-24 10:36:27 341

转载 看了大神的才懂,唉!自己还是太年轻啊!

#include#include#include #include #include using namespace std;int main(){    int i,n,ans;    int h[1010],Left[1010],Right[1010];    while(cin>>n)    {        for(i=1;i

2015-07-23 21:15:16 285

原创 唉!写了那么多,大神直接2个for循环就搞定了(龟兔赛跑)

#include #include #include using namespace std;int main(){    int i,j;    int L,x;    int N,C,T;    int VR,VT1,VT2;    int p[102];    double dp[102],min,e;    while(cin>>L)  

2015-01-24 15:19:00 337

原创 唉!今天学了结构体,还了解到了一点贪心算法,啧啧!

交换猫粮#include #include #include #include struct p{       int mao,cost;      double ave;}num[1100];   bool cmp(p x,p y)   {           return x.ave>y.ave;  }using namespace st

2015-01-12 21:07:57 591

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除