日常学习(正在更新中)

· · 个人记录

例题 :\sqrt{4+2\sqrt{3}\space}

解 :

原式 = \sqrt{(1^2+(\sqrt{3\space})^2)+2\sqrt{3\space}\space}

= \sqrt{1^2+(\sqrt{3\space})^2+2\sqrt{3\space}\space}

又 \large\because (a^2+b^2)=(a^2+b^2+2ab)

\large \therefore\ Original\space formula=\sqrt{(1+\sqrt{3\space})^2\space} \large =1+\sqrt{3\space} posted\space on \space Aug. \space 18th,\space 2022 Thanks \space to \space WangHX \space

@违规用户名T3Zr6OE%

From\space Qingzhuhu-xiangyi \space Foreign \space Languages \space School \space Changsha

快速高质量实用乘法(取模)

#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;
}
posted\space on \space Aug. \space 19th,\space 2022 Thanks \space to \space LeiRQ \space

@lrq090403

From\space YZYL

JSOI2015 夏令营提高组实战 Day5 T1

题面 :

解析

知道你看不懂,我也没看懂 。

反正就是什么 lg (log10) x 和 x 的位数 有亿点点关系 。

代码也是需要自己理解的 。

#include<bits/stdc++.h>
using namespace std;

int n;

int l, r, mid;                                                  // 二分必备 

int main()
{
    scanf("%d", &n);

    l = 0, r = 2e9 + 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 差不多,自己百度 
*/ 
posted\space on \space Aug. \space 21th,\space 2022 Thanks \space to \space LiZX \space

@clamee

From\space The \space First \space High \space School \space of \space Changsha \space Hunan $From\space Qingzhuhu-xiangyi \space Foreign \space Languages \space School \space Changsha

新知识:114514 \space \And 1919810

114514和1919810到底是在什么地方出现呢?有些了解的网友进行了解答!回答如下:“其实这个梗出自被日本网友一直恶搞的钙片真夏夜淫梦第四章昏睡!野獣先辈,最后野兽先辈(本名田所)高潮的时候,最后发出的声音,日文原本翻译成中文是“好,好吧!”,发音是:逸逸有可以有,结果这里的发音特别像日文中数字“114514”的读法,因此就出现了“114514”的弹幕。”。

(来自 百度)

posted\space on \space Aug. \space 22th,\space 2022 \large Thanks \space to \space LeiRQ \space

@lrq090403

他推荐的视频:U240871 thing_of_thing

From\space YZYL

二项式定理反演

注记:\dbinom{n}{m} = \Large C_n^m

结论

\Large \sum\limits_{i=1}^{n}\ \dbinom{n}{i} (-1)^{n-i}=[n == 0] \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)

推理

\Large f(n)=\sum\limits_{i=0}^{n}\dbinom{n}{i}g(i) \Large = \sum\limits_{i=0}^{n}\dbinom{n}{i}\sum\limits_{j=0}^{i}(-1)^{i-j}\dbinom{i}{j}f(j) \Large = \sum\limits_{j=0}^{n}f(j)\sum\limits_{i=j}^{n}\dbinom{n}{i}\dbinom{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} \Large = \sum\limits_{j=0}^{n}f(j)\dbinom{n}{j}\sum\limits_{i=j}{n}\dbinom{n-j}{i-j}(-1)^{i-j} \Large = \sum\limits_{j=0}^{n}f(j)\dbinom{n}{j}\sum\limits_{k=0}^{n-j}\dbinom{n-j}{k}(-1)^{k} $posted\space on \space Aug. \space 24th,\space 2022 Thanks \space to \space LiZX \space

@clamee

From\space The \space First \space High \space School \space of \space Changsha \space Hunan

一元二次方程求根公式

原方程:

\large ax^{2}+bx+c=0\space\space\space\space(a\not=0)

解

\Large x=\huge\frac{-b\space\pm \space \sqrt{b^{2}-4ac\space}}{2a}

推理过程

\large ax^{2}+bx+c=0 \large ax^{2}+bx=-c \large x^{2}+\dfrac{b}{a}x=-\dfrac{c}{a} \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} \large \begin{pmatrix}x+\dfrac{b}{2a}\end{pmatrix} ^{2}=\dfrac{b^{2}-4ac}{4a^{2}} \large x+\dfrac{b}{2a}=\pm\sqrt{\dfrac{b^{2}-4ac}{4a^{2}}\space} \large x=-\dfrac{b}{2a}\pm\dfrac{\sqrt{b^{2}-4ac\space}}{2a} \large \therefore x=\dfrac{-b\space\pm \space \sqrt{b^{2}-4ac\space}}{2a} posted\space on \space Sept. \space 12th,\space 2022 Thanks \space to \space Baidu \space

百度

From\space China\space

文件小快读(超快的哦)

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;
}
posted\space on \space Sept. \space 24th,\space 2022 Thanks \space to \space std \space From\space The \space First \space High \space School \space of \space Changsha \space Hunan

Python 除法

$posted\space on \space Sept. \space 30th,\space 2022 $From\space China \space$ [洛谷](https://www.luogu.com.cn/) # 乘法公式应用题 $x^2+y^2+2x-4y+5=0 x+y=\space?

Solution

\large x^2+y^2+2x-4y+(1+4)=0 \large (x^2+2x+1)+(y^2-4y+4)=0 \large (x+1)^2+(y-2)^2=0 \text又 \because (x+1)^2\ge0,\space(y-2)^2\ge0 \therefore (x+1)^2=(y-2)^2=0 \space\rightarrow\space x+1=y-2=0 \therefore x=-1,\space y=2 \therefore x+y=-1+2=1 posted\space on \space Oct. \space 13th,\space 2022 $From\space China \space$ [洛谷](https://www.luogu.com.cn/) # $log$ 函数 $In\space C++,\space there\space are \space two\space functions\space that\space look\space similar\space but \space are \space \large Quite \space Different. They \space are\space log() \And log2(). \large log(n) \space represents \space \log_en,\space on \space the\space other\space hand,\space log2(n)=\log_2n. posted\space on \space Oct. \space 22th,\space 2022 $From\space China \space$ [洛谷](https://www.luogu.com.cn/)