当前位置:网站首页>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
边栏推荐
- Online text digit recognition list summation tool
- 1-4 进制表示与转换
- 语音信号处理-概念(二):幅度谱(短时傅里叶变换谱/STFT spectrum)、梅尔谱(Mel spectrum)【语音的深度学习主要用幅度谱、梅尔谱】【用librosa或torchaudio提取】
- Hutool symmetric encryption
- (resolved) the following raise notimplementederror occurs when Minet tests
- js中如何查看程序运行时间(计时器)
- js中输入三个值,并且由小到大输出
- 安装jenkins
- 碎煤机crusher
- Implementation of game hexagon map
猜你喜欢
![[compilation principles] review outline of compilation principles of Shandong University](/img/a6/b522a728ff21085411e7452f95872a.png)
[compilation principles] review outline of compilation principles of Shandong University

MSSQL how to export and delete multi table data using statements

【批处理DOS-CMD命令-汇总和小结】-输出/显示命令——echo

Origin of forward slash and backslash

(resolved) NPM suddenly reports an error cannot find module 'd:\program files\nodejs\node_ modules\npm\bin\npm-cli. js‘

VNC Viewer方式的远程连接树莓派

win10-如何管理开机启动项?

js例题打印1-100之间所有7的倍数的个数及总和

Goodbye, agile Scrum

【c ++ primer 笔记】第4章 表达式
随机推荐
认识O(NlogN)的排序
win10-如何管理开机启动项?
一个人管理1000台服务器?这款自动化运维工具一定要掌握
Hutool symmetric encryption
ggplot2的自定义调色板
Sword finger offer 07 Rebuild binary tree
[Kevin's third play in a row] is rust really slower than C? Further analyze queen micro assessment
Guava scheduled task
闭包问题
第6届蓝桥杯
Speech signal processing - concept (II): amplitude spectrum (STFT spectrum), Mel spectrum [the deep learning of speech mainly uses amplitude spectrum and Mel spectrum] [extracted with librosa or torch
c#的初步认识
期货反向跟单靠谱吗?
Websocket database listening
Delay queue `delayqueue`
How to add data to the back-end database in the form of Excel file on the web page
apifox学习
Bean copy details
Installation and functions of uview
野風藥業IPO被終止:曾擬募資5.4億 實控人俞蘠曾進行P2P投資