
构造
构造
浪漫些许潦草
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
CodeForces - 848A From Y to Y(构造)
From Y to Y题目链接:From Y to Y题意: 对于字符串s和字符c,f(s,c)表示c在s中出现的次数,若将c合并到s中,则花费f(s,c)。要求一个字符串,使得合并后的最小花费恰好等于k思路: 可以发现,对于只有一个字符的字符串s,若它的长度为n,则花费为0+1+2+…+n-1因此我们依次添加不同的字符凑k即可代码:#include<stdio.h>int main() {原创 2017-09-04 20:54:56 · 465 阅读 · 0 评论 -
hdu 6150 Vertex Cover(构造)
Vertex Cover题目链接:Vertex Cover题解: 代码:#include<bits/stdc++.h> using namespace std;pair<int,int>p[250];int main() { int n=16,ed=16,tot=0; for(int i=1; i<=n; ++i) { for(int j=0; j<n/i;原创 2017-09-06 12:12:37 · 501 阅读 · 0 评论 -
hdu 5920 Ugly Problem(构造题)
Ugly ProblemProblem Description Everyone hates ugly problems.You are given a positive integer. You must represent that number by sum of palindromic numbers.A palindromic number is a positive integer s原创 2017-10-05 20:52:46 · 465 阅读 · 0 评论