HDU - 1237 simple calculator (infix expression evaluation)

Read in a non negative integer calculation expression containing only +, -, *, / and calculate the value of the expression. Input The test input contains several test cases. Each test case occupies one line with no more than 200 characters. Integers and operators are separated by a space. No illegal expression. When there is only 0 in a line, ...

Posted by stormcloud on Sat, 21 May 2022 19:24:15 +0300

CMake multi main() entrance project construction (brush topic direction)

In ACM algorithm competition / LeetCode using C + + to brush questions and other scenarios, usually: A lot of C + + source code needs to be maintained Multiple main function entries are required to facilitate test execution Some self written public function class libraries (such as debug output vector, etc.) are referenced in multiple files T ...

Posted by DarkendSoul on Thu, 12 May 2022 18:47:09 +0300

CF Round 698(Div2) problem solving supplement Report

Official explanation Title A: greedy / DP There are \ (T(1\leq T \leq 100) \) groups of data. Given a monotone non decreasing sequence with a length of \ (n(n \leq 100) \), the item \ (I \) is \ (a_i(1\leq a_i \leq n) \). Now try to divide it into \ (k \) strictly monotonically increasing sequences and request the minimum value of \ (k \). Pe ...

Posted by solee on Tue, 26 Apr 2022 20:22:04 +0300

Explanation of 2022 Harbin Institute of technology competition

Game link L question NP-hard Given the positive integer \ (n \) in decimal system, which 1 is more in \ (x,y \) base system? \(1\leq n \leq 10^9,2\leq x, y\leq 10\) #include<bits/stdc++.h> using namespace std; int f(int n, int x) { int res = 0; while (n) { res += n % x == 1; n /= x; } return res; } char s ...

Posted by tenaki on Mon, 04 Apr 2022 15:03:44 +0300