- 博客(6)
- 收藏
- 关注
原创 UTPC Contest 02-11-22 Div. 2 F. Summit Sunset
如果使用bfs则需要注意每个点都可能被重复更新 #include <iostream> #include <algorithm> #include <stdio.h> #include <math.h> #include <cstdio> #include <iomanip> #include <string> #include <cstring> #include <queue> #include
2022-02-20 21:49:07
684
原创 #762 (Div. 3)D. New Year‘s Problem
这题是标准的求最大的最小值的题,要求我们求n-1个商店礼物的最小值,可以换一个思路即求对于某一个礼物最小值,是否存在n-1个商店满足,这样问题就从一个抽象的东西变成具体的能成立问题,如果这里答案能够成立的话可以用二分来继续搜索,直到搜到最大的那个值,即是我们的答案 #include <iostream> #include <algorithm> #include <stdio.h> #include <math.h> #include <cstdio&g
2021-12-21 17:37:51
540
原创 F1 - Korney Korneevich and XOR (easy version)(暴力+简单DP)
F1 - Korney Korneevich and XOR (easy version)(暴力+简单DP) a[i]最大是500所以异或和会小于512,可以暴力搜索所有可以得到的异或结果查看是否存在,又子序列必须是递增的所以我们可以用得到对应异或和的序列的最后一位元素进行更新下一位可以得到的异或元素 #include <iostream> #include <algorithm> #include <stdio.h> #include <math.h> #i
2021-10-25 19:34:20
511
原创 hdu2059
hdu2059 #include #include #include <stdio.h> #include <math.h> typedef long long ll; using namespace std; int main() { int t,n; double costt1, costt2, costt3, M, d, temp1, min, c, vr, vt1, vt2, l, a[110], dp[110] = {0}; while (cin >> l)
2021-08-06 20:21:11
173
原创 2021黑龙江省赛F-function
用欧拉线性筛的性质来求最小质数进而求得所求得函数 #include <iostream> #include <algorithm> #include <stdio.h> #include <math.h> #include <cstdio> #include <iomanip> #include <stack> #include <string> #include <cstring> #includ.
2021-08-06 11:12:17
529
原创 2021 ICPC新疆省赛 J - do NOT a=2b (动态规划值域DP)
法一: 因为值域只有1e6,所以只对值域做一个DP即可。 然后对于所有i*2>1e6的数字计算答案即可。 法二: 也可以先预处理出每一条链,然后对链做DP 下图是法一的方法 #include <iostream> const int inf = 0x3f3f3f3f; typedef long long ll; typedef unsigned long long ull; typedef int itn; const long double PI = acos(-1); using na
2021-08-01 16:19:50
568
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人