摘要: 链接:https://www.luogu.org/problemnew/show/P3537 有n件物品,每件物品有三个属性a[i], b[i], c[i] (a[i]<b[i])。 再给出q个询问,每个询问由非负整数m, k, s组成,问是否能够选出某些物品使得: 对于每个选的物品i,满足a[i] 阅读全文
posted @ 2018-08-15 18:52 Ed_Sheeran 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 链接:https://www.luogu.org/problemnew/show/P4124 题目描述 人们选择手机号码时都希望号码好记、吉利。比如号码中含有几位相邻的相同数字、不含谐音不吉利的数字等。手机运营商在发行新号码时也会考虑这些因素,从号段中选取含有某些特征的号码单独出售。为了便于前期规划 阅读全文
posted @ 2018-08-15 18:44 Ed_Sheeran 阅读(355) 评论(0) 推荐(0) 编辑
摘要: 链接:https://www.luogu.org/problemnew/show/P4149 题目描述 给一棵树,每条边有权。求一条简单路径,权值和等于 KK ,且边的数量最小。 输入输出格式 输入格式: 第一行:两个整数 n,kn,k 。 第二至 nn 行:每行三个整数,表示一条无向边的两端和权值 阅读全文
posted @ 2018-08-15 18:41 Ed_Sheeran 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 题解: 第一题 #include<bits/stdc++.h> using namespace std; #define ll long long const int M = 1e5 + 10; ll a[M], b[M], ans; priority_queue <ll, vector<ll> , 阅读全文
posted @ 2018-08-15 18:35 Ed_Sheeran 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 题解: 第一题:nlogn LIS #include<bits/stdc++.h> using namespace std; const int M = 100005; int a[M], f[M]; int main(){ freopen("lis.in","r",stdin); freopen( 阅读全文
posted @ 2018-08-15 15:44 Ed_Sheeran 阅读(114) 评论(0) 推荐(0) 编辑