例题 :4 + 2 3 \sqrt{4+2\sqrt{3}\space} 4 + 2 3
解 :
原式 = ( 1 2 + ( 3 ) 2 ) + 2 3 \sqrt{(1^2+(\sqrt{3\space})^2)+2\sqrt{3\space}\space} ( 1 2 + ( 3 ) 2 ) + 2 3
= 1 2 + ( 3 ) 2 + 2 3 \sqrt{1^2+(\sqrt{3\space})^2+2\sqrt{3\space}\space} 1 2 + ( 3 ) 2 + 2 3
又 ∵ ( a 2 + b 2 ) = ( a 2 + b 2 + 2 a b ) \large\because (a^2+b^2)=(a^2+b^2+2ab) ∵ ( a 2 + b 2 ) = ( a 2 + b 2 + 2 ab )
∴ O r i g i n a l f o r m u l a = ( 1 + 3 ) 2 \large \therefore\ Original\space formula=\sqrt{(1+\sqrt{3\space})^2\space} ∴ O r i g ina l f or m u l a = ( 1 + 3 ) 2
= 1 + 3 \large =1+\sqrt{3\space} = 1 + 3
p o s t e d o n A u g . 18 t h , 2022 posted\space on \space Aug. \space 18th,\space 2022 p os t e d o n A ug . 18 t h , 2022
T h a n k s t o W a n g H X Thanks \space to \space WangHX \space T hank s t o W an g H X
@违规用户名T3Zr6OE%
F r o m Q i n g z h u h u − x i a n g y i F o r e i g n L a n g u a g e s S c h o o l C h a n g s h a From\space Qingzhuhu-xiangyi \space Foreign \space Languages \space School \space Changsha F r o m Q in g z h u h u − x ian g y i F or e i g n L an g u a g es S c h oo l C han g s ha
快速高质量实用乘法(取模)
C++ 复制 #include <bits/stdc++.h>
using namespace std ;
typedef unsigned long long ull;
ull Fast_Multiplication (ull a , ull b , ull c ) // work out (a * b % c)
{
long double d = (long double )a * b - (long double )(ull)(a * b / c) * c;
return (ull)(d + 0.5 );
}
int main ()
{
ull a, b, c;
scanf (" %llu%llu%llu " ,& a, & b, & c);
printf (" %llu " , Fast_Multiplication (a, b, c));
return 0 ;
}
p o s t e d o n A u g . 19 t h , 2022 posted\space on \space Aug. \space 19th,\space 2022 p os t e d o n A ug . 19 t h , 2022
T h a n k s t o L e i R Q Thanks \space to \space LeiRQ \space T hank s t o L e i R Q
@lrq090403
F r o m Y Z Y L From\space YZYL F r o m Y Z Y L
JSOI2015 夏令营提高组实战 Day5 T1
题面 :
解析
知道你看不懂,我也没看懂 。
反正就是什么 lg (log10) x 和 x 的位数 有亿点点关系 。
代码也是需要自己理解的 。
C++ 复制 #include <bits/stdc++.h>
using namespace std ;
int n;
int l, r, mid; // 二分必备
int main ()
{
scanf (" %d " , & n);
l = 0 , r = 2 e 9 + 114514 ;
while (l + 1 < r) // 二分模板 之一
{
mid = (l + r) >> 1 ;
if ((double ) mid * log10 (mid) >= (double ) n - 1.0 ) // 注意精度,不能直接 floor() or ceil();还需要 -1
r = mid;
else l = mid;
}
printf (" %d " , r); // 输出,参照某 对线哥
return puts ("" ),0 ;
}
/*
温故而 知新 :
log10() 顾名思义,就是 log10 x
floor() 将浮点数 向下取整
ceil() 将浮点数 向上取整
cerr << ; 高级输出调试,用法和 cout 差不多,自己百度
*/
p o s t e d o n A u g . 21 t h , 2022 posted\space on \space Aug. \space 21th,\space 2022 p os t e d o n A ug . 21 t h , 2022
T h a n k s t o L i Z X Thanks \space to \space LiZX \space T hank s t o L i Z X
@clamee
F r o m T h e F i r s t H i g h S c h o o l o f C h a n g s h a H u n a n From\space The \space First \space High \space School \space of \space Changsha \space Hunan F r o m T h e F i r s t H i g h S c h oo l o f C han g s ha H u nan
& L i M Z \And \space LiMZ \space & L i M Z @Ice_Cold_Tea
F r o m Q i n g z h u h u − x i a n g y i F o r e i g n L a n g u a g e s S c h o o l C h a n g s h a From\space Qingzhuhu-xiangyi \space Foreign \space Languages \space School \space Changsha F r o m Q in g z h u h u − x ian g y i F or e i g n L an g u a g es S c h oo l C han g s ha
新知识:114514 & \space \And & 1919810
114514和1919810到底是在什么地方出现呢?有些了解的网友进行了解答!回答如下:“其实这个梗出自被日本网友一直恶搞的钙片真夏夜淫梦第四章昏睡!野獣先辈,最后野兽先辈(本名田所)高潮的时候,最后发出的声音,日文原本翻译成中文是“好,好吧!”,发音是:逸逸有可以有,结果这里的发音特别像日文中数字“114514”的读法,因此就出现了“114514”的弹幕。”。
(来自 百度 )
p o s t e d o n A u g . 22 t h , 2022 posted\space on \space Aug. \space 22th,\space 2022 p os t e d o n A ug . 22 t h , 2022
T h a n k s t o L e i R Q \large Thanks \space to \space LeiRQ \space T hank s t o L e i R Q
@lrq090403
他推荐的视频: U240871 thing_of_thing
F r o m Y Z Y L From\space YZYL F r o m Y Z Y L
二项式定理反演
注记:( n m ) = C n m \dbinom{n}{m} = \Large C_n^m ( m n ) = C n m
结论
∑ i = 1 n ( n i ) ( − 1 ) n − i = [ n = = 0 ] \Large \sum\limits_{i=1}^{n}\ \dbinom{n}{i} (-1)^{n-i}=[n == 0] i = 1 ∑ n ( i n ) ( − 1 ) n − i = [ n == 0 ]
f ( n ) = ∑ i = 0 n ( n i ) g ( i ) ⟺ g ( n ) = ∑ i = 0 n ( − 1 ) n − i ( n i ) f ( i ) \huge f(n)=\sum\limits_{i=0}^{n}\dbinom{n}{i}g(i)\iff g(n)=\sum\limits_{i=0}^{n}(-1)^{n-i}\dbinom{n}{i}f(i) f ( n ) = i = 0 ∑ n ( i n ) g ( i ) ⟺ g ( n ) = i = 0 ∑ n ( − 1 ) n − i ( i n ) f ( i )
推理
f ( n ) = ∑ i = 0 n ( n i ) g ( i ) \Large f(n)=\sum\limits_{i=0}^{n}\dbinom{n}{i}g(i) f ( n ) = i = 0 ∑ n ( i n ) g ( i )
= ∑ i = 0 n ( n i ) ∑ j = 0 i ( − 1 ) i − j ( i j ) f ( j ) \Large = \sum\limits_{i=0}^{n}\dbinom{n}{i}\sum\limits_{j=0}^{i}(-1)^{i-j}\dbinom{i}{j}f(j) = i = 0 ∑ n ( i n ) j = 0 ∑ i ( − 1 ) i − j ( j i ) f ( j )
= ∑ j = 0 n f ( j ) ∑ i = j n ( n i ) ( i j ) ( − 1 ) i − j \Large = \sum\limits_{j=0}^{n}f(j)\sum\limits_{i=j}^{n}\dbinom{n}{i}\dbinom{i}{j}(-1)^{i-j} = j = 0 ∑ n f ( j ) i = j ∑ n ( i n ) ( j i ) ( − 1 ) i − j
= ∑ j = 0 n f ( j ) ∑ i = j n ( n j ) ( n − j i − j ) ( − 1 ) i − j \Large = \sum\limits_{j=0}^{n}f(j)\sum\limits_{i=j}{n}\dbinom{n}{j}\dbinom{n-j}{i-j}(-1)^{i-j} = j = 0 ∑ n f ( j ) i = j ∑ n ( j n ) ( i − j n − j ) ( − 1 ) i − j
= ∑ j = 0 n f ( j ) ( n j ) ∑ i = j n ( n − j i − j ) ( − 1 ) i − j \Large = \sum\limits_{j=0}^{n}f(j)\dbinom{n}{j}\sum\limits_{i=j}{n}\dbinom{n-j}{i-j}(-1)^{i-j} = j = 0 ∑ n f ( j ) ( j n ) i = j ∑ n ( i − j n − j ) ( − 1 ) i − j
= ∑ j = 0 n f ( j ) ( n j ) ∑ k = 0 n − j ( n − j k ) ( − 1 ) k \Large = \sum\limits_{j=0}^{n}f(j)\dbinom{n}{j}\sum\limits_{k=0}^{n-j}\dbinom{n-j}{k}(-1)^{k} = j = 0 ∑ n f ( j ) ( j n ) k = 0 ∑ n − j ( k n − j ) ( − 1 ) k
= ∑ j = 0 n f ( j ) ( n j ) [ n = = 0 ] \Large = \sum\limits_{j=0}^{n}f(j)\dbinom{n}{j}[n == 0] = j = 0 ∑ n f ( j ) ( j n ) [ n == 0 ] = 左边 。
p o s t e d o n A u g . 24 t h , 2022 posted\space on \space Aug. \space 24th,\space 2022 p os t e d o n A ug . 24 t h , 2022
T h a n k s t o L i Z X Thanks \space to \space LiZX \space T hank s t o L i Z X
@clamee
F r o m T h e F i r s t H i g h S c h o o l o f C h a n g s h a H u n a n From\space The \space First \space High \space School \space of \space Changsha \space Hunan F r o m T h e F i r s t H i g h S c h oo l o f C han g s ha H u nan
一元二次方程求根公式
原方程:
a x 2 + b x + c = 0 ( a ≠ 0 ) \large ax^{2}+bx+c=0\space\space\space\space(a\not=0) a x 2 + b x + c = 0 ( a = 0 )
解
x = − b ± b 2 − 4 a c 2 a \Large x=\huge\frac{-b\space\pm \space \sqrt{b^{2}-4ac\space}}{2a} x = 2 a − b ± b 2 − 4 a c
推理过程
a x 2 + b x + c = 0 \large ax^{2}+bx+c=0 a x 2 + b x + c = 0
a x 2 + b x = − c \large ax^{2}+bx=-c a x 2 + b x = − c
x 2 + b a x = − c a \large x^{2}+\dfrac{b}{a}x=-\dfrac{c}{a} x 2 + a b x = − a c
x 2 + b a x + ( b 2 a ) 2 = − c a + ( b 2 a ) 2 \large x^{2}+\dfrac{b}{a}x+\begin{pmatrix}\dfrac{b}{2a}\end{pmatrix}^{2}=-\dfrac{c}{a}+\begin{pmatrix}\dfrac{b}{2a}\end{pmatrix}^{2} x 2 + a b x + ( 2 a b ) 2 = − a c + ( 2 a b ) 2
( x + b 2 a ) 2 = b 2 − 4 a c 4 a 2 \large \begin{pmatrix}x+\dfrac{b}{2a}\end{pmatrix} ^{2}=\dfrac{b^{2}-4ac}{4a^{2}} ( x + 2 a b ) 2 = 4 a 2 b 2 − 4 a c
x + b 2 a = ± b 2 − 4 a c 4 a 2 \large x+\dfrac{b}{2a}=\pm\sqrt{\dfrac{b^{2}-4ac}{4a^{2}}\space} x + 2 a b = ± 4 a 2 b 2 − 4 a c
x = − b 2 a ± b 2 − 4 a c 2 a \large x=-\dfrac{b}{2a}\pm\dfrac{\sqrt{b^{2}-4ac\space}}{2a} x = − 2 a b ± 2 a b 2 − 4 a c
∴ x = − b ± b 2 − 4 a c 2 a \large \therefore x=\dfrac{-b\space\pm \space \sqrt{b^{2}-4ac\space}}{2a} ∴ x = 2 a − b ± b 2 − 4 a c
p o s t e d o n S e p t . 12 t h , 2022 posted\space on \space Sept. \space 12th,\space 2022 p os t e d o n S e pt . 12 t h , 2022
T h a n k s t o B a i d u Thanks \space to \space Baidu \space T hank s t o B ai d u
百度
F r o m C h i n a From\space China\space F r o m C hina
文件小快读(超快的哦)
C++ 复制 const int BUF = 80000000 ;
char Buf[80000000 ], * buf = Buf;
void read (int & x )
{
for (x = 0 ; ! std ::isdigit (* buf); ++ buf) ;
for (; std ::isdigit (* buf); x = (x << 1 ) + (x << 3 ) + (* buf ^ 48 ), ++ buf) ;
}
int main ()
{
freopen ("A.in" ,"r" ,stdin);
freopen ("A.out" ,"w" ,stdout);
fread (buf, 1 , BUF, stdin);
return 0 ;
}
p o s t e d o n S e p t . 24 t h , 2022 posted\space on \space Sept. \space 24th,\space 2022 p os t e d o n S e pt . 24 t h , 2022
T h a n k s t o s t d Thanks \space to \space std \space T hank s t o s t d
F r o m T h e F i r s t H i g h S c h o o l o f C h a n g s h a H u n a n From\space The \space First \space High \space School \space of \space Changsha \space Hunan F r o m T h e F i r s t H i g h S c h oo l o f C han g s ha H u nan
P y t h o n Python P y t h o n 除法
a / / = b \large a\space//=\space b \space a // = b 表示 a 整除 b(向下取整) 。
p o s t e d o n S e p t . 30 t h , 2022 posted\space on \space Sept. \space 30th,\space 2022 p os t e d o n S e pt . 30 t h , 2022
T h a n k s t o Thanks \space to T hank s t o @jijidawang & \space \And \space & @charleshe
F r o m C h i n a From\space China \space F r o m C hina 洛谷
乘法公式应用题
x 2 + y 2 + 2 x − 4 y + 5 = 0 x^2+y^2+2x-4y+5=0 x 2 + y 2 + 2 x − 4 y + 5 = 0
x + y = ? x+y=\space? x + y = ?
S o l u t i o n Solution S o l u t i o n
x 2 + y 2 + 2 x − 4 y + ( 1 + 4 ) = 0 \large x^2+y^2+2x-4y+(1+4)=0 x 2 + y 2 + 2 x − 4 y + ( 1 + 4 ) = 0
( x 2 + 2 x + 1 ) + ( y 2 − 4 y + 4 ) = 0 \large (x^2+2x+1)+(y^2-4y+4)=0 ( x 2 + 2 x + 1 ) + ( y 2 − 4 y + 4 ) = 0
( x + 1 ) 2 + ( y − 2 ) 2 = 0 \large (x+1)^2+(y-2)^2=0 ( x + 1 ) 2 + ( y − 2 ) 2 = 0
又 ∵ ( x + 1 ) 2 ≥ 0 , ( y − 2 ) 2 ≥ 0 \text又 \because (x+1)^2\ge0,\space(y-2)^2\ge0 又 ∵ ( x + 1 ) 2 ≥ 0 , ( y − 2 ) 2 ≥ 0
∴ ( x + 1 ) 2 = ( y − 2 ) 2 = 0 → x + 1 = y − 2 = 0 \therefore (x+1)^2=(y-2)^2=0 \space\rightarrow\space x+1=y-2=0 ∴ ( x + 1 ) 2 = ( y − 2 ) 2 = 0 → x + 1 = y − 2 = 0
∴ x = − 1 , y = 2 \therefore x=-1,\space y=2 ∴ x = − 1 , y = 2
∴ x + y = − 1 + 2 = 1 \therefore x+y=-1+2=1 ∴ x + y = − 1 + 2 = 1
p o s t e d o n O c t . 13 t h , 2022 posted\space on \space Oct. \space 13th,\space 2022 p os t e d o n O c t . 13 t h , 2022
T h a n k s t o Thanks \space to T hank s t o @lxy07830 & \space \And \space & @jijidawang & \space\And\space & @As_Nerve
F r o m C h i n a From\space China \space F r o m C hina 洛谷
l o g log l o g 函数
I n C + + , t h e r e a r e t w o f u n c t i o n s t h a t l o o k s i m i l a r b u t a r e In\space C++,\space there\space are \space two\space functions\space that\space look\space similar\space but \space are \space I n C + + , t h er e a r e tw o f u n c t i o n s t ha t l oo k s imi l a r b u t a r e
Q u i t e D i f f e r e n t . \large Quite \space Different. Q u i t e D i f f er e n t .
T h e y a r e l o g ( ) & l o g 2 ( ) . They \space are\space log() \And log2(). T h ey a r e l o g ( ) & l o g 2 ( ) .
l o g ( n ) r e p r e s e n t s log e n , o n t h e o t h e r h a n d , l o g 2 ( n ) = log 2 n . \large log(n) \space represents \space \log_en,\space on \space the\space other\space hand,\space log2(n)=\log_2n. l o g ( n ) r e p r ese n t s log e n , o n t h e o t h er han d , l o g 2 ( n ) = log 2 n .
p o s t e d o n O c t . 22 t h , 2022 posted\space on \space Oct. \space 22th,\space 2022 p os t e d o n O c t . 22 t h , 2022
T h a n k s t o Thanks \space to T hank s t o @lxy07830
F r o m C h i n a From\space China \space F r o m C hina 洛谷