ICode9

精准搜索请尝试: 精确搜索
  • HDU-1062-Text Reverse(栈)2021-08-07 12:58:15

    题目 Problem Description Ignatius likes to write words in reverse way. Given a single line of text which is written by Ignatius, you should reverse all the words and then output them. Input The input contains several test cases. The first line of the inp

  • 【鸽巢原理】Halloween treats HDU - 18082021-08-06 15:33:48

    题目 链接:https://acm.hdu.edu.cn/showproblem.php?pid=1808 very year there is the same problem at Halloween: Each neighbour is only willing to give a certain total number of sweets on that day, no matter how many children call on him, so it may happen that a c

  • hdu 10782021-08-06 14:31:41

    题目   :Problem - 1078 (hdu.edu.cn) #include<bits/stdc++.h> using namespace std; int n,k,a[110][110],ans[110][110]; int dir[4][2]={{0,1},{0,-1},{1,0},{-1,0}}; bool ok(int x,int y){ if(x<0||x>=n||y<0||y>=n){ return false; } return true

  • HDU 6981 Rise in Price (模拟)2021-08-06 13:05:19

            题目:Problem - 6981 (dingbacode.com)         题目意思是给出两个n*n的方阵,分别存每个格子的钻石个数和增加的单价,从(1,1)走到(n,n)最后得到了钻石总价是多少,每次只能向右或向下走。         这题容易想成dp,但是钻石个数和单价对答案贡献的性质不同,很难在同一

  • 【HDU 1505】City Game 悬线DP2021-08-05 20:32:59

    传送门 题意 给出一个矩阵,上面是可以用的土地和不能用的土地,要在上面选一块矩形的土地建房子,问最大能选多大的土地,土地每单位3块大洋,最后输出租金 分析 这道题跟杭电多校的第一场一样,都是转换成模型然后用悬线法进行求解即可 我们可以把 i

  • Period [HDU 1358]2021-08-05 12:32:56

    题目: For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. That is, for each i (2 <= i <= N) we want to know the largest K >

  • HDU 1187 Big Event in HDU2021-08-04 15:05:07

    题意:有n个物品,希望尽可能均分 尽可能均分,就是找尽可能接近sum/2的方案 考虑生成函数 \(G(x)=(1+x^{v[i]}+x^{2v[i]}+...+x^{a[i]v[i]})(...\) #include<bits/stdc++.h> using namespace std; int rd(){ int ret=0, f=1;char c; while(c=getchar(),!isdigit(c))f=c=='-'?-1

  • HDU - 2196 - Computer( 树形dp )2021-08-04 10:33:49

    题目链接:点击进入 题目 题意 对树上的每个点,求出离这个点最远的点的距离是多少 思路 对于一个节点,最远距离可能在该节点的子树方向上,也可能在该节点的父节点方向上,两次dfs,第一次求出该节点子树方向上最长距离,第二次求父节点方向上的最长距离,两次取最大值就是这个点的最大距

  • HDU 6514 前缀和2021-08-03 10:59:56

    题解 传送门 HDU 6514 Monitor 题解 对每个监视器所覆盖的矩形区域进行二维差分,取前缀和所得到的 s u m i

  • 2021 年百度之星·程序设计大赛 - 初赛二 hdu 7004 签到2021-08-02 20:34:50

    给 a,b ,每次 a,b 会变为 a+b,a−b ,问 k 次之后变成了哪两个数,对 998244353 取模,多组数据。 Input 第一行一个正整数 T(1≤T≤100000) ,代表测试组数。 接下来 T 行每行三个数 a,b,k(0≤a,b<998244353,0≤k≤109) 。 Output T 行每行两个整数,代表每一组数据 a,b 最后变成了什么

  • HDU 5590学习别人的写法2021-08-02 11:00:48

    一开始使用了%c输入,导致回车也输了进去,需要用getchar先把缓冲区中的回车读完才能正常输入 一开始的写法 #include<stdio.h> #include<iostream> #include<algorithm> #define MAXN_ROW 100 #define MAXN_COL 100 using namespace std; int t; int n; char strDNA[101]; char

  • HDU----1242(BFS)2021-08-02 10:30:25

    题目链接 Rescue 代码如下 #include<bits/stdc++.h> using namespace std; const int M = 205; int dx[] = {1,0,0,-1}; int dy[] = {0,1,-1,0}; int n,m; int vis[M][M];char mp[M][M]; struct dot { int x,y,time; }; bool in(dot gx) { if(gx.x>=0&&gx.x<n&a

  • [hdu] P5769 Substring2021-08-01 23:29:37

    题意:求一个字符串包含某一个特定字符的互不相同的子串个数。 思考过程: 1.如果是求一个字符串所有互不相同的子串个数,这是容易的。因为只需要遍历这个字符串所有后缀,依次计算这个后缀对答案的贡献即可。 遍历所有后缀并且逐个计算贡献是后缀数组解决字符串计数问题的关键。 2.

  • hdu 11502021-08-01 15:57:36

    题目 :Problem - 1150 (hdu.edu.cn) #include<bits/stdc++.h> using namespace std; #define MXN 110 int n,m,g[MXN][MXN],linker[MXN]; bool used[MXN]; bool dfs(int a){ for(int i=0;i<m;i++){ if(g[a][i]==1&&used[i]!=1){ used[i]=true; if(lin

  • HDU - 1078 FatMouse and Cheese2021-08-01 15:02:35

    FatMouse and Cheese HDU - 1078 AYIT-2021 609暑假集训第一周下 记忆化搜索和背包 FatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is labelled (p,q) where 0 <= p < n and 0 <= q < n. At

  • 非常可乐 HDU - 14952021-08-01 13:04:17

    非常可乐 大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S<101)毫升 (

  • HDU 6988 Display Substring 后缀自动机,二分套二分2021-08-01 12:29:37

    文章目录 题意题解 接上次FFT之后,我们又遇到了一道后缀自动机题. 题意 给出一个字符串和 26 26 26个字母的花费,求总花费第 k

  • HDU - 6948 Substring2021-08-01 11:34:30

    Substring hdu-6948 Problem Description You are given a string S[1…N] containing only lowercase letters. Now you need to find the longest substring S[l…r] such that every letter (a to z) appears no more than K times in the substring. You just need to ou

  • STL应用 map HDU 12632021-08-01 11:02:28

    map 是一个将独一无二的键值与数值对应的数据结构,方便查找。 c++ stl中的map实现是树结构,所以存储的键值是有次序的排列。 还有另一种键值与数值对应的数据结构 unordered_map,使用的是哈希表,查找效率更高,但是存储的键值是无序排列。 关联介绍 https://www.cnblogs.com/itdef/p/15

  • STL应用 set hdu 14122021-08-01 09:32:44

    set 是一个使用红黑树存储键值的结构体,存储内容没有重复,如果多次插入重复的内容,只存储一次 常用的函数有 size() empty() clear() begin() end() erase(x) erase(*it) find() count() lower_bound() 返回大于等于指定值的元素位置 upper_bound() 返回大于指定值的元素位置 这

  • hdu 6952 / 2021“MINIEYE杯”中国大学生算法设计超级联赛(1) Puzzle loop (高斯消元解异或方程组)2021-07-31 21:03:26

    https://acm.hdu.edu.cn/showproblem.php?pid=6952   题意: n条横线m条竖线构成(n-1)*(m-1)的网格图,现在要求在图上沿线画若干个不相交圈,圈与圈之间可以共享点但不能共享线。 某些格子上有一个数0或者1,1表示这个格子周围4条线有奇数条属于画的圈,0表示偶数条。   难点在于如何转化

  • STL应用 map HDU 35272021-07-31 11:02:57

    HDU 3527 https://vjudge.net/problem/HDU-3527 继续上一题 这题还可以使用map解答 map 是一个将独一无二的键值与数值对应的数据结构,方便查找。 c++ stl中的map实现是树结构,所以存储的键值是有次序的排列。 还有另一种键值与数值对应的数据结构 unordered_map,使用的是哈希表,查

  • 水仙花数 HDU - 20102021-07-31 09:04:34

    水仙花数  HDU - 2010  春天是鲜花的季节,水仙花就是其中最迷人的代表,数学上有个水仙花数,他是这样定义的: “水仙花数”是指一个三位数,它的各位数字的立方和等于其本身,比如:153=1^3+5^3+3^3。 现在要求输出所有在m和n范围内的水仙花数。 Input 输入数据有多组,每组占一行,包括两个

  • 剪花布条 HDU - 2087(KPM字符串匹配问题)2021-07-31 09:01:36

    剪花布条  HDU - 2087 一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢? Input 输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有

  • 杭电多校2019 HDU 6581 Vacation2021-07-31 09:00:13

    传送门 题目 Tom and Jerry are going on a vacation. They are now driving on a one-way road and several cars are in front of them. To be more specific, there are n cars in front of them. The ith car has a length of li, the head of it is si from the stop-line, a

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有