当前位置:网站首页>Experience record of Luogu's topic brushing
Experience record of Luogu's topic brushing
2022-06-27 07:43:00 【#math. h】
1. Transform ideas : Variable angle ; The result is finally processed 100 10% 120
2. rounding :
/* +0.5 Words , If greater than or equal to 0.5 Just move forward , Less than 0.5 Don't move forward , Then cast to int It's going to round down , Just round to an integer , This is one of the simplest rounding methods I think . If you need to round to one place , then * How much and then divide For example, one decimal place is *10/10.0 The last two *100/100.0 With one .0 It means floating point operation , So it won't be over int 了 Law two : cout<<**floor**(s*10+0.5)/10.0;// return s The result rounded to the second decimal place 
4. double s=0.0000;// Please pay attention to the accuracy
sn Use double, Otherwise, the accuracy is not enough ……
Note the data types on both sides of the division ( Can't make it int, Otherwise, it is equal to div operation )
5. Mathematical thought : Geometric series
6. Note that the distance entered may be decimal , So it has to be defined as a floating point number .
7. unsigned long long n,ans=0; // The pit is right here . The days are so big , Will the total distance be small ???
8.c Language has sprintf and sscanf, Corresponding stringstream Read and write of string stream
<stdlib.h> There is also the conversion between numeric values and strings iota and atoi function , Those who are interested can learn about it by themselves . use c Linguistic sprintf Than C++ High efficiency of string stream , But I still want to use C++ String , Why? ? because C++ The extensibility and flexibility of strings are relatively high hhhh
9. Header file
count(ivec.begin() , ivec.end() , searchValue) This function is used to count the number of occurrences of a certain value within a certain range
10.2 The loveliness of a fish may be the same , So we need to discretize
Let's focus on discretization : For the following 4 Number , 10, 12, 9, 15 So the corresponding The largest number is : 2,3,1,4; That is to convert a large number into a small value ( One-to-one correspondence , People who have studied discrete mathematics should know this ), As follows : 10,12,9,15 First, the sequence subscript corresponding to the input :1,2,3,4; Put this 2 Put the rows in the structure ; Then the structure array follows the first line (10,12,9,15) Sort from small to large , The comparison function should be easy to write , The results are as follows : 9,10,12,15; Corresponding to the next behavior 3,1,2,4; And then put 9,10,12,15 Switch to 1,2,3,4, This structure is then constructed in accordance with the 2 OK, just line up again from small to large , obtain : first line 2,3,1,4, The first 2 That's ok 1,2,3,4; This 2,3,1,4 Is the result of discretization , Note that there may be repeated numbers for this question , therefore In the 9,10,12,15 Switch to 1,2,3,4 Pay attention to , If yes 10,10, 12,15 Change it into 1,1,2,3; The input data may be 0, So the input value should be added 1
11. The idea of the bucket : cin>>a[i];// Read in g[a[i]]=1;// Assign a value of... In the set 1
12.//in[j]-‘a’: Read the position of the corresponding letter in , such as ’a’ Corresponding 0,‘b’ Corresponding 1,‘c’ Corresponding 2(0 Start );
//in[j]-‘a’+n: The corresponding position of the letter obtained by adding the transfer digit to the corresponding letter in the reading .
// for instance ’c’ This letter moves 3 position , That is the first. 2 Letters move to the right 3 individual , It's the fifth letter , namely ’f’
// Remainder 26 Is to prevent the number of bits from moving more than 26 Cause to blow up
// Plus ’a’, Restore the corresponding position to letters , Then type it out
11. Recurrence ( The initial conditions should be improved first ) Looking for a regular Think more about recursion
12. annular You can take the mold
13. The second one is —— It also improves the level of knowledge ——C++ Li real type if 0 Divide by a negative number to get -0 = = This operation is really explosive ! At the last point, I made a mistake , A special judgment is required
边栏推荐
- Coal crusher
- JS output all prime numbers between 1-100 and calculate the total number
- 攻防演习防御体系构建之第二篇之应对攻击的常用策略
- The first part of the construction of the defense system of attack and defense exercise is the introduction and the four stages of Defense
- SQL attendance query interval: one hour
- js输出1-100之间所有的质数并求总个数
- Window right click management
- R language consumption behavior statistics based on association rules and cluster analysis
- [Kevin's third play in a row] is rust really slower than C? Further analyze queen micro assessment
- 【批处理DOS-CMD命令-汇总和小结】-批处理命令中的参数%0、%1、%2、%[0-9]、%0-9和批处理命令参数位置切换命令shift,dos命令中操作符%用法
猜你喜欢

JS output all prime numbers between 1-100 and calculate the total number

JS example print the number and sum of multiples of all 7 between 1-100

MSSQL how to export and delete multi table data using statements
![[compilation principles] review outline of compilation principles of Shandong University](/img/a6/b522a728ff21085411e7452f95872a.png)
[compilation principles] review outline of compilation principles of Shandong University

Online text digit recognition list summation tool

【c ++ primer 笔记】第4章 表达式

Programming life - what do you think of the 35 year old bottleneck of programmers?

js判断用户输入的数是否为质数(多种方法)

File and multipartfile overview

js中输入三个值,并且由小到大输出
随机推荐
Testing network connectivity with the blackbox exporter
攻防演习防御体系构建之第二篇之应对攻击的常用策略
volatile 和 synchronized 到底啥区别?
语音信号特征提取流程:输入语音信号-分帧、预加重、加窗、FFT->STFT谱(包括幅度、相位)-对复数取平方值->幅度谱-Mel滤波->梅尔谱-取对数->对数梅尔谱-DCT->FBank->MFCC
Speech synthesis: tacotron explains [end-to-end speech synthesis model] [compared with traditional speech synthesis, it does not have complex phonetics and acoustic feature modules, but only uses < te
js输出形状
JS example print the number and sum of multiples of all 7 between 1-100
University database mysql
How torch. gather works
js成绩奖惩例题
R 语言Analyzing wine data
JS performance reward and punishment examples
(resolved) the following raise notimplementederror occurs when Minet tests
JS to print prime numbers between 1-100 and calculate the total number of optimized versions
log4j:WARN No such property [zipPermission] in org. apache. log4j. RollingFileAppender.
Origin of forward slash and backslash
apifox学习
【批处理DOS-CMD命令-汇总和小结】-将文件夹映射成虚拟磁盘——subst
JS to judge the odd and even function and find the function of circular area
C how to call line and rows when updating the database