C++11 -- Type Alias, noexcept, override, final

Type Alias Similar to typedef, as like as two peas, it is a kind of aliasing. Type Alias needs to use keyword using. There are three usage scenarios: Scenario 1: aliasing function pointers //typedef void (*func)(int,int);// There is a way to write in C language. Here, a function pointer type - func is defined. The function type pointed to ha ...

Added by kenshejoe on Wed, 05 Jan 2022 08:15:05 +0200

Talk about conditional variables of Linux threads

Condition variables are used to synchronize threads. How to synchronize? Let's look down Conditional variable correlation function #include <pthread.h> int pthread_cond_init(pthread_cond_t* cond, const pthread_condattr_t* condattr); //Initialize condition variable int pthread_cond_destroy(pthread_cond_t* cond); //Destroy condition var ...

Added by traffic on Wed, 05 Jan 2022 06:10:59 +0200

BombLab experiment of CSAPP

This article records the process of doing Bob experiment. The dormitory is closed these days. You can't go out except doing nucleic acid every day. It takes just a week to dismantle a bomb every day. First, use objdump - D Bob > Bob Txt to get the disassembly code. View Bob Phase in C file_ 1 to phase_ 6 input functions, corresponding to 6 ...

Added by nsbrown on Wed, 05 Jan 2022 05:10:05 +0200

Codeforces Good Bye 2021: 2022 is NEAR ABCDE

A. Integer Diversity Count the number of figures with different absolute values in all figures. Only when the number of absolute values is less than 2 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int inf=0x3f3f3f3f; const int N=200100; int n,m,t; int w[N]; int cw[N]; int main(){ cin>>t; while(t--) ...

Added by jibosh on Wed, 05 Jan 2022 03:22:05 +0200

29 personal training summary

I went to the hospital in the afternoon. I could only finish the sign in question of the competition over there. It's really uncomfortable that I can't do two questions without making up and solving them now codeforce 1551 B2 title link: Click here to transfer Meaning: give n elements and their numbers, as well as the types and numbers of pig ...

Added by cloudzilla on Wed, 05 Jan 2022 02:53:03 +0200

[C + +] learning notes [13]

File operation The data generated when the program runs belongs to temporary data. Once the program is run, these temporary data will be released. At this time, we can persist the data through files. File operations in C + + need to include header files < fstream There are two types of files: Text file: the file is stored in the comp ...

Added by ntnwwnet on Wed, 05 Jan 2022 01:21:36 +0200

SDUT 2021 Summer Individual Contest - 4(for 20)

Odd Palindrome Question meaning: judge whether all substrings of a string are palindrome odd strings. Idea: enumerate all substrings. If there is an even palindrome string, output no. #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 1e5+10; typedef long long LL; int n,t,a[N]; str ...

Added by iii on Wed, 05 Jan 2022 01:01:15 +0200

NOIP 2016 improvement group Day 1 question 3 changing classrooms

Title Description For Niu Niu, who has just entered college, the first problem he faces is how to apply for appropriate courses according to the actual situation. Among the optional courses, 2n courses are arranged in N time periods. In the I (1 < = I < = n) time period, two courses with the same content are held in different places at ...

Added by sumathi on Wed, 05 Jan 2022 00:11:16 +0200

2022-01-01 swipe questions and punch in every day

2022-01-01 swipe questions and punch in every day (happy New Year's Day!!!) Flying book - daily question 394. String decoding Given an encoded string, returns its decoded string. The coding rule is: k[encoded_string], indicating the encoded inside the square brackets_ String is repeated exactly k times. Note that K is guaranteed to be a pos ...

Added by Fjerpje on Tue, 04 Jan 2022 22:10:54 +0200

C + + based IO

01.C + + type conversion (understand) Static conversion: be used for Class hierarchy Base class (parent class) and Derived class Conversion of pointers or references between (subclasses) Used for conversion between basic data types, such as converting int to char and char to int. The security of this transformation should also be guaranteed ...

Added by Browzer on Tue, 04 Jan 2022 20:35:50 +0200