Advanced use of delegation
multicast a delegate contains more than one method
static void Main(string[] args)
{
Student stu1 = new Student() { ID=1,PenColor=ConsoleColor.Yellow};
Student stu2 = new Student { ID = 2, PenColor = ConsoleColor.Green };
Student stu3 = new Student { ID = 3, PenColor = ConsoleColor.Red };
...
Added by scorpioy on Mon, 21 Oct 2019 00:39:58 +0300
Problem solving - extra physical strength (monotone queue optimization DP)
Problem solving - extra physical strength (monotone queue optimization DP)
This is a template question. However, the monotonous queue of ssw02 examination room has been written (ssw02 is a real dish).
Tomorrow, there will be the ACM competition system competition for the seniors. Fortunately, tqr06 will form a team.
Problem surface
Now your gr ...
Added by joozt on Sun, 20 Oct 2019 22:45:17 +0300
"Problem solving" Luogu P3376 [template] network maximum flow
Problem Portal
Portal1: Luogu
Description
For example, give a network diagram, its source and sink points, and find out the maximum flow of its network.
Input
The first line contains four positive integers \ (N,M,S,T \), which respectively represent the number of points, the number of directed edges, the source point serial number and the sink ...
Added by greip on Sat, 19 Oct 2019 21:44:51 +0300
After class case of Python learning day 7 (crawling and analyzing website information, crawling pictures)
Crawler for text
1. Crawl the title of the article on the homepage of Netease and do word frequency and word cloud analysis
Program code:
# Import module package
import requests
import re
import jieba
import wordcloud
# Crawling object links
url = 'https://www.163.com/'
# Get web information
response = requests.get(url)
data = response.text
# ...
Added by mosizlak on Sat, 19 Oct 2019 00:09:56 +0300
Problem solving P3627 [[APIO2009] looting plan]
The idea in front of this problem is the same as other solutions, which are all tarjan contractions. Then it is to ask for the maximum value of gold coins. I use memory search to express how much money can be stolen from the connection block numbered I with jiyi[i]. When I search, if I encounter a point that has been searched (I know how much m ...
Added by JoeF on Fri, 18 Oct 2019 23:00:48 +0300
[2019HDU first multi school] [HDU 6584][G. Meteor]
Title Link: http://acm.hdu.edu.cn/showproblem.php?pid=6584
Main idea of the question: find all the scores that satisfy \ (0 < \ frac {P} {Q} \ leq1, GCD (P, q) = 1, P \ Leq n, Q \ Leq n \), the smaller of \ (k \)
Question solution: consider the two-point answer and record it in the form of score. If the current binary score is \ (\ frac{p} ...
Added by Perry Mason on Fri, 18 Oct 2019 20:25:46 +0300
Traversal of P3916 graph in Luogu
Traversal of P3916 graph in Luogu
Description
The directed graph of N points and M edges is given. For each point v, find A(v) to represent the point with the largest number that can be reached from point v.
Input
Line 1, 2 integers N,M.
Next row M, each row has two integers Ui,Vi, representing the edge (Ui,Vi). Click 1, 2,..., N number.
...
Added by dercof on Fri, 18 Oct 2019 18:57:00 +0300
Extended Euclidean solution of the equation
Topic encryption
First of all, we can think of using exgcd when we see this problem, but how to use it? We know that as soon as this equation has a bunch of solutions, then the limit of this problem is the number of solutions. We think that if we simplify the equation, we can get $y=\frac{c}{b}-\frac{a}{b}*x $, and then we will use the knowled ...
Added by xzazx on Thu, 17 Oct 2019 21:58:19 +0300
Because of writing Euler function, I learned to do simple pairing.
1. Randomly generated data:
1. Randomly generate a number:
It's very simple. The mod here depends on the maximum number you want to generate.
int random(int mod){
return (long long)rand()*rand()%mod;
}
int main(){
freopen("data.in","w",stdout);
srand((unsigned)time(0));
printf("%d",random());
return 0;
}
2. ...
Added by EvilSupahFly on Wed, 16 Oct 2019 23:29:49 +0300
Linux development infrastructure construction
Server configuration
Password free login, configure public key connection
Copy the local public key to the server
$ ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.100.80
Replace aliyum source
Replace Centos-7.repo
wget http://mirrors.aliyun.com/repo/Centos-7.repo
# backups
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo ...
Added by bfinucan on Tue, 15 Oct 2019 19:33:14 +0300