上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 46 下一页
摘要: IPv4套接字地址结构struct in_addr { in_addr_t s_addr; };struct sockaddr_in { uint8_t sin_len; /* length of structure (16) bytes */ ... 阅读全文
posted @ 2015-03-14 23:09 卖程序的小歪 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 好久不读不用又忘得差不多了,还是感叹Richard Stevens真是太刁,25年前第一版。"Tcp state diagram fixed new" by Scil100. Licensed under CC BY-SA 3.0 via Wikimedia Commons - http://com... 阅读全文
posted @ 2015-03-14 21:51 卖程序的小歪 阅读(230) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #define MAX_N 10int d[MAX_N][MAX_N];int dp[1= 0) { return dp[S][v]; } if ((1>u) & 1)) { ... 阅读全文
posted @ 2015-03-13 20:01 卖程序的小歪 阅读(370) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2015-03-10 21:55 卖程序的小歪 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Iterator接口public interface Iterator { boolean hasNext(); E next(); void remove();}访问元素前需要使用hasNext进行判断是否有元素存在,如果有再通过next操作获取,直接使用next操作而不进行ha... 阅读全文
posted @ 2015-03-10 21:01 卖程序的小歪 阅读(427) 评论(0) 推荐(0) 编辑
摘要: 尼玛,数组偶数个数的时候取中位数是取中间两者中的前者,还tmd一直再算平均,卧槽#include #include #include #include using namespace std;int min(int a, int b) { return a a(na); for ... 阅读全文
posted @ 2015-03-10 15:54 卖程序的小歪 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 这场考试当年还参加了,当时直接用内置的排序了,否则自己写归并排序浪费时间啊,现在来练习一发。估计又有些节点没在链表里面,当时没考虑这个情况,所以一直有些case没过#include #include #include #include using namespace std;class Node {... 阅读全文
posted @ 2015-03-10 13:16 卖程序的小歪 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 又是排队模拟#include #include #include #include #include using namespace std;class Man {public: int arrive; int need; int start; Man(int a, int ... 阅读全文
posted @ 2015-03-09 21:52 卖程序的小歪 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 只能说看清题意很重要,md扯了半天是开始时间在17:00之前的可以而不是结束时间。另外代码里选取最小队列的过程(move_customers内)可以用priority_queue来加速,不过反正约定的数据量不大就直接遍历吧。#include #include #include #include #i... 阅读全文
posted @ 2015-03-09 15:00 卖程序的小歪 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 今天逛cplusplus.com发现C++还真多了不少方便使用的特性,先了解些最常用的初始化列表 vector tmp({1,2,3,4}); vector > tmp_pair( { {1, 2}, {3, 4} ... 阅读全文
posted @ 2015-03-09 11:03 卖程序的小歪 阅读(186) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 46 下一页