#文件操作 #打开一个文件: # open("文件名","打开模式") # with open("文件名",'打开模式") as 给文件定义变量名: #文件方法: # file.closes() 关闭文件 # file.closed 判断文件是否关闭 # file.seek(移动字节数) 以字节形式 ...
分类:
其他好文 时间:
2021-04-20 15:37:39
阅读次数:
0
一、bit_xor 1、头文件 #include <functional> 2、模板 template <class T> struct bit_xor; template <class T = void> struct bit_xor; 3、返回两个参数按位XOR的结果(公共成员函数) 4、使用 ...
分类:
其他好文 时间:
2021-04-20 15:10:43
阅读次数:
0
##题意 求最长上升子序列长度 ##思路 本题直接用dp写,会超时,需要优化 优化办法:二分+dp ##AC代码 //4test n //6 p //4 2 6 3 1 5 ->3 //10 //2 3 4 5 6 7 8 9 10 1 ->9 //8 //8 7 6 5 4 3 2 1 ->1 / ...
分类:
其他好文 时间:
2021-04-19 14:47:09
阅读次数:
0
opt_map函数中对于指定了select program的分析 从过滤器中进行map static int open_output_file(OptionsContext *o, const char *filename) open_output_file函数中根据stream_map进行创建输出 ...
分类:
其他好文 时间:
2021-04-19 14:39:12
阅读次数:
0
import org.junit.Test; public class TestMethods { @Test public void test() { System.out.println("hello world"); } } 1:首先需要导入import org.junit.test这个jar ...
分类:
编程语言 时间:
2021-04-16 12:01:06
阅读次数:
0
merge函数的作用是:将两个已经排好序的序列合并为一个有序的序列。 函数参数:merge(first1,last1,first2,last2,result,compare); firs1t为第一个容器的首迭代器,last1为第一个容器的末迭代器; first2为第二个容器的首迭代器,last2为容 ...
分类:
其他好文 时间:
2021-04-16 11:46:46
阅读次数:
0
问题: 设计结构体,能够满足以下两个功能: 向结构体中插入数据 void addNum(int num) 去当前结构体中的中位数 double findMedian() 若共有奇数个数,取最中间的数 若共有偶数个数,取中间两个数之和/2 Example 1: Input ["MedianFinder ...
分类:
其他好文 时间:
2021-04-16 11:45:21
阅读次数:
0
再次因为浮点数g++, c++编译器的问题WA,中间还因为reset没有改过来编译器无脑再WA了一次 这道题很适合Kruskal这种将最开始的联通森林,一点点聚合到一起成为一棵联通的最小生成树的想法,只不过,具体到这道题,是要将原先的p个森林,聚合成为s个森林,所以实现就非常简单了 #include ...
分类:
其他好文 时间:
2021-04-14 12:13:20
阅读次数:
0
1.1 套接字 C语言网络编程其实本质上也是多进程之间通过socket套接字进行通信,知识进程可能位于不同的服务器上,常用的TCP/IP协议有3种套接字类型,如下所示: 1.1.1 流套接字(SOCK_STREAM) 流套接字用于提供面向连接、可靠的数据传输服务,该服务保证数据能够实现无差错、无重复 ...
分类:
编程语言 时间:
2021-04-14 12:08:37
阅读次数:
0
package stream import ( "log" "reflect" "sort" ) type ( // a Stream is where one can drain data from Stream chan interface{} // buffer stream BufferSt ...