原题链接 题解:注意建立边 代码: #include <iostream> #include <algorithm> #include <cstring> #include <cmath> using namespace std; const int N = 5e3 + 9; const int M ...
分类:
其他好文 时间:
2021-04-12 12:34:29
阅读次数:
0
1 #include<stdio.h> 2 int main() 3 { 4 float num; 5 int temp; 6 scanf("%f",&num); 7 temp=num*100+0.5; 8 num=(double)temp/100; 9 printf("%f",num); //不同 ...
分类:
其他好文 时间:
2021-04-12 12:28:11
阅读次数:
0
又是该LL用int了,什么时候才能不犯病啊。 A:水题,让你找出3个以上的数组中不同的那个数 我是直接分情况。 1 #include<iostream> 2 #include<vector> 3 using namespace std; 4 const int N=110; 5 int a[N]; ...
分类:
其他好文 时间:
2021-04-12 12:25:31
阅读次数:
0
补题链接:Here LCA 算法讲解:Here 考虑用 \(f[i][j]\) 表示从i往上走,能买珠宝的第 \(2^j\) 个点是哪个,显然,如果我们知道每个 $f[i][0]$的值, 那么 \(f[i][j]=f[f[i][j?1]][j?1]\) ( i 往上的第2 j?1 个点再往上 2j? ...
分类:
其他好文 时间:
2021-04-12 12:10:35
阅读次数:
0
很显然的区间dp 当我们卖掉一个物品时,可以看为给延后卖的商品都加价 $ dp [ i ] [ j ] $ 表示卖掉i~j的最大收益 #include<bits/stdc++.h> using namespace std; int n; int v[2021]; int dp[2021][2021] ...
分类:
其他好文 时间:
2021-04-12 12:03:32
阅读次数:
0
#include<iostream> #include<algorithm>//sort头文件 using namespace std; struct student{ int theta;//阈值 int result;//结果 }; bool compare(student a,student ...
分类:
编程语言 时间:
2021-04-12 11:39:49
阅读次数:
0
原文链接:https://www.cnblogs.com/lizhenghao126/p/11053598.html 函数声明 template< class RandomIt, class Compare > constexpr void sort( RandomIt first, RandomI ...
分类:
编程语言 时间:
2021-04-10 13:28:28
阅读次数:
0
按照key值升序输出: #include<iostream> using namespace std; #include<map> int main() { map<int,int>m; int n; cin >> n; while(n--) { int a = 0, b = 0; cin >> a ...
分类:
其他好文 时间:
2021-04-10 13:21:54
阅读次数:
0
最短Hamilton路径 给定一张 nn 个点的带权无向图,点从 0~n?10~n?1 标号,求起点 00 到终点 n?1n?1 的最短 Hamilton 路径。 Hamilton 路径的定义是从 0,0 到 n?1,n?1 不重不漏地经过每个点恰好一次。 输入格式 第一行输入整数 nn。 接下来 ...
分类:
其他好文 时间:
2021-04-10 13:21:09
阅读次数:
0
#include <bits/stdc++.h> using namespace std; template<class ElemType> struct BiNode { ElemType data; BiNode<ElemType> *lchild, *rchild; int disToLeft ...
分类:
其他好文 时间:
2021-04-10 13:18:26
阅读次数:
0