
杂题
文章平均质量分 53
Neutralzz
这个作者很懒,什么都没留下…
展开
-
Hdu 5319 Painter (模拟)
直接贪心去模拟就完,最坑的是那不是n*n的矩阵,m没告诉你,自己求。[code]:#include#include#include#include#includeusing namespace std;int n,m,a[55][55];char s[55][55];int dx[4] = {0,1,1,1};int dy[4] = {0,1,-1,1};void原创 2016-07-10 20:14:37 · 364 阅读 · 0 评论 -
HDU 5302 Connect the Graph (构造)
原题解链接:http://www.cnblogs.com/shjwudp/p/4719279.html[code]:#include#include#include#includeusing namespace std;typedef pair P;int w[3],b[3],n;vector G[2];void init(){ G[0].clear();转载 2016-07-09 09:20:24 · 242 阅读 · 0 评论 -
HDU 5301 Buildings (乱搞)
解析:首先使得矩阵的n[code]:include#include#include#include#includeusing namespace std;int n,m,x,y;int main(){ int i,j,cas,u,v; while(~scanf("%d%d%d%d",&n,&m,&x,&y)){ if(n > m){原创 2016-07-09 09:14:58 · 250 阅读 · 0 评论 -
HDU 5289 Assignment (尺取+Set)
题意:n个数字中取出连续的一组数字使得任意两个差小于k,求方案数。解析:two points,用multiset维护一下区间差值即可。[code]:#include#include#includeusing namespace std;typedef long long LL;const int maxn = 1e5+5;int n,m;LL a[maxn];mul原创 2016-07-06 08:32:27 · 268 阅读 · 0 评论 -
Hdu 5351 MZL's Border (找规律+Java高精度)
解析:找到最大的i是|fib_i| [code]:import java.util.*;import java.math.*;import java.io.*;public class Main{ static BigInteger m,f[] = new BigInteger[1001],mod = BigInteger.valueOf(258280327); static原创 2016-07-13 21:09:23 · 290 阅读 · 0 评论 -
Hdu 5349 MZL's simple problem (水题)
解析:用一个multiset维护一下就好。[code]:#include#include#include#include#include#include#include#include#includeusing namespace std;int n;multiset ms;multiset::iterator it;void init(){ ms.原创 2016-07-13 21:04:33 · 275 阅读 · 0 评论 -
Hdu 5347 MZL's chemistry (打表)
[code]:#include#include#includeusing namespace std;double a[100] = {0,1312,2372.3,520.2,932,800.6,1086.5,1402.3,1313.9,1681,2080.7,495.8,737.7,577.5,786.5,1011.8,999.6,1251.2,原创 2016-07-13 20:59:13 · 252 阅读 · 0 评论 -
Hdu 5344 MZL's xor (杂)
解析:i!=j时(a[i]+a[j])^(a[j]+a[i]) = 0.因此只需统计2*a[i]即可。[code]:#includeusing namespace std;typedef long long LL;LL n,m,z,l;int main(){ int i,j,cas; LL value,ans; scanf("%d",&cas);原创 2016-07-13 20:57:57 · 230 阅读 · 0 评论 -
Hdu 5336 XYZ and Drops(模拟)
解析:一秒一秒的来处理就好。[code]:#include#include#include#include#includeusing namespace std;const int maxn = 105;struct Node{ int x,y,sz;}a[maxn];struct Drop{ int x,y,dir,time; Drop(in原创 2016-07-13 20:31:20 · 440 阅读 · 0 评论 -
Hdu 5334 Virtual Participation (构造)
解析:首先找到第一个n使得n*(n+1)/2>=k,差值为x。然后看下面一个例子:28 = 1 2 3 4 5 6 727 = 1 1 3 4 5 6 726 = 1 1 3 3 4 5 625 = 1 1 1 4 5 6 724 = 1 1 1 4 4 6 723 = 1 1 1 4 4 6 622 = 1 1 1 4 4 4 721 = 1 2 3 4原创 2016-07-13 20:28:50 · 364 阅读 · 0 评论 -
Hdu 5328 Problem Killer (尺取)
解析:处理出公差和公比序列,然后尺取找出最大覆盖范围即可。[code]:#include#include#include#include#include#includeusing namespace std;const int maxn = 1e4+5;const double eps = 1e-6;struct Nod{ int b,next; vo原创 2016-07-13 20:13:05 · 278 阅读 · 0 评论 -
Hdu 5327 Olympiad (预处理)
水题,预处理一下就好[code]:#include#include#include#define lson l,mid,rt<<1#define rson mid+1,r,rt<<1|1using namespace std;const int maxn = 1e5+5;int sum[maxn];bool check(int x){ int i,c[10];原创 2016-07-13 20:09:54 · 255 阅读 · 0 评论 -
Hdu 5325 Crazy Bobo (拓扑排序)
解析:对于原树一条边(a,b),令w[a] [code]:#include#include#include#include#includeusing namespace std;const int maxn = 5e5+5;struct Nod{ int b,next; void init(int b,int next){ this->原创 2016-07-10 20:36:33 · 324 阅读 · 0 评论 -
HDU 5308 I Wanna Become A 24-Point Master (暴力枚举+构造)
题意:let A be an array with 2n−1 numbers and at firsrt Ai=n (1≤i≤n). You need to print n−1 lines and the ith line contains one integer a, one char b and then one integer c, where 1≤a,c<n+i and b is "+原创 2016-07-09 09:34:10 · 372 阅读 · 0 评论