A Brief Review of “A Brief History”
I have recently read numerous volumes in the “A Brief History” series, including “Sapiens: A Brief History of Humankind,” “A Brief History of Everything,” “A...
AtCoder Grand Contest 038
A. 01 Matrix 本来很简单的一道题,因为只需随便找出一种满足条件的矩阵,所以很容易看出左上角和右下角为0,其余为1的矩阵一定满足条件。我居然想了很久,太蒻了。 #define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <cstdio> #include <cstdlib> #include <algorithm> #include <cmath> #include <cstring> #include <string> #include <vector> #include <queue> #include...
AtCoder Grand Contest 039
老刷水题也没有意思,难的题又做不出来,只能捡些题来做,果然菜是原罪。 A. Connection and Disconnection 单独考虑全是一种字母的情况。 如果不是,就把每个字符串分成三段,前中后,如果前和后一样,再另行计算。细节较多,慢慢写不难。 #define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <cstdio> #include <cstdlib> #include <algorithm> #include <cmath> #include <cstring> #include <string> #include <vector>...
AtCoder Beginner Contest 144
前四道签到,至少这次没翻车 A. 9×9 #define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <cstdio> #include <cstdlib> #include <algorithm> #include <cmath> #include <cstring> #include <string> #include <vector> #include <queue> #include <functional>...
AtCoder Beginner Contest 143
前三道签到 A. Curtain #define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <cstdio> #include <cstdlib> #include <algorithm> #include <cmath> #include <cstring> #include <string> #include <vector> #include <queue> #include <functional>...
Leetcode #5
学习了一下Manacher算法,简单来说就是从中心往外扩展,同时利用len数组,根据对称性,省去不必要的扫描,具体做法见https://www.cnblogs.com/mini-coconut/p/9074315.html class Solution { public: string longestPalindrome(string s) { string manaStr = "$#"; for (int i = 0; i < s.size(); i++) //首先构造出新的字符串 { manaStr...
Leetcode #4
class Solution { public: double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) { int n = nums1.size(); int m = nums2.size(); if(n > m) return findMedianSortedArrays(nums2,nums1); //确保nums1长度更小 int...
AtCoder Beginner Contest 142
前四道都是签到题,直接放代码 A. Odds of Oddness #define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <cstdio> #include <cstdlib> #include <algorithm> #include <cstring> #include <string> using namespace std; int main() {...
GENTOUKA · Comparison of the old and new translations
The left one is the current translation in NetEase Music, the right is the old translation, and there are two other versions available. 1.http://akatsugiyake.lofter.com/post/32b0e5_98f73fd...
Simulate Login
1. Sessions are a series of actions that do not lose states. 2. Cookies store credentials that are used to identify users. 3. Analogous to...