HDU
文章平均质量分 50
菜鸡的博客
这个作者很懒,什么都没留下…
展开
-
hdu 2069 Coin Change
Problem DescriptionSuppose there are 5 types of coins: 50-cent, 25-cent, 10-cent, 5-cent, and 1-cent. We want to make changes with these coins for a given amount of money.For example, if we have 11 cents, then we can make changes with one 10-cent coin an原创 2021-05-24 15:07:18 · 126 阅读 · 0 评论 -
hdu 4911 Inversion
Problem Descriptionbobo has a sequence a1,a2,…,an. He is allowed to swap two adjacent numbers for no more than k times.Find the minimum number of inversions after his swaps.Note: The number of inversions is the number of pair (i,j) where 1≤i<j≤n and原创 2021-05-23 20:21:07 · 85 阅读 · 0 评论 -
poj 3468 A Simple Problem with Integers(线段树)
DescriptionYou have N integers, A1, A2, … , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is to ask for the sum of numbers in a given interval.InputThe原创 2021-05-23 15:07:53 · 83 阅读 · 0 评论 -
HDU 1710 Binary Tree Traversals
Online Judge Online Exercise Online Teaching Online Contests Exercise AuthorF.A.QHand In HandOnline AcmersForum | DiscussStatistical ChartsProblem ArchiveRealtime Judge StatusAuthors Ranklist C/C++/Java Exams ACM StepsGo to JobContest Live原创 2021-05-22 17:11:28 · 68 阅读 · 0 评论 -
hdu 1856 More is better
Problem DescriptionMr Wang wants some boys to help him with a project. Because the project is rather complex, the more boys come, the better it will be. Of course there are certain requirements.Mr Wang selected a room big enough to hold the boys. The boy原创 2021-05-20 18:12:52 · 61 阅读 · 0 评论 -
hdu 1272 小希的迷宫
题目有图片就直接给链接了注意:并不是所有的节点都在迷宫中出现了,我们只需要保证出现的节点构成了一个并查集就可以了。判断是否有环的标志:每次给出的边(a–b)一点不是同一个父亲,否则则构成了环。#include<bits/stdc++.h>using namespace std;const int maxn = 100007;int Max;int fa[maxn];bool v[maxn];// int find(int x)// {// if(x==fa[x])/原创 2021-05-20 17:54:32 · 47 阅读 · 0 评论 -
hdu 2222 Keywords Search
Online Judge Online Exercise Online Teaching Online Contests Exercise AuthorF.A.QHand In HandOnline AcmersForum | DiscussStatistical ChartsProblem ArchiveRealtime Judge StatusAuthors Ranklist C/C++/Java Exams ACM StepsGo to JobContest Live原创 2021-05-18 10:56:21 · 121 阅读 · 0 评论 -
hdu 1711 Number Sequence
Problem DescriptionGiven two sequences of numbers : a[1], a[2], … , a[N], and b[1], b[2], … , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a number K which make a[K] = b[1], a[K + 1] = b[2], … , a[K + M - 1] = b[M]. If there原创 2021-05-16 10:04:56 · 47 阅读 · 0 评论 -
hdu 1385 Minimum Transport Cost
#include<stdio.h>#include<iostream>#include<string.h>#include <algorithm>#define INF 100000005using namespace std;int g[105][105], wi[105];//wi点权int path[105][105];//路径,记录当前i到j的最短路的第一个节点int n; void floyd(){ for(int k = 1原创 2021-05-08 20:17:13 · 62 阅读 · 0 评论 -
2544 hdu 最短路
Problem Description在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗?Input输入包括多组数据。每组数据第一行是两个整数N、M(N<=100,M<=10000),N表示成都的大街上有几个路口,标号为1的路口是商店所在地,标号为N的路口是赛场所在地,M则表示在成都有几条路。N=M=0表示输入结束。接下来M行,每行包括原创 2021-05-08 10:09:18 · 71 阅读 · 0 评论 -
hdu 1269 迷宫城堡
Problem Description为了训练小希的方向感,Gardon建立了一座大城堡,里面有N个房间(N<=10000)和M条通道(M<=100000),每个通道都是单向的,就是说若称某通道连通了A房间和B房间,只说明可以通过这个通道由A房间到达B房间,但并不说明通过它可以由B房间到达A房间。Gardon需要请你写个程序确认一下是否任意两个房间都是相互连通的,即:对于任意的i和j,至少存在一条路径可以从房间i到房间j,也存在一条路径可以从房间j到房间i。Input输入包含多组数据,输入原创 2021-05-08 09:13:37 · 82 阅读 · 0 评论 -
HDU 1878 欧拉回路
Online Judge Online Exercise Online Teaching Online Contests Exercise AuthorF.A.QHand In HandOnline AcmersForum | DiscussStatistical ChartsProblem ArchiveRealtime Judge StatusAuthors Ranklist C/C++/Java Exams ACM StepsGo to JobContest Live原创 2021-05-06 21:24:35 · 91 阅读 · 0 评论 -
hdu 3342 Legal or Not
Problem DescriptionACM-DIY is a large QQ group where many excellent acmers get together. It is so harmonious that just like a big family. Every day,many “holy cows” like HH, hh, AC, ZT, lcc, BF, Qinz and so on chat on-line to exchange their ideas. When so原创 2021-05-06 20:32:40 · 52 阅读 · 0 评论 -
hdu 1285 确定比赛名次
Online Judge Online Exercise Online Teaching Online Contests Exercise AuthorF.A.QHand In HandOnline AcmersForum | DiscussStatistical ChartsProblem ArchiveRealtime Judge StatusAuthors Ranklist C/C++/Java Exams ACM StepsGo to JobContest Live原创 2021-05-06 20:16:20 · 137 阅读 · 0 评论 -
HDU 1276
注意:1:每次报数要报到完,人数不超过3人是小于等于3人时,不再进行二次报数。2:list中删除一个元素,返回的是下一个位置的迭代器。#include<iostream>#include<stdio.h>#include<list>using namespace std;int main(){ //freopen("11.txt","r",stdin); int n; cin>>n; while(n--) {原创 2021-05-02 11:30:39 · 64 阅读 · 0 评论 -
hdu 4841 圆桌问题
约瑟夫环问题#include<iostream>#include<vector>using namespace std;int main(){// freopen("11.txt","r",stdin); int n,m; vector<int> vi; while(cin>>n>>m) { vi.clear(); for(int i=0;i<2*n;i++)vi.push_back(i); int ind原创 2021-05-02 11:06:11 · 67 阅读 · 0 评论 -
Hdu 6937 yiding Number
题意:一个正整数满足以下两个条件被称为yiding number1: 1是yiding number2: 如果n是yiding number数,那么 5n+13, 13n+5, 5n−13, 13n−5 也是yiding number#include<iostream>#include<stdio.h>#include<queue>#include<map>using namespace std;typedef long long ll原创 2021-05-02 10:55:20 · 124 阅读 · 0 评论