只有破碎的心,才有伤人的棱角
追踪最近的用户名外显变动记录。
最近的文章、讨论、云剪贴板与社区记录
在讨论《新年快乐!!!》回复:
接
在讨论《难崩》回复:
同感
# 1.杨辉三角的定义与构造 杨辉三角,又称帕斯卡三角,是一个无限对称的三角形数阵,其构造遵循以下规则: **1.边界条件:** 第$\ n\ $行($n \geq 0$,从0开始计数)有$\ n+1\ $个数,首位均为$\ 1$,即$\ C(n,0) = C(n,n) = 1$; **2.递推关系:** 中间第$\…
# B2076 球弹跳高度的计算 题解 ## 找规律 |弹跳次数|经过米数|高度| |:---:|:---:|:---:| |$1$|$h+\frac{h}{2}\cdot 2$|$\frac{h}{2^1}$| |$2$|$h+2\cdot(\frac{h}{2} + \frac{h}{4})$|$\frac{h}{…
```text 打表,指将题目中所要求的值自行算出,存到数组中, 输入后经过判断直接输出数组中的值,时间复杂度为O(1)。 方便快捷而又简单高效,是OI中的不二之选。 ——frank·chee(沃兹·基朔德) ```
#### 因式分解:$ax^2+bx+c$ ---- 已知 $ \begin{aligned} ax^2+bx+c &= (a_1x+c_1)(a_2x+c_2)\\ &= a_1a_2x^2+a_1c_2x+a_2c_1x+c_1c_2 \end{aligned} $ ---- $$ \therefore a=a_1…
**已知$\ $ $\varDelta ABC\ $三边边长分别为$\ a,b,c\ $,半周长为$\ s$。** **求证: $S_{\varDelta ABC}$ = $\sqrt{s(s-a)(s-b)(s-c)}。$** ---- ::::info[**前铺芝士**] :::info[1.平方差公式] $(a-…
# P1079 [NOIP 2012 提高组] Vigenère 密码 题解 ```cpp #include using namespace std; int main(){ string k,m; cin >> k >> m; for(int i = 0;i 0 ? m[i] - t : m[i] - t + 26;…
# [P1639 [USACO18FEB] Teleportation B](https://www.luogu.com.cn/problem/P1639) 题解 ~~贪心水过~~ 代码中的两个swap是为了保证$l #include #include using namespace std; int main(){…
# [P2814 家谱](https://www.luogu.com.cn/problem/P2814) 题解 比较有意思的并查集 ```cpp line-numbers #include //可以用map将自己和祖先联系在一起 并查集 using namespace std; #include map root; s…
# [P1551 亲戚](https://www.luogu.com.cn/problem/P1551) 题解 ~~一道很简单的并查集板子~~ 上代码 ```cpp line-numbers #include //并查集 using namespace std; const int N = 5010; int root…
# [[P1497 木牛流马]](https://www.luogu.com.cn/problem/P1497) 题解 ### 推导过程: ---- 当 $n = 4$,$h = 1$,$c = 1$时: |放置木牛流马的个数|情况数|可表示为| |:---:|:---:|:---:| |1|$4\times4$|$n…
# P1593 因子和 题解 结果可能是 # $\red{负数!}$ ~~因为这个我卡在94pts~~ ```cpp line-numbers lines=31-31 #include //快速幂 + 数学 using namespace std;//!!可能是负数!! #define int long long in…
# P1802 5 倍经验日 题解 一道$\blue{dp题}$,见代码 ```cpp line-numbers lines=12-15 #include using namespace std; const int N = 1110; int dp[N]; int n,x; int win[N],lose[N],us…
# P3375 【模板】KMP ~~可以去看一下课程~~ $\red{注意:本代码没有从1开始读入}$ >**Code:** >```cpp >#include >using namespace std; >const int maxn = 1e5+10; >int l1,l2,nxt[maxn],j = 0;//j…
# P1031 [NOIP 2002 提高组] 均分纸牌 题解 ```cpp #include using namespace std; #define int long long #define endl '\n' int a[110]; signed main(){ int n,cnt = 0,sum = 0; c…
# P1011 [NOIP 1998 提高组] 车站 题解 ~~...其实可以打表~~ $Code:$ ```cpp #include //由于我看不懂其他的题解 于是...模拟 using namespace std; int dp[25];//记录上车人数 int main(){ int a,n,m,x; cin…
B4410 [GESP202509 一级] 金字塔 题解 ---- **Code:** ```cpp #include #define int long long signed main(){ int n,ans = 0; std::cin >> n; for(int i = n;i >= 1;i--) ans +=…
P3984 高兴的津津 题解 ---- 上代码 ```cpp #include using namespace std; const int maxn = 2e6+10; int a[maxn]; int main(){ int n,t,Au = 0; cin >> n >> t; for(int i = 1;i >…
#B2079 求出 e 的值 题解 ---- **小数存储 + 循环结构** ```cpp #include using namespace std; int f(int n){//取n的阶乘 if(n == 1) return n; return n * f(n-1); } int main(){ int n; ci…
#P1149 [NOIP 2008 提高组] 火柴棒等式 题解 ---- $PS:暴力枚举会TLE+WA$ ```cpp #include using namespace std; const int num[] = {6,2,5,5,4,5,6,3,7,6};//下标数对应的火柴棒个数 int search(int…
# P1192 台阶问题 题解 ~~都在代码里~~ >$Ps:请不要复制粘贴QwQ$ ```cpp #include //知识涉及:同余 递归 记忆化搜索 #define mod 100003 int dp[1000010]; int f(int n,int k){ dp[1] = dp[0] = 1; for(int…
# P1464 Function 题解 **需要用到记忆化搜索** ```cpp #include //模拟 + 记忆化搜索 using namespace std; int dp[30][30][30]; long long w(long long a,long long b,long long c){ if(a 2…
$60分:$ ```cpp #include using namespace std; int a,b,c,t,m; int gcd(int a,int b){ return b ? gcd(b,a%b) : a; } void you(int d){ int p = -b+sqrt(d),w = -b-sqrt(d)…
~~有些难理解~~ ```cpp #include using namespace std;//疑似约瑟夫环 int n,ans1,ans2; int main(){ cin >> n; while(n){//n为0时退出 ans1++; if(!ans2 && n % 3 == 1) ans2 = ans1;//如果…
```cpp #include using namespace std; #define int long long signed main(){//唯一难点就是开long long int a,b,c; cin >> a >> b >> c; int A = a * a,B = b * c; if(A > B) co…
```cpp #include using namespace std; #define int long long const int maxn = 1e6+10; int a[maxn],b[maxn],ans = 0,mr = 0; signed main(){ int n; cin >> n; for(int…
```cpp #include using namespace std; const int maxn = 2e5+10; int a[maxn]; set s; inline int read(){//手写快读 char ch = getchar(); int s = 0,w = 1; while(ch '9'){…