![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
hdu
KEMNHan
希望工作955,管吃住,生活设施齐全,有零食,小姐姐多,写不出bug
展开
-
Tempter of the Bone hdu 1010 (奇偶剪枝)
Problem Description The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He re...原创 2019-10-28 21:05:25 · 113 阅读 · 0 评论 -
hdu5667 Sequence (矩阵快速幂+费马小定理)
Sequence Sample Input 1 5 3 3 3 233 Sample Output 190 题解: 根据递推式可以发现,答案是以a为底数的一个值,所以对指数部分做快速幂得到k,最后答案就是qpow(a,k)%mod 根据递推式易得构造矩阵 fn c 1 b fn-1 fn-1 = 1 0 0 * fn-2 1 0 0 1 ...原创 2019-09-10 19:26:18 · 131 阅读 · 0 评论 -
HDU 6659 Acesrc and Good Numbers
Problem Description Acesrc is a famous mathematician at Nanjing University second to none. Playing with interesting numbers is his favorite. Today, he finds a manuscript when cleaning his room, which...原创 2019-08-14 17:02:09 · 203 阅读 · 0 评论 -
HDU6050 Funny Function 矩阵快速幂
Funny Function Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1693Accepted Submission(s): 859 Problem Description FunctionFx,ysatisfie...原创 2019-08-02 10:07:57 · 99 阅读 · 0 评论 -
2019湘潭邀请赛 Build Tree
贪心模拟,边权越小越靠近根节点。 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int maxn=200010; ll s[maxn]; int k,m,n; ll p; int powermod(int x,int n) { int res=1; while(n...原创 2019-05-22 10:00:16 · 218 阅读 · 0 评论 -
hdu 1598( 枚举+并查集)
find the most comfortable road Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 9744 Accepted Submission(s): 4058 Problem Description XX...原创 2018-12-05 15:16:56 · 128 阅读 · 0 评论 -
HDU-2473 Junk-Mail Filter(并查集删除节点)
Problem Description Recognizing junk mails is a tough task. The method used here consists of two steps: 1) Extract the common characteristics from the incoming email. 2) Use a filter matchi...原创 2018-10-08 18:09:00 · 227 阅读 · 0 评论 -
2018hdu个人排位赛:Rank LED
LED灯数字变换要改变的笔画数目。。最烦这种题了。。一个个情况都要罗列一遍。。#include<bits/stdc++.h> using namespace std; int a[10] = { 6,2,5,5,4,5,6,3,7,6 }; int Cal( int x ) { if ( x%7==0 ) return x/7; else ...原创 2018-07-15 13:34:11 · 272 阅读 · 0 评论 -
2018hdu个人排位赛:Pot
水题。。。一开始以为emmmm每个只能被减一次。。样例放了一个看看就交了一发wa。。后来仔细看了下才知道不断相减直到所有数字都相同。。暴力循环几次就好了。。#include<bits/stdc++.h> using namespace std; //#define mem(a,b) memset(a,b,sizeof(a)) typedef long long ll; int a[10...原创 2018-07-15 13:28:52 · 159 阅读 · 0 评论 -
2018hdu个人排位赛:Team Match
给n个数,n%3==0,求如何组队能有最多队伍拿奖。。。算是暴力枚举吧。。#include<bits/stdc++.h> using namespace std; #define mem(a,b) memset(a,b,sizeof(a)) int n,m,a[35],vis[35]; bool check(int x) { int l = (n/3-x)*3 + 1,r =...原创 2018-07-15 13:24:40 · 243 阅读 · 0 评论 -
2018hdu个人排位赛:Team Name
生成一个不属于任何给出字符串的子集的字典序最小的字符串(dfs,字符串匹配)#include<bits/stdc++.h> using namespace std; char s[110][110],ans[110]; bool flag; int n; void dfs( int dep, int len ) { if ( dep==len ) { a...原创 2018-07-15 13:15:26 · 218 阅读 · 0 评论 -
2018hdu个人排位赛:Travel
给n个点,求出同等长度路径的最多条数。实际上题目求的就是,拿掉头尾(特判两个点的情况)求剩下的n-2个点分解成若干整数(可相同)的乘积最大和,快速幂求积(直觉。。。用pow应该会失精度而wa)#include<bits/stdc++.h> using namespace std; //#define mem(a,b) memset(a,b,sizeof(a)) typedef long...原创 2018-07-15 12:41:33 · 176 阅读 · 0 评论 -
2018hdu个人排位赛:Stadium
给四个数,看看能否构成梯形,能的话求出最小面积(好像给的数据直接就是能够成梯形的)#include<bits/stdc++.h> using namespace std; int t,a[4]; double m; double f(double a,double b,double c,double d) { double C=b-a; double x=(d*d+C*...原创 2018-07-15 12:36:10 · 187 阅读 · 0 评论 -
2018hdu个人排位赛:Balloons
题意很简单,对x和y方向排序各并查集一遍之后看下分了几块就是答案#include<bits/stdc++.h> using namespace std; int fa[10010]; struct node1 { int c,x; }data1[10010]; struct node2 { int c,y; }data2[10010]; bool cmpx(node1...原创 2018-07-15 12:33:22 · 225 阅读 · 0 评论 -
2018hdu个人排位赛:公孙玉龙
大致求的就是处理后的未被销毁的变量有多少同值会被回收 ,被调用会被回收;#include<bits/stdc++.h> using namespace std; map<string,string>mp1; map<string,int>mp2; int main() { int T; cin>>T; while ( T--...原创 2018-07-12 21:06:38 · 360 阅读 · 0 评论 -
2018hdu个人排位赛:米波
将每秒消亡的和生成的单独存数组,每一次都取模操作保证不爆int模拟1到t秒内的所有情况#include<bits/stdc++.h> using namespace std; const int mod = 1e9+7; int a[210],b[210]; inline void init() { memset ( a, 0, sizeof(a) ); memset ...原创 2018-07-12 20:58:29 · 192 阅读 · 0 评论 -
2018hdu个人排位赛:涮羊肉
题目意思很简单,羊肉需要x+y秒才能好,每次只能捞一片,之后需要至少m s后才能继续捞,其最多能捞几次dp做:#include<bits/stdc++.h> using namespace std; bool ok[3010]; int dp[3010]; inline void init() { memset ( ok, false, sizeof(ok) ); me...原创 2018-07-12 20:22:13 · 375 阅读 · 0 评论 -
2018hdu个人排位赛:洗衣服
一开始看到题目就想到了loj上的 #6035. 「雅礼集训 2017 Day4」洗衣服这题相对来说就简单多了题目要求没有上题的要求多,同样是优先队列做;#include<bits/stdc++.h> using namespace std; int main() { int T ; cin>>T; while ( T-- ) { ...原创 2018-07-12 19:54:13 · 289 阅读 · 0 评论