\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 2022Thanks \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 2022Thanks \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 2022Thanks \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
posted\space on \space Sept. \space 24th,\space 2022Thanks \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=0x+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=1posted\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/)