[sword finger Offer]56 - the number of times the number in the array appears (bit operation)

The number that appears only once in the array of topic 1 subject Except for two numbers in an integer array, other numbers appear twice. Please write a program to find out the two numbers that only appear once Title Solution XOR. Consider first: only one number in the array appears only once, and other numbers appear twice. How to find this n ...

Posted by sholah on Fri, 01 Nov 2019 15:16:08 +0100

[luogu2680] [noip2015] transportation plan [differential edge difference on LCA tree] [two points]

P2680 transportation plan After the real system did the difference on the tree again, I found that the problem was not so difficult emmmm. It can be seen from the problem that this is a tree, so when the preprocessing is doubled, the length of the chain is processed by the way. Then, from the maximum value and the minimum value, we can get t ...

Posted by Trium918 on Fri, 01 Nov 2019 12:47:06 +0100

Go basic programming practice - Documentation

Check if the file exists Create the log.txt file in the same directory of this program to detect. package main import ( "os" "fmt" ) func main() { if _, err := os.Stat("log.txt"); err == nil { fmt.Println("Log.txt file exists") } } Check if the file does not exist package main import ( "os" "fmt" ) func main ...

Posted by ericw on Fri, 01 Nov 2019 10:52:59 +0100

Implementation and deployment of linux Cluster

  (1) configure basic environment //Install virtual tools #cd /media/VMware\ Tools/ #cp VMwareTools-10.0.6-3595377.tar.gz/tmp/ #cd /tmp/ #tar-xvzf VMwareTools-10.0.6-3595377.tar.gz #cd vmware-tools-distrib/ #./vmware-install.pl Stop and shut down the NetworkManager service: service NetworkManager status #service Networ ...

Posted by autocolismo on Fri, 01 Nov 2019 10:15:26 +0100

Codeforces 1184C1. Heidi and the Turing Test (Easy)

Original question link: C1. Heidi and the Turing Test (Easy) I'll give you a plane rectangular coordinate system, and the coordinates of some points (there are \ (4 \cdot n + 1 \). You know that there must be a square, and there is an extra point beside the square. Now please find out that point (Note: the points on each side are not less than ...

Posted by Gordicron on Fri, 01 Nov 2019 06:09:16 +0100

Problem A: circuit maintenance

Problem A: circuit maintenance Time limit: 1 Sec memory limit: 128 MBSubmitted by: 16 solved by: 7 [Submission][state][Discussion Edition [proposition people: add_shengjunjie][Edit] [TestData] Title Link: http://acm.ocrosoft.com/problem.php?cid=1694&pid=0 Title Description Ha'nyu is a witch from a different worl ...

Posted by arsenalfan14 on Thu, 31 Oct 2019 21:35:31 +0100

C89: on constant

I. Const constant 1. role Const decorated data type refers to constant type. The value of variable or object of constant type cannot be updated.It is used to improve the security and reliability of the program (in fact, I generally think it's not necessary to add it, but it's better to add the code).Its original purpose is to replace precom ...

Posted by nivaspm on Thu, 31 Oct 2019 20:19:11 +0100

MPI learning notes: matrix multiplication

Reference from: https://blog.csdn.net/lcx543576178/article/details/45892839 The procedure is slightly modified as follows: #include<iostream> using namespace std; #include<mpi.h> int main(int argc, char * argv[] ){ double start, stop; int *a, *b, *c, *buffer, *ans; int size = 1000; int rank, numprocs, ...

Posted by mbabli on Thu, 31 Oct 2019 11:33:18 +0100

Introduction to linear basis

Brief explanation Linear basis under xor: Linear basis method: From high position to low position, if the linear basis of control I position exists, then a[k]^=p[i] Otherwise, p[i] = a[k];break; Furthermore, the I-bit of the linear basis other than the linear basis p[i] is changed to 0, and the linear basis with the smallest element is obtain ...

Posted by Heatmizer20 on Thu, 31 Oct 2019 10:13:29 +0100

Heuristic search: A * and IDEA* 16 grid puzzle as an example

The title is described as follows: The goal of the 15 puzzle problem is to complete pieces on 4×4 cells where one of the cells is empty space. In this problem, the space is represented by 0 and pieces are represented by integers from 1 to 15 as shown below. 1 2 3 4 6 7 8 0 5 10 11 12 9 13 14 15 You can move a piece toward the empty space at one ...

Posted by philosophia on Thu, 31 Oct 2019 10:07:30 +0100