上一页 1 2 3 4 5 6 7 8 9 ··· 12 下一页
摘要: double l = 0,r = 10000; while(r-l>=0.01){//精度问题 double m1 = l + (r-l)/3.0,m2 = r - (r-l)/3.0; if(f(m1)<f(m2)) l = m1; else r = m2; } 阅读全文
posted @ 2021-04-08 11:30 _LH2000 阅读(53) 评论(0) 推荐(0) 编辑
摘要: //小G定义了两个函数F(n)为n的约数和,G(n)为F(1)+F(2)+...+F(n-1)+F(n) ll G(ll x){ ll res=0; for(ll i=1;i<=x;) { ll r = x/(x/i); res += (x/i) * (r + i) * (r - i + 1) / 阅读全文
posted @ 2021-03-08 22:15 _LH2000 阅读(90) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<iomanip> #include<cstdio> #include<vector> #include<cmath> #include<string> #include<cstring> #include<algorithm> #include 阅读全文
posted @ 2021-02-20 19:06 _LH2000 阅读(68) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> #define fi first #define se second #define lo (o<<1) #define ro (o<<1|1) #define mid (l+r>>1) using namespace std; typedef lon 阅读全文
posted @ 2021-02-20 15:31 _LH2000 阅读(58) 评论(0) 推荐(0) 编辑
摘要: #include <functional> template <typename T> inline void hash_combine(std::size_t &seed, const T &val) { seed ^= std::hash<T>()(val) + 0x9e3779b9 + (se 阅读全文
posted @ 2021-02-16 17:28 _LH2000 阅读(51) 评论(0) 推荐(0) 编辑
摘要: 第一步 : 给出方程 ax + by = c 。 第二步 : 算出 辗转相除法 gcd(a, b) 。 第三步 : 运用 扩展欧几里德 ex_gcd(a, b)-》 ax + by = gcd(a,b) 的 一组解(x, y) 。 第三步: 根据 c % gcd(a, b) 判断是否 ax + by 阅读全文
posted @ 2021-02-04 11:44 _LH2000 阅读(433) 评论(0) 推荐(0) 编辑
摘要: int prime[1100000],primesize; bool isprime[11000000]; void getlist(int listsize){ memset(isprime,1,sizeof(isprime)); isprime[1]=false; for(int i=2;i<= 阅读全文
posted @ 2021-01-13 21:07 _LH2000 阅读(53) 评论(0) 推荐(0) 编辑
摘要: https://codeforces.ml/contest/1364/problem/D /* 给出一张 n 个点的无向连通图和一个常数 k。 你需要解决以下两个问题的任何一个: 1. 找出一个大小为 k/2 (向上取整)的独立集。 2. 找出一个大小不超过 k 的环。 独立集是一个点的集合,满足其 阅读全文
posted @ 2021-01-13 17:06 _LH2000 阅读(103) 评论(0) 推荐(0) 编辑
摘要: /* *1380E.Merging Towers *给出半径为1~n的n个盘子和m个塔,要求每个塔上盘子的半径始终从底向上递减 *一次操作可以将一个塔上的任意个盘子移动到另一个塔的顶部。 *令某一情形下的复杂度为将所有盘子移动到同一个塔上所需的最小操作数。 *题目给出m-1次询问,每次询问时输出当前 阅读全文
posted @ 2021-01-12 23:21 _LH2000 阅读(109) 评论(0) 推荐(1) 编辑
摘要: #include<bits/stdc++.h> using namespace std; typedef long long ll; vector<int >g[200005]; int du[200005]; int td[200005]; pair<int ,int >a[200005]; vo 阅读全文
posted @ 2021-01-12 16:32 _LH2000 阅读(106) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 12 下一页