
HDU
RedPolya
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
hdu 5984
PockyProblem Description Let’s talking about something of eating a pocky. Here is a Decorer Pocky, with colorful decorative stripes in the coating, of length L. While the length of remaining pocky is原创 2016-11-30 18:44:21 · 1470 阅读 · 0 评论 -
map
hdu 4585题意 :有n个依次进入少林, 每次输出, 新进和尚和战斗等级与其最接近的旧和尚的ID,若相同差距则取小的。ID , 和 战斗等级都是唯一的。#include <bits/stdc++.h>using namespace std;int main(){ map<int,int> m; int n,id,power; while(scanf("%d",&n)原创 2016-11-28 16:43:10 · 309 阅读 · 0 评论 -
几道java题
前几天打ACM的时候意识到Java的重要性,于是趁着这几天没事,尝试转一下java,至少先学会用大数吧。hdu1002 javaimport java.math.BigInteger;import java.util.Scanner;public class Main{ public static void main(String [] arguments){ Scanne原创 2016-11-28 17:07:08 · 747 阅读 · 0 评论 -
NJFU比赛部分题解
先放上几题的不同解法。BIgnatius and the Princess IVTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32767 K (Java/Others) Total Submission(s): 28417 Accepted Submission(s): 12033Problem Descripti原创 2016-11-28 17:13:29 · 612 阅读 · 0 评论 -
hdu5973
Game of Taking Stones威佐夫博弈???w=5√+12∗zw=\frac{\sqrt5+1}{2}*z结论:若两堆物品的初始值为(x,y),且x(5√+1)2\frac{(\sqrt5+1)}{2}需要精确100位。import java.math.BigDecimal;import java.util.Scanner;public class Main { publi原创 2016-11-28 17:06:13 · 665 阅读 · 0 评论 -
hdu(2016’12)- 网络同步赛
1001真正的粉丝,不看题目都能A。#include <cstdio>#include <cstring>#include <iostream>using namespace std;int main(){ int T;char st[1111]; scanf("%d",&T); getchar(); while(T--){ gets(st);原创 2016-12-24 23:17:11 · 7883 阅读 · 1 评论 -
HDU 6011
Lotus and CharactersLotus has n kinds of characters,each kind of characters has a value and a amount.She wants to construct a string using some of these characters.Define the value of a string is:its f原创 2017-02-24 10:38:34 · 800 阅读 · 0 评论 -
hdu 6035 Colorful Tree
Colorful Tree题目题意 给定一颗树,再给定树上每一个节点一个颜色,求树上总共n(n-1)/2条路径每条路径上不同颜色数的总和。做法 首先,总和=总路径数∗颜色数−∑每一种颜色没参与的贡献总和=总路径数 * 颜色数 - \sum_{每一种颜色}^{}没参与的贡献.对于某一个id节点来说,算没参与贡献,可以通过求其最高同色子节点,以这些节点和其子树节点与id形成的路径必然会有重复id节点原创 2017-07-26 15:15:41 · 558 阅读 · 0 评论 -
hdu 6047 Maximum Sequence
http://acm.hdu.edu.cn/showproblem.php?pid=6047题意,给定一个数组{an}\{ a_n \}和一个数组{bn}\{b_n \},按照一定规则生成{a2n}\{a_{2n} \},规则是:ai≤max{aj−j|bk≤j<i}a_i \leq max\{a_j-j|b_k \leq j < i \},每一个bkb_k只能选择一次。例如样例: 4原创 2017-07-28 09:31:52 · 887 阅读 · 0 评论 -
Hdu 5890 Eighty seven
Hdu 5890 Eighty seven给些数字,可能去掉其中一些,检验能否算到87用bitsets做背包,细节处只处理i<=j<=k的情况 查询的时候排序一下就好了。#include<bits/stdc++.h>using namespace std;bitset<90>dp[11];int ans[60][60][60];int a[100],n,m;int q[5];int c原创 2016-11-28 16:41:50 · 431 阅读 · 0 评论 -
2016 Multi-University Training Contest 10
开始刷多校,今天第一弹。 话说,多校的题目真的好难。。。Median HDU 5857给定一个有序序列,然后给定两个区间[l1,r1],[l2,r2]产生新的序列。 要求新序列的中位数。 分三种情况考虑。 1.区间没交集。 2.区间半交。 3.区间全包裹。 各自找到自己的位置就好。#include <cstdio>#include <cstring>#include <iostre原创 2016-12-07 22:34:27 · 487 阅读 · 0 评论 -
HDU 1005
A number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are to calculate the value of f(n).N很大,有种方法找寻环节,毕竟循环节小于等于49个。我这里为了用下矩阵乘法的模板原创 2016-12-01 23:38:59 · 867 阅读 · 0 评论 -
HDU 1559
题意:给一个n*m的矩阵,找其中x*y的矩阵中的最大的。估计题目时限打错了,不应该是10s的。。。。那样裸体都过。处理前缀和数组sum[][]。 sum[i][j] = sum[i][j-1] + sum[i-1][j] - sum[i-1][j-1] + a[i][j]。然后n^2穷举。#include <cstdio>#include <cstring>#include <climits>原创 2016-12-02 00:00:48 · 457 阅读 · 0 评论 -
HDU 1518 Square
Square给一串数字,判断是否能凑成正方形的四个边。裸搜题,不过没有一遍AC。。。。直接上代码吧。#include <cstdio>#include <cstring>#include <algorithm>#include <iostream>using namespace std;int T,n,sum,len;int info[25];bool v[25],flag;int dfs原创 2016-12-02 11:07:54 · 309 阅读 · 0 评论 -
ACM hdu 数论题集
Volume 1 http://acm.hdu.edu.cn/showproblem.PHP?pid=1005 http://acm.hdu.edu.cn/showproblem.php?pid=1014 http://acm.hdu.edu.cn/showproblem.php?pid=1019Volume 2 http://acm.hdu.edu.cn/showproblem.php?p转载 2016-12-02 23:10:28 · 1183 阅读 · 0 评论 -
HDU 1239
简单数论题,给定m,a,b要求素数对< p,q >满足p*q<=m&&a/b<=p/q<=1。输出满足要求的积最大的。 暴力,打表。#include <iostream>#include <cstring>#include <cstdio>using namespace std;int prime[2005],num[10001],k;void printprime(){ for(原创 2016-12-02 23:35:57 · 808 阅读 · 0 评论 -
HDU 5752
水题,直接放代码。#include <cstdio>#include <cstring>#include <cmath>#define LL long long using namespace std;int main(){ char st[1111]; while(scanf("%s",st)!=EOF){ int len = strlen(st);原创 2016-12-03 00:00:54 · 538 阅读 · 0 评论 -
HDU 1251
字典树,map水过。#include <cstdio>#include <cstring>#include <map>#include <iostream>#include <algorithm>using namespace std;map<string,int> mp;char st[1000];int main(){ mp.clear(); while(gets(st原创 2016-12-07 10:14:38 · 400 阅读 · 0 评论 -
HDU 3972
求N以前孪生素数个数。 预处理素数表,10W以内大约1W个素数。 讲道理,暴力不太稳妥,于是写了个树状数组。 可是似乎暴力也能过。。。。#include <cstdio>#include <cstring>#include <cstdio>#include <iostream>using namespace std;const int MAXN=100001;bool prime[MA原创 2016-12-07 11:23:02 · 559 阅读 · 0 评论 -
hdu 6050 funny function
F1,1=F1,2=1F_{1,1} = F_{1,2} = 1 F1,i=F1,i−1+2F1,i−2|i>=3F_{1,i} = F_{1,i-1} + 2F_{1,i-2} | i>=3 Fi,j=∑j+N−1k=jFi−1,kF_{i,j} = \sum_{k=j}^{j+N-1}F_{i-1,k} 给定N,M,求Fm,1F_{m,1}首先昨天先写了几个,发现Fi,j=Fi,j−1+2原创 2017-07-28 14:28:12 · 1646 阅读 · 4 评论