随笔分类 - 做题报告(2023+)
发表于 2023-11-04 13:10阅读次数:11评论次数:0
摘要:P2347 NOIP1996 提高组 砝码称重 最初思路 看出来是多重背包,但是第一次用于求方案数,一开始想的是累加。但是实现起来发现结果很抽象,想想也不是那么回事。比如从样例上来说,F[3] = 1,F[2] = 1,F[1] = 1,显然F[3] != F[1] + F[2] 改进思路 然后受到
阅读全文 »
发表于 2023-11-03 12:25阅读次数:15评论次数:0
摘要:P1802 5 倍经验日 基本思路 还是零一板子,只是在枚举小于当前所需药水量时需要考虑输家的加分。 #include <iostream> #include <cstdio> #include <cstring> using namespace std; int n, x; int F[9000]
阅读全文 »
发表于 2023-11-03 10:58阅读次数:4评论次数:0
摘要:P1510 精卫填海 最初思路 状态方程F[i],i是体积,F[i]指能填平该体积的最小体力。 推出转移方程F[i] = min(F[i], F[i-v[i]] + m[i]) 但是代码实现只有10pts #include <iostream> #include <cstdio> #include
阅读全文 »
发表于 2023-11-03 10:06阅读次数:17评论次数:0
摘要:P1833 樱花(有疑惑) 最逆天的一集 一开始打算用最初的二维数组dp做,一直80tps,T一个点,WA一个点。 #include <iostream> #include <cstdio> #include <cstring> using namespace std; string a, b; i
阅读全文 »
发表于 2023-11-01 15:57阅读次数:6评论次数:0
摘要:P1853 投资的最大效益 思路 就是一道完全背包板子题,不过是要操作n次然后每次更新背包容量。 但是TLE一个点 #include<iostream> #include<algorithm> #include<cstdio> #include<cstring> using namespace st
阅读全文 »
发表于 2023-10-31 17:43阅读次数:8评论次数:0
摘要:P1825 Corn Maze S 无脑深搜,然后卡死在了37pts。 #include<iostream> #include<algorithm> #include<cstdio> using namespace std; struct coord { int x, y; }; int walk[
阅读全文 »
发表于 2023-10-30 09:43阅读次数:16评论次数:0
摘要:P1162 填涂颜色 大概思路,暴搜所有 点,搜到就填色,然后搜色块的时候一旦碰边就打标记,回溯之后看标记决定标 还是标 。 思路是理论可行,但是代码容易出问题。 一开始 的代码 #include<iostream> #include<algorithm> #
阅读全文 »
发表于 2023-10-29 11:14阅读次数:20评论次数:0
摘要:P2895 [USACO08FEB] Meteor Shower S 语言问题引发的惨案 题目本身不难,简单的BFS,但是写出来明明思路感觉没有问题,却不是答案错就是爆队列。 #include <iostream> #include <algorithm> #include <cstdio> #in
阅读全文 »
发表于 2023-10-26 16:11阅读次数:7评论次数:0
摘要:P1182 数列分段 Section II 再一次对位单杀18年的我 #include<cctype> #include<cstdio> #include<algorithm> using std::sort; int n,a[100010],QZ_sum[100
阅读全文 »
发表于 2023-10-23 17:22阅读次数:18评论次数:0
摘要:一开始贪心思路不对且根本没考虑重复,无脑sort后直接排组玄学了70pts。 #include <iostream> #include <algorithm> using namespace std; int n; int cnt, ans = 0x7fffffff; int a[100010];
阅读全文 »
发表于 2023-10-22 22:39阅读次数:12评论次数:0
摘要:P1106删数问题 对2018年的我一次完美的对位单杀 2018 44pts Code #include<cstdio> #include<iostream> #include<algorithm> using std::cin; using std::cout; using std::sort;
阅读全文 »
发表于 2023-10-10 12:42阅读次数:24评论次数:0
摘要:昨天晚上看了题目没思路。 早上上课回来之后想着就直接根据题目搞一个左脑一个右脑,然后两边分别加时间取最大暴搜,结果T了九个,这是代码。 #include <iostream> using namespace std; int tAns, ans; int s[5], array[30]; bool
阅读全文 »
发表于 2023-10-07 19:31阅读次数:4评论次数:0
摘要:对比例的计算在整形中的应用不熟练。 要算A:B = X : Y; 最好的方法不是 B = A * (Y/X); 而是 B = A * Y / X;
阅读全文 »
发表于 2023-10-07 18:06阅读次数:4评论次数:0
摘要:康复训练的第一道搜索 调了一个小时,这是原来的代码 #include <iostream> #include <cstring> using namespace std; int n; int ans[500][11], count; void dfs(int step, int sum) { if
阅读全文 »
发表于 2023-10-06 09:55阅读次数:13评论次数:0
摘要:做不出来根本原因在于对快速排序理解不彻底 快排代码 int randint(int l, int r){ // 生成在 [l, r] 之间的随机数 return rand() % (r - l + 1) + l; } void qsort(int l, int r){ // l 为左端点,r 为右端
阅读全文 »
发表于 2023-09-27 17:53阅读次数:33评论次数:0
摘要:P1591 阶乘数码 只能説對高精度的理解還不夠,除了打板子但凡變成高精乘單精就懵逼了。 摘了一篇題解的代碼來理解 #include <bits/stdc++.h> using namespace std; int c[100000]; int main() { int t,n,a; cin>>t;
阅读全文 »
发表于 2023-09-26 17:37阅读次数:6评论次数:0
摘要:其實確實就一道模擬題,一開始覺得是搜索,後面看了一段時間題目知道了模擬,就開始瘋狂模擬,代碼不斷地優化可讀性和邏輯,感覺很不錯,但是輸出一直是零。 這是當時代碼 #include<iostream> #include<algorithm> using namespace std; struct mo
阅读全文 »
发表于 2023-09-22 17:32阅读次数:14评论次数:0
摘要:P4924 [1007] 魔法少女小Scarlet 对模拟题摸不着头脑。 看题解之后的源码 本来想把变量塞进for循环结果莫名re #include<bits/stdc++.h> #include<iostream> #include<cstdio> #include<algorithm> #inc
阅读全文 »