#include <iostream> #include <cstdio> #include <cstring> using namespace std; const int N = 2000010; typedef long long LL; int n; //t[i]表示树状数组i结点覆盖的范围 ...
分类:
编程语言 时间:
2020-09-11 14:22:54
阅读次数:
34
POJ2387 Til the Cows Come Home 题目链接 题意:在一个无向图中,求点 n 到点 1 的最短路径。 用邻接表 dijkstra 即可不需要考虑重边。 #include <iostream> #include <cstdio> #include <algorithm> #i ...
分类:
其他好文 时间:
2020-09-11 14:13:48
阅读次数:
39
题目链接:String Similarity 题意: 首先题目定义了两个串的相似(串的构成是0、1),如果两个串存在对于一个下标k,它们的值一样,那么这两个串就相似 然后题目给你一个长度为2n-1的串,我们设下标从1开始,那么[1,n],[2,n+1],[3,n+2]...[n,2n-1]每一个都是 ...
分类:
其他好文 时间:
2020-09-10 23:20:02
阅读次数:
48
按边权把边从小到大排序 用并查集加边 检查是否为连通图 #include<iostream> #include<algorithm> using namespace std; const int N = 100010, E = 200010; struct edge{ int a, b, w; bo ...
分类:
编程语言 时间:
2020-09-10 22:59:17
阅读次数:
38
#include <stdio.h>#include <malloc.h>typedef struct Node{ int data; struct Node *next;}Node; void reverseNode(Node *head){ Node *cur = head->next; Nod ...
分类:
编程语言 时间:
2020-09-09 19:08:28
阅读次数:
43
#include "stdio.h" #include "stdint.h" #include "windows.h" #include "ws2tcpip.h" void main(void) { struct sockaddr_in sa; char str[INET_ADDRSTRLEN]; ...
分类:
Web程序 时间:
2020-09-09 19:04:36
阅读次数:
51
承接上篇IO复用之select selet将描述符和事件分离,所以在select接口需要传入三个数组表示不同的事件集合。poll也是在一定时间内轮询所有的描述符,但它将事件和描述结合。 函数签名 #include <poll.h> int poll(struct pollfd *fds, nfds_ ...
分类:
其他好文 时间:
2020-09-09 18:53:57
阅读次数:
47
JNI是JAVA标准平台中的一个重要功能,它弥补了JAVA的与平台无关这一重大优点的不足,在JAVA实现跨平台的同时,也能与其它语言(如C、C++)的动态库进行交互,给其它语言发挥优势的机会。 有了JAVA标准平台的支持,使JNI模式更加易于实现和使用。在此总结了下面这个知识图: 实例: 环境说明: ...
分类:
其他好文 时间:
2020-09-07 19:06:09
阅读次数:
38
__FILE__宏 __FILE__宏用于检查当前文件名,例如: #include <cstdio> using namespace std; int main() { printf("%s\n", __FILE__); return 0; } 假如这段代码保存为a.cc,就会输出a.cc。这在大项 ...
分类:
编程语言 时间:
2020-09-07 18:49:04
阅读次数:
48
#define _CRT_SECURE_NO_WARNINGS#include<stdio.h>#include<string.h>#include<stdlib.h>#include<math.h>#include<time.h> void my_strcat01(char*ch1,char*ch ...
分类:
编程语言 时间:
2020-09-04 17:27:09
阅读次数:
52