using System; namespace EventDelegation { /// <summary> /// 事件参数类 /// </summary> public class EventDate : EventArgs { public int eventID; public int a ...
C++(template模板 && 类模板 成员函数类外实现) 类模板,成员函数类外实现 #define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <string> using namespace std; template<class ...
分类:
编程语言 时间:
2021-04-27 14:30:06
阅读次数:
0
今天我来分享一下如何利用素数分解定理求解与n互质的数的个数。 下面是代码 #include<bits/stdc++.h> using namespace std; long long fun(int x) { long long ans=x; int t=sqrt(x); int cnt; for( ...
分类:
其他好文 时间:
2021-04-26 14:12:06
阅读次数:
0
参考网址:https://www.bejson.com (网站文件部分有坑,需要擦亮眼睛) nginx k8s版本:v1.20 apiVersion: apps/v1 kind: Deployment metadata: name: my-nginx namespace: test spec: re ...
分类:
其他好文 时间:
2021-04-26 14:08:07
阅读次数:
0
线程 创建线程 #include <pthread.h> int pthread_create(pthread_t *restrict thread,const pthread_attr_t *restrict attr,void *(*start_routine)(void*), void *re ...
分类:
其他好文 时间:
2021-04-26 13:53:31
阅读次数:
0
语法 为了更好的组织类,Java提供了包机制,用于区分类名的命名空间。 package 路径.路径; 必须在类名最上面 包的规范 一般用公司域名到置位 con.baidu.www 导包 import package com.urll.路径; package year; import java.uti ...
分类:
编程语言 时间:
2021-04-26 13:46:48
阅读次数:
0
命名空间: System.Net,这是.NET创建者最初开发用于使用HTTP请求的标准类。使用HttpWebRequest可以让开发者控制请求/响应流程的各个方面,如 timeouts, cookies, headers, protocols。 GET请求就很简单易懂啦,如果需要传参,在URL末尾加 ...
分类:
Web程序 时间:
2021-04-26 13:25:50
阅读次数:
0
被迫营业。 对于树上的路径统计问题,我们一直存在一个比较暴力的做法,就是从根节点出发,先统计所有以根为 \(\text{lca}\) 的路径,然后依次递归每一棵子树,同时使用上面的方法。这个方法的复杂度显然是 \(O(n^2)\) 的,我们可以轻易的用一条链卡掉,于是问题来了,如果题目让我们统计所有 ...
分类:
编程语言 时间:
2021-04-26 13:15:20
阅读次数:
0
c++(继承 &&菱形继承) #define _CRT_SECURE_NO_WARNINGS #include <iostream> using namespace std; class Animal { public: int m_Age; }; class Sheep :virtual publ ...
分类:
编程语言 时间:
2021-04-26 13:09:57
阅读次数:
0
转化题目,题目要求的是K级祖先,我们可以对于每个询问先跳到祖先,那么就是求对于这个祖先,depth[u]+k的个数是多少个,然后-1就是答案 #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair ...
分类:
其他好文 时间:
2021-04-24 13:41:24
阅读次数:
0