Go 语言字符串相等函数的 SIMD 实现 背景说明Go 语言是 Google 开发的一种静态强类型、编译型、并发型,并具有垃圾回收功能的编程语言。它用批判吸收的眼光,融合 C 语言、Java 等众家之长,将简洁、高效演绎得淋漓尽致。 SIMD 全称 Single Instruction Multiple Data,即单指令多数据流,用一条指令对多个数据进行操作。一般用向量寄存器来实现。常用于加速数据密集型运算,如数列求和、矩阵乘法。 本实 2021-12-30 Coding > Programming Language #Course Project #Assembly #Go
Go 语言函数调用汇编代码分析 背景说明Go 语言是 Google 开发的一种静态强类型、编译型、并发型,并具有垃圾回收功能的编程语言,它用批判吸收的眼光,融合 C 语言、Java 等众家之长,将简洁、高效演绎得淋漓尽致。 这篇文章主要研究 Go 语言中的函数调用是如何用 x64 汇编实现的。 探索过程首先编写一个非常简单的 Go 语言程序。 test1.go123456789package mainfunc sum(a, b 2021-10-30 Coding > Programming Language #Course Project #Assembly #Go
Introduction to MapReduce IntroductionThere are tons of large data in today’s life. Processing large data on a single computer becomes unacceptable as the scale of data soars. A classic problem is the word count problem: Given 2021-07-03 Coding > Back End Development #Course Project #Go #Java
Introduction to Quadratic Residue 定义令$p$为奇质数。 定义 1 对于一个整数$n$,若存在整数$x$,使得$x^2 \equiv n \pmod p$,则称$n$是模$p$的二次剩余,否则称$n$是模$p$的二次非剩余。 定义 2(勒让德符号) $$\left({n \over p}\right)=\begin{cases}1, & n是模p的二次剩余 \\ -1, & n是模p的二次非剩余 2020-02-06 OI > Number Theory #Note #Quadratic Residue
Four Loop 题目描述Given two sequences $a$ and $b$ of equal length $n$, find the $$\sum_{x=1}^n \sum_{y=1}^n \sum_{z=1}^n \sum_{w=1}^n (a_x+a_y+a_z+a_w)^{(b_x \oplus b_y \oplus b_z \oplus b_w)}$$ 2020-02-06 OI > Number Theory #Fast Fourier Transform #Fast Walsh-Hadamard Transform
Bitwise XOR 题目描述Given a sequence $a$ and an empty sequence $b$, each element in $a$ is added to $b$ with probability $P$ (independently to the other elements). Denote $s=\bigoplus_{i=1}^{|b|} b_i$, wher 2020-02-04 OI > Number Theory #Dynamic Programming #Probability
Unbalanced Coin 题目描述You have an unbalanced coin, the state of which (head or tail) after tossing depends on the previous state. If the head side is up now, the probability that the coin is still head up after tossing 2020-02-04 OI > Number Theory #Dynamic Programming #Exponentiation by Squaring #Fast Fourier Transform #Generating Function
Conquer the Polygon 题目描述You have a convex polygon. The vertices of the polygon are successively numbered from $1$ to $n$. You also have a triangulation of this polygon, given as a list of $n-3$ diagonals. There will be $ 2020-02-04 OI > Graph Theory #Topological-Sort
BBQ 题目描述You are a master of barbeque, and now you are trying to string dumplings with a bamboo stick. The dumplings are placed in a $n \times m$ grid. Each grid contains exactly one dumpling. The color of 2020-02-04 OI > Common Skill #Dynamic Programming
Tsr and Variance 题目描述Tsr is a cute boy with handsome moustache. You are given a sequence with length $n$. Tsr wants you to calculate the sum of variance of each successive subsequence. Note: The variance in this probl 2020-01-31 OI > Number Theory #Fast Fourier Transform