自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

JUST CODE

Living at Dawn

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

原创 6.30工作日志——安卓蓝牙2.0学习报告

安卓 蓝牙 2.0

2016-07-01 09:38:16 1001

翻译 Java NIO教程(十一)Pipe

Java NIO教程(十)PipeJava NIO 管道是2个线程之间的单向数据连接。Pipe有一个source通道和一个sink通道。数据会被写到sink通道,从source通道读取。这里是Pipe原理的图示:创建管道通过Pipe.open()方法打开管道。例如:1Pipe pipe =

2015-11-14 00:49:26 642

翻译 Java NIO教程(十)DatagramChannel

Java NIO教程(九)DatagramChannelJava NIO中的DatagramChannel是一个能收发UDP包的通道。因为UDP是无连接的网络协议,所以不能像其它通道那样读取和写入。它发送和接收的是数据包。打开 DatagramChannel下面是 DatagramChannel 的打开方式:DatagramChannel cha

2015-11-14 00:46:47 496

翻译 Java NIO教程(九)ServerSocketChannel

Java NIO中的 ServerSocketChannel 是一个可以监听新进来的TCP连接的通道, 就像标准IO中的ServerSocket一样。ServerSocketChannel类在 java.nio.channels包中。这里有个例子:ServerSocketChannel serverSocketChannel = ServerSocketChan

2015-11-13 17:50:59 552

翻译 Java NIO教程(八)SocketChannel

Java NIO教程(八)SocketChannelJava NIO中的SocketChannel是一个连接到TCP网络套接字的通道。可以通过以下2种方式创建SocketChannel:打开一个SocketChannel并连接到互联网上的某台服务器。一个新连接到达ServerSocketChannel时,会创建一个SocketChannel。打开 Soc

2015-11-13 17:45:43 489

翻译 Java NIO教程(七)FileChannel

Java NIO教程(七)FileChannelJava NIO中的FileChannel是一个连接到文件的通道。可以通过文件通道读写文件。FileChannel无法设置为非阻塞模式,它总是运行在阻塞模式下。打开FileChannel在使用FileChannel之前,必须先打开它。但是,我们无法直接打开一个FileChannel,需要通过使用一个In

2015-11-13 17:38:46 459

翻译 Java NIO教程(六)Selector

Java NIO教程(六)SelectorSelector(选择器)是Java NIO中能够检测一到多个NIO通道,并能够知晓通道是否为诸如读写事件做好准备的组件。这样,一个单独的线程可以管理多个channel,从而管理多个网络连接。为什么使用Selector?仅用单个线程来处理多个Channels的好处是,只需要更少的线程来处理通道。事实上,可以只

2015-11-13 17:25:09 450

翻译 Java NIO教程(五) 通道之间的数据传输

Java NIO教程(五) 通道之间的数据传输在Java NIO中,如果两个通道中有一个是FileChannel,那你可以直接将数据从一个channel(译者注:channel中文常译作通道)传输到另外一个channel。transferFrom()FileChannel的transferFrom()方法可以将数据从源通道传输到FileChannel中(译者注:

2015-11-13 16:48:51 478

翻译 Java NIO教程(四) Scatter & Gather

Java NIO教程(四) Scatter & GatherJava NIO开始支持scatter/gather,scatter/gather用于描述从Channel(译者注:Channel在中文经常翻译为通道)中读取或者写入到Channel的操作。分散(scatter)从Channel中读取是指在读操作时将读取的数据写入多个buffer中。因此,Channel将从Channel中

2015-11-13 16:11:39 606

翻译 Java NIO教程(三) Buffer

Java NIO教程(三) BufferJava NIO中的Buffer用于和NIO通道进行交互。如你所知,数据是从通道读入缓冲区,从缓冲区写入到通道中的。缓冲区本质上是一块可以写入数据,然后可以从中读取数据的内存。这块内存被包装成NIO Buffer对象,并提供了一组方法,用来方便的访问该块内存。下面是NIO Buffer相关的话题列表:Buffer的基本用法

2015-11-13 15:58:47 476

翻译 Java NIO教程(二) Channel

Java NIO教程(一)  核心概述Java NIO的通道类似流,但又有些不同:既可以从通道中读取数据,又可以写数据到通道。但流的读写通常是单向的。通道可以异步地读写。通道中的数据总是要先读到一个Buffer,或者总是要从一个Buffer中写入。正如上面所说,从通道读取数据到缓冲区,从缓冲区写入数据到通道。如下图所示:Channel的实现这

2015-11-13 15:54:44 520

翻译 Java NIO教程(一) 核心概述

http://tutorials.jenkov.com/java-nio/overview.html

2015-11-13 15:51:34 1381

原创 解题报告 之 HDU 4089 Activation

2011北京区域赛现场赛After 4 years' waiting, the game "Chinese Paladin 5" finally comes out. Tomato is a crazy fan, and luckily he got the first release. Now he is at home, ready to begin his journey. But before starting the game, he must first activate the produ

2015-10-08 22:01:15 1078

原创 解题报告 之 HDU 4405 Aeroplane chess

Hzz loves aeroplane chess very much. The chess map contains N+1 grids labeled from 0 to N. Hzz starts at grid 0. For each step he throws a dice(a dice have six faces with equal probability to face up and the numbers on the faces are 1,2,3,4,5,6). When Hzz

2015-10-07 02:37:57 455

原创 解题报告 之 ZOJ 3329 One Person Game

There is a very simple and interesting one-person game. You have 3 dice, namely Die1, Die2 and Die3. Die1 has K1 faces. Die2 has K2 faces. Die3 has K3 faces. All the dice are fair dice, so the probability of rolling each value, 1 to K1, K2, K3 is exactly 1

2015-10-05 01:01:18 833

原创 解题报告 之 POJ 2096 Collecting Bugs

Ivan is fond of collecting. Unlike other people who collect post stamps, coins or other material stuff, he collects software bugs. When Ivan gets a new program, he classifies all possible bugs into n categories. Each day he discovers exactly one bug in the

2015-10-04 23:06:18 586

原创 解题报告 之 POJ 3744 Scout YYF I

YYF is a couragous scout. Now he is on a dangerous mission which is to penetrate into the enemy's base. After overcoming a series difficulties, YYF is now at the start of enemy's famous "mine road". This is a very long road, on which there are numbers of m

2015-10-04 02:08:33 579

原创 解题报告 之 ZOJ 3829 Known Notation

Do you know reverse Polish notation (RPN)? It is a known notation in the area of mathematics and computer science. It is also known as postfix notation since every operator in an expression follows all of its operands. Bob is a student in Marjar University

2015-10-01 11:40:46 824

原创 解题报告 之 ZOJ 3827 Information Entropy

解题报告 之 ZOJ 3827 Information EntropyDescriptionInformation Theory is one of the most popular courses in Marjar University. In this course, there is an important chapter about informatio

2015-09-30 00:44:27 556

原创 解题报告 之 ZOJ 3822 Domination

Edward is the headmaster of Marjar University. He is enthusiastic about chess and often plays chess with his friends. What's more, he bought a large decorative chessboard with N rows and M columns.Every day after work, Edward will place a chess piece on a

2015-09-30 00:36:27 550

原创 解题报告 之 CodeForces 581D Three Logos

Three companies decided to order a billboard with pictures of their logos. A billboard is a big square board. A logo of each company is a rectangle of a non-zero area.Advertisers will put up the ad only if it is possible to place all three logos on the bi

2015-09-29 00:25:14 1109 1

原创 解题报告 之 CodeForces 581C Developing Skills

Petya loves computer games. Finally a game that he's been waiting for so long came out!The main character of this game has n different skills, each of which is characterized by an integer ai from 0 to 100. The higher the number ai is, the higher is the i-

2015-09-28 23:38:56 923

原创 解题报告 之 HDU5475 An easy problem

One day, a useless calculator was being built by Kuros. Let's assume that number X is showed on the screen of calculator. At first, X = 1. This calculator only supports two types of operation. 1. multiply X with a number. 2. divide X with a number which

2015-09-28 16:46:03 806 1

原创 解题报告 之 HDU5336 XYZ and Drops

DescriptionXYZ is playing an interesting game called "drops". It is played on a grid. Each grid cell is either empty, or occupied by a waterdrop. Each waterdrop has a property "size". The waterdrop cracks when its size is larger than 4, and produces 4 sm

2015-08-28 10:03:05 1015

原创 解题报告 之 HDU5335 Walk Out

bfs,多校,HDU5335In an maze, the right-bottom corner is the exit (position is the exit). In every position of this maze, there is either a or a written on it. An explorer gets lost in this grid. His position now is , and he wants to go to the exit. Sin

2015-08-27 16:02:07 1038

原创 解题报告 之 HDU5334 Virtual Participation

Description 构造,数论,数学As we know, Rikka is poor at math. Yuta is worrying about this situation, so he asks rikka to have some practice on codeforces. Then she opens the problem B: Given an integer , she needs to come up with an sequence of integers satis

2015-08-27 14:52:11 748

原创 解题报告 之 HDU5328 Problem Killer

You are a "Problem Killer", you want to solve many problems. Now you have problems, the -th problem's difficulty is represented by an integer (). For some strange reason, you must choose some integer and (), and solve the problems between the -th and

2015-08-27 14:21:11 1113

原创 解题报告 之 HDU5327 Olympiad

You are one of the competitors of the Olympiad in numbers. The problem of this year relates to beatiful numbers. One integer is called beautiful if and only if all of its digitals are different (i.e. 12345 is beautiful, 11 is not beautiful and 100 is not b

2015-08-27 14:06:45 673

原创 解题报告 之 HDU5326 Work

HDU5326 图论基础It’s an interesting experience to move from ICPC to work, end my college life and start a brand new journey in company. As is known to all, every stuff in a company has a title, everyone except the boss has a direct leader, and all the relat

2015-08-27 13:58:01 879

原创 解题报告 之 HDU5325 Crazy Bobo

解题报告 之 HDU5325 Crazy Bobo 深搜,图论,HDU5325DescriptionBobo has a tree,whose vertices are conveniently labeled by 1,2,...,n.Each node has a weight . All the weights are distrinct. A set with m nodes is a Bobo Set if: - The subgraph of his tree induced by

2015-08-27 13:49:29 983

原创 解题报告 之 HDU5319 Painter

DescriptionMr. Hdu is an painter, as we all know, painters need ideas to innovate , one day, he got stuck in rut and the ideas dry up, he took out a drawing board and began to draw casually. Imagine the board is a rectangle, consists of several square gri

2015-08-24 00:45:14 1545

原创 解题报告 之 2015蓝桥杯 垒骰子

赌圣 atm 晚年迷恋上了垒骰子,就是把骰子一个垒在另一个上边,不能歪歪扭扭,要垒成方柱体。经过长期观察,atm 发现了稳定骰子的奥秘:有些数字的面贴着会互相排斥!我们先来规范一下骰子:1 的对面是 4,2 的对面是 5,3 的对面是 6。假设有 m 组互斥现象,每组中的那两个数字的面紧贴在一起,骰子就不能稳定的垒起来。atm 想计算一下有多少种不同的可能的垒骰子方式。两种垒骰子方式相同,当且仅当这两种方式中对应高度的骰子的对应数字的朝向都相同。由于方案数可能过多,请输出模 10^9 + 7 的

2015-08-24 00:44:31 4301 2

原创 解题报告 之 HDU5323 Solve this interesting problem

Description 搜索,dfs,线段树逆推,剪枝。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: and . - I

2015-08-24 00:42:52 1203

原创 解题报告 之 HDU5318 The Goddess Of The Moon

解题报告 之 HDU5318 The Goddess Of The MoonDescriptionChang’e (嫦娥) is a well-known character in Chinese ancient mythology. She’s the goddess of the Moon. There are many tales about Chang'e, but there's a well-known story regarding the origin of the Mid-Autum

2015-08-23 11:36:56 1133

原创 解题报告 之 HDU5317 RGCDQ

解题报告 之 HDU5317 RGCDQDescription 筛法,数论,观察Mr. Hdu is interested in Greatest Common Divisor (GCD). He wants to find more and more interesting things about GCD. Today He comes up with Range Greatest Common Divisor Query (RGCDQ). What’s RGCDQ? Please let me

2015-08-23 10:53:15 826

原创 解题报告 之 HDU5316 Magician

HDU5316 Magician线段树 点的信息 数据结构 多校

2015-08-23 10:36:38 999

原创 解题报告 之 HDU5305 Friends

爆搜,剪枝解题报告 之 HDU5305 FriendsDescriptionThere are people and pairs of friends. For every pair of friends, they can choose to become online friends (communicating using online applications) or offline friends (mostly using face-to-face communication). H

2015-08-23 01:55:58 913

原创 解题报告 之 HDU5303 Delicious Apples

Description 思维,好题,枚举,离散化There are $n$ apple trees planted along a cyclic road, which is $L$ metres long. Your storehouse is built at position $0$ on that cyclic road. The $i$th tree is planted at position $x_i$, clockwise from position $0$. There are $a

2015-08-23 00:57:56 1267

原创 解题报告 之 HDU5301 Buildings

解题报告 之 HDU5301 BuildingsDescriptionYour current task is to make a ground plan for a residential building located in HZXJHS. So you must determine a way to split the floor building with walls to make apartments in the shape of a rectangle. Each built wal

2015-08-19 00:22:07 1220

原创 解题报告 之 CodeForces 6E Exposition

解题报告 之 CodeForces 6E ExpositionDescriptionThere are several days left before the fiftieth birthday of a famous Berland's writer Berlbury. In this connection the local library decided to make an exposition of the works of this famous science-fiction writ

2015-08-18 23:51:00 1535 1

空空如也

空空如也

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

TA关注的人

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