Implementation with C + +: dance of Sine

Problem description Recently, FJ has set up a mathematical analysis course for his cows. FJ knows that if he wants to learn this course well, he must have a good basic skill of trigonometric function. So he is going to play a game of "dance of Sine" with the cows to improve their computing power. We might as well set   An=sin(1–sin( ...

Posted on Tue, 07 Apr 2020 11:13:44 -0400 by kirti

[solution] Luogu1739 expression bracket matching

Tips: This is a conscience blog. Here, you will see all the pits you may step into.So, the author uses this way to cover up his super konjaku Tramp Road Look at the past, a water problem! I wrote such a code casually: #include <bits/stdc++.h> int main(){ char c; int flag = 0; while(c = getchar()&& c != '@'){ i ...

Posted on Tue, 07 Apr 2020 10:56:02 -0400 by lee2732

std::bind interface and Implementation

Preface Recently, I think of Haskell who came down from pigeon half a year ago. I have reviewed the forgotten grammar and read several sample programs. It is very interesting, so the grass of functional programming is planted deeper. I went to Google again and found a copy of C + + and FP Nearly perfect handout , then brought to the ranges libr ...

Posted on Sun, 05 Apr 2020 21:35:33 -0400 by shruti

[TOJ 4705] maximum prime number

Description Given a number n, ask whether it is possible to take consecutive bits from it in the order from left to right and combine them into a prime number (a number greater than 1 and only divisible by 1 and itself is called a prime number). If there are multiple possibilities, take the largest one of all possible numbers. For example, in 1 ...

Posted on Sun, 05 Apr 2020 19:54:16 -0400 by Devious Designs

[TOJ 3660] family relationship (Union of map maps)

describe Given the relationship between several family members, judge whether two people belong to the same family, that is, two people can directly or indirectly contact each other through these relationships. input There are multiple groups of input data. The first row of each group of data is a positive integer n (1 < = n < = 100), ...

Posted on Sat, 04 Apr 2020 18:28:57 -0400 by sidney

Load balancing problem of Logu P4016 (minimum cost and maximum flow)

Title Description GG company has nn warehouses arranged in a circular way along the railway transportation line, and the quantity of goods stored in each warehouse varies. How to use the minimum handling quantity can make the inventory quantity of nn warehouses the same. When carrying goods, they can only be carried between adjacent warehouses ...

Posted on Sat, 04 Apr 2020 15:28:35 -0400 by timbo6585

The longest k-repeated interval set problem of P 3358 in Luogu

Title Description For a given open interval set I and a positive integer k, the length of the longest k-repeated interval set of open interval set I is calculated. I / O format Input format:  There are two positive integers n and k in the first row of, respectively, representing the number of open intervals and the number of o ...

Posted on Sat, 04 Apr 2020 01:51:58 -0400 by Romeo20

Simple and clear interpolation audio resampling algorithm example (with complete C code)

In recent period of time, we have wandered back and forth between image algorithm and audio algorithm. There are often some requirements for audio sampling and transcoding. Existing well-known open source libraries, such as webrtc, Sox, etc, Code reading is really disturbing. And audio resampling is actually interpolation algorithm. It is not m ...

Posted on Fri, 03 Apr 2020 18:57:53 -0400 by tcarnes

[HDU 2544] shortest circuit (Dijstra template)

Problem Description In the school competition every year, all the students who enter the final will get a beautiful t-shirt. But when our staff transport hundreds of clothes from the store back to the stadium, they are very tired! So now they want to find the shortest route from the store to the stadium. Can you help them? Input The input inclu ...

Posted on Fri, 03 Apr 2020 13:24:46 -0400 by phreud

Data structure: recursive implementation and hierarchical implementation of tree traversal

Tree structure is an important nonlinear data structure. Tree is a finite set of n (n > = 0) nodes. In any non empty tree, there are and only When n > 1, the remaining nodes can be divided into m (M > 0) disjoint finite sets T1,T2,...,Tm, each of which The collection itself is a tree, and is called the root subtree. Therefore, the data ...

Posted on Fri, 03 Apr 2020 11:21:49 -0400 by Christian B.