自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(673)
  • 收藏
  • 关注

原创 #ifndef #define #endif

#ifndef #define #endif小小弄一下。

2015-03-24 00:24:36 1160

原创 Sicily 1205. brainf*ck

1205. brainf*ckConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionbrainf*ck is the ungodly creation of Urban Mller, whose goal was apparently to create a Turing-complet

2015-03-24 00:23:21 547

原创 Virtual Function

自己看着虚函数写的一点东西,算是笔记和记录问题吧。

2015-03-24 00:16:27 706

原创 Sicily 1202. The Bank of Kalii

1202. The Bank of KaliiConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionCustomers of the Bank of Kalii handle their banking transactions similar to the way they handl

2015-03-24 00:15:28 1336

原创 Sicily 1258. It

1258. ItConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionAs an unnamed space agency endured the ridicule following their now-infamous metric/English unit conversion, they

2015-03-24 00:13:50 534

原创 Sicily 1284. Tornado!

1284. Tornado!ConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionIs this crazy weather the result of mankind's continuous interference in the environment? Or is it simp

2015-03-24 00:12:29 427

原创 Sicily 1283. Comparison

1283. ComparisonConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionGiven two strings A and B which are consisting of alphanumeric letters only (‘A’-‘Z’, ‘a’-‘z’ and ‘0’

2015-03-24 00:10:56 377

原创 Sicily 1228. Crashing Robots

1228. Crashing RobotsConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionIn a modernized warehouse, robots are used to fetch the goods. Careful planning is needed to ensure

2015-03-24 00:08:19 425

原创 single_linked_list_int

单向存整数的链表,代码如下://****************************Test_main.cpp****************************#include "single_linked_list_int.h"#include using namespace std;void test_single_linked_list_int() { S

2015-03-24 00:05:49 516

原创 Sicily 2371. Show Me The Fax

2371. Show Me The FaxConstraintsTime Limit: 1 secs, Memory Limit: 256 MBDescriptionFax machines use a form of compression based on run-length encoding. Run-length encoding (R

2015-03-24 00:04:25 491

原创 Sicily 1535. Give Me an E

1535. Give Me an EConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionEveryone knows that the letter ``E" is the most frequent letter in the English language. In fact, t

2015-03-24 00:03:42 554

原创 Observer pattern

观察者模式,详情请看:http://en.wikipedia.org/wiki/Observer_patternmain.cpp:#include "observer_pattern.h"student s[5];teacher t[5];void tell_us_what_you_know() { for (int i = 0; i < 5; i++) {

2015-03-24 00:01:49 530

原创 Windows Store Apps note003 about cursor(pointer)

Something about cursor(pointer) in win8.1 store apps.

2015-03-23 21:04:38 833

原创 Sicily 1533. CIVIC DILL MIX

1533. CIVIC DILL MIXConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionRoman numerals are an ancient numbering system used extensively throughout Europe through the 13t

2015-03-23 01:00:26 730

原创 Pre,in,post expression

常做到表达式转化的题目,自己弄了个类试试看: main.cpp#include #include #include "expression_transformation.h"using std::cin;using std::cout;using std::endl;int main() { string nifix, prefix, postfix;

2015-03-23 00:58:19 1114

原创 Sicily 2401. Judges' Time Calculation

2401. Judges' Time CalculationConstraintsTime Limit: 1 secs, Memory Limit: 256 MBDescriptionIn our region, the contest traditionally starts at 12:30 and lasts for 5 hours. If

2015-03-23 00:56:44 473

原创 Decorator pattern

修饰模式,参考:http://en.wikipedia.org/wiki/Decorator_patternhttp://blog.csdn.net/lcl_data/article/details/8830455http://www.cnblogs.com/jiese/p/3167050.html修饰模式,是面向对象编程领域中,一种动态地往一个类中添加新的行为的设

2015-03-23 00:52:20 511

原创 Singleton pattern

单例模式,感觉看了还是不是很懂,尤其是什么多线程,什么锁。。自己写了个单线程下的额单例模式,这个单例类是时间,用于程序的运行时告知系统当前时间。至于头文件time.h看看能不能也研究研究。参考:http://blog.csdn.net/boyxiaolong/article/details/6645681http://blog.yangyubo.com/20

2015-03-23 00:50:29 406

原创 time.h

这个头文件还是蛮奇妙的,感觉获取系统当前时间这个以后会用到,学习了一下下:参考:http://zhidao.baidu.com/link?url=tzhn7fKwVkAWVPZy7TrvPBuStPqXTmy3JgXY2-ieBtejERV4krkw-kmZk1F9X24w72INpe2dwaDvdmpPgUwQ7_http://hi.baidu.com/cuixinmin

2015-03-23 00:49:01 806

原创 Chat-online

SOCKET编程下的局域网聊天工具,学习了。。。一些链接:about BYTE, WORD and DWORDabout WSAStartup functionabout sockaddrabout accept function服务器端:main.cpp/* chat online tool server *//* the sid

2015-03-23 00:46:19 744

原创 LeetCode OJ Reverse Words in a String

Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".click to show clarification.Clarification:What constitutes

2015-03-23 00:45:05 409

原创 LeetCode OJ Text Justification

Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified.You should pack your words in a greedy approach; that i

2015-03-23 00:44:16 389

原创 LeetCode OJ Evaluate Reverse Polish Notation

Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples: ["2", "1",

2015-03-23 00:42:59 379

原创 LeetCode OJ 3Sum Closest

Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exact

2015-03-23 00:42:05 386

原创 LeetCode OJ Remove Duplicates from Sorted List II

Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinctnumbers from the original list.For example,Given 1->2->3->3->4->4->5, return 1->2->5.Given 1->1

2015-03-23 00:40:45 379

原创 LeetCode OJ Max Points on a Line

Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.刚开始着急了,没有想清楚情况,没有点,一个点,相同点,斜率不存在。。。对于两个点建立直线方程,然后从头到尾查看是否有符合的点就行了,做的时候用了误差处理,不知

2015-03-23 00:40:30 372

原创 LeetCode OJ Sort List

Sort a linked list in O(n log n) time using constant space complexity.class Solution {public: ListNode *mergeList(ListNode *head_1, ListNode *head_2) { /* if there is just a

2015-03-23 00:39:41 336

原创 LeetCode OJ Insertion Sort List

Sort a linked list using insertion sort.class Solution {public: ListNode *insertionSortList(ListNode *head) { for (ListNode *temp_1 = head; temp_1 != NULL; temp_1 = temp_1->next) {

2015-03-23 00:39:00 513

原创 LeetCode OJ Linked List Cycle

Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?to solve this problem is quiet easy but ingenious. Declare two pointers

2015-03-23 00:38:23 366

转载 LeetCode OJ Linked List Cycle II

Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Follow up:Can you solve it without using extra space?So ingenious, from http://ww

2015-03-23 00:37:42 352

原创 LeetCode OJ Reverse Linked List II

Reverse a linked list from position m to n. Do it in-place and in one-pass.For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4,return 1->4->3->2->5->NULL.Note:Given m, n satisfy t

2015-03-23 00:37:01 387

原创 LeetCode OJ Partition List

Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the original relative order of the nodes in each of

2015-03-23 00:35:27 340

原创 LeetCode OJ Reorder List

Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For example,Given {1,2,3,4}, reorder it t

2015-03-23 00:35:05 335

原创 LeetCode OJ Copy List with Random Pointer

A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy of the list.to be honest, th

2015-03-23 00:34:18 456

原创 LeetCode OJ Remove Duplicates from Sorted List

Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3.class Solution {public

2015-03-23 00:33:13 364

原创 LeetCode OJ Merge Two Sorted Lists

Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.class Solution {public: ListNode *mergeTwoLists(Li

2015-03-23 00:31:11 388

原创 LeetCode OJ Rotate List

Given a list, rotate the list to the right by k places, where k is non-negative.For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2->3->NULL./** * Definition for singly-link

2015-03-23 00:17:11 348

原创 LeetCode OJ Remove Nth Node From End of List

Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the

2015-03-23 00:16:02 353

原创 LeetCode OJ Merge k Sorted Lists

Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity./** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *ne

2015-03-23 00:15:40 339

原创 LeetCode OJ Pow(x, n)

Implement pow(x, n).calculate the pow of a double, use fast power and notice that the exponent may be negative.class Solution {public: double pow(double x, int n) {

2015-03-23 00:14:56 420

空空如也

空空如也

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

TA关注的人

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