分类: 未分类

544 篇文章

P5143 攀爬者
Aimee 很水的题目 只是为了练练手 #include<iostream> #include<cstdio> #include<algorithm> #include<cmath> using namespace std; int n; struct b{ double x; double y; d…
P7043 「MCOI-03」村国
❤Aimee❤ 很有意思的题目 虽然说被我写的特别长 要做的事情就是先找到最大的点,然后找到与这个点相连的点中最大的那个 之后显然被选择的点只能在这两个中左右横跳。 有意思的是,这个写法并不需要特判n==1 #include<iostream> #include<cstdio> #include<cstring>…
P7042 「MCOI-03」正方
Aimee 很简单的一个小题 分类讨论啊 --scz #include<iostream> #include<algorithm> #include<cstdio> #define int long long using namespace std; int q; int len[5]; signed main(…
P2347 砝码称重
Aimee 一个很水的背包 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; int n; int dp[10001]; int num[10001]; int …
P1122 最大子树和
Aimee 很简单的树上dp 一维就够了 #include<iostream> #include<cstdio> #include<cstring> using namespace std; int n; int x,y; int zn[160001]; struct e{ int to; int ne; }ed…
P1610 鸿山洞的灯
Aimee 很简单的小dfs 额 其实是套着dfs壳的贪心 #include<iostream> #include<cstdio> #include<algorithm> using namespace std; int n,dis; int pl[100001]; int ans; void dfs(int n…
P5659 树上的数
Aimee 很恶心的一道题 我们在考场上会遇到很多题,无论多难,都要大声喊出:"无所谓"。 怎么无所谓,有所谓 --scz 10分做法 爆搜 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring&…
P1608 路径统计
Aimee 很水的题目 只要把P1144改一下 需要注意的是这个题有重边,求方案数的话一定要去重!! 这就涉及到很有趣的问题。 要想成为顶尖高手 就要做到滴水不漏 --橙汁哥 从这个题我才知道我写的堆优化Dijkstra复杂度有问题 TLE起飞 #include<iostream> #include<cstdio> #inc…
P1439 【模板】最长公共子序列
Aimee 这个题的数据范围$O(n^2)$ 过不去,但是这可是排列啊 求出一个数组中每一个元素在第二个中的位置,然后跑LIS ``cpp include include include include using namespace std; int p[100001]; int re[100001]; int n; int x; int Zni…