自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(17)
  • 收藏
  • 关注

原创 洛谷P1857 质数取石子(SG函数)

//#pragma GCC optimize(2)#include<bits/stdc++.h>#define rep(i,st,en) for(int i=st;i<=en;i++)#define REP(i,st,en) for(int i=st;i>=em;i--)#define el printf("\n");using namespace std;typedef double db;typedef long long ll;typedef long dou.

2021-08-13 21:37:14 220

原创 CF 722 DIV2 B Sifid and Strange Subsequences(排序)

找出最长序列,使得序列中任意两项之差绝对值大于等于最大值

2021-07-29 16:51:47 85

原创 最大势算法(HNOI2008 神奇的国度)(集合内不同色最少色染色问题)

链接:https://ac.nowcoder.com/acm/problem/20068前置知识点:https://wenku.baidu.com/view/07f4be196c175f0e7cd13784.html(cdq 弦图与区间图)题目描述K国是一个热衷三角形的国度,连人的交往也只喜欢三角原则.他们认为三角关系:即AB相互认识,BC相互认识,CA 相互认识,是简洁高效的.为了巩固三角关系,K国禁止四边关系,五边关系等等的存在.所谓N边关系,是指N个人 A1A2 ...An之间仅存在N对

2021-07-29 16:38:29 192

原创 CF 722 DIV2 D.Kavi on Pairing Duty(线性筛+递推)

a[i]=sigma a[j] +fac[i]j从1到i-1fac:因子个数,比如4有1,2,4三个因子,如果有质因数p1,p2,p3,对应指数为a1,a2,a3,则fac[i]=(a1+1)*(a2+1)*(a3+1)#include<stdio.h>#include<string.h>#include<algorithm>#include<stdlib.h>#define max(a,b) a>b?a:b#define ...

2021-05-26 13:44:56 222

原创 quick_sort手写版

#include <stdio.h> #define N 100010int a[N],n,i; void quick_sort(int l,int r){ if(l>=r)return; int i=l-1,j=r+1; int x=a[(l+r)>>1]; while(i<j) { do i++;while(a[i]<x); do j--;while(a[j]>x); if(i>=j)break; int t=a[.

2021-03-28 18:34:50 94

原创 HDU 1003 Max Sum(DP入门)

#include<bits/stdc++.h>using namespace std;long long max(long long x,long long y){ return x>y?x:y;}int t,o,i,dp[99999],st[99999],a[99999],maxx,n;int main(){ cin>>t; for(o=1;o<=t;o++) { cin>>n; for(i=1;i<=n;i++) .

2021-03-15 20:26:17 59

原创 HDU 1004 Let the Balloon Rise(字符串排序)

Problem DescriptionContest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popular problem. When the contest is over, they will count the balloons of each color and f

2021-03-15 19:25:13 80

原创 HDU 1005 Number Sequence优化暴力

Problem DescriptionA 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).InputThe input consists of multiple test cases. Each test case..

2021-03-15 19:07:15 84

原创 C排序板子(结构体)

typedef struct{ int a; int b; int c; int d;}v;v virus[1000005];int cmp(const void *a ,const void *b) { return (*(v *)a).d-(*(v *)b).d; }

2021-03-15 15:30:46 164

原创 HDU 5938 Four Operations(暴力+贪心)

Problem DescriptionLittle Ruins is a studious boy, recently he learned the four operations!Now he want to use four operations to generate a number, he takes a string which only contains digits'1'-'9', and split it into5intervals and add the four op...

2021-03-15 15:14:11 113

原创 洛谷P2170选学霸(玄学吧)

题目描述老师想从N名学生中选M人当学霸,但有K对人实力相当,如果实力相当的人中,一部分被选上,另一部分没有,同学们就会抗议。所以老师想请你帮他求出他该选多少学霸,才能既不让同学们抗议,又与原来的M尽可能接近输入输出格式输入格式:第一行,三个正整数N,M,K。第2...K行,每行2个数,表示一对实力相当的人的编号(编号为1…N)输出格式:

2017-09-10 23:25:12 545

原创 JDFZD5

T1Z(大)Z(黄)签到题排序求极值差T2魔改多重背包只有四种重量,用桶装一下,然后背包T3(待续)

2017-08-10 16:01:24 277

原创 JDFZD4总结

T1辣鸡数瓷砖(两个等差数列相乘)取膜注意没有除法法则T2 先转成从1到n/k的互质对快筛欧拉......T3归并(树状数组)前后求两遍逆序对再相减就好

2017-08-10 11:17:47 246

原创 JDFZD3总结

T1堆优化贪心(大根堆)由于不能折返(折返就不能收益最大化),就可以枚举走过的终点,总钱数-=路费,把前面所有湖钓到的鱼放入大根堆,每次取出,并减去减少的鱼量直到钱数不足或没有鱼为止。T2只要找和为周长一半的弧长区间有几个就行双指针扫描就好T3概率DP......不会

2017-08-10 10:38:18 149

原创 JDFZD2总结

T1搜索根据dalao的思路,因为只有两种字符,所以可以把整个图转为二进制.......做法不会orz暴搜大法好T2......这题不难得出    f[1]=1;    for(int i=2;i    {        f[i]=f[i-1];        if(!(i&1)) //evenf[i]+=f[i>>1];        f[

2017-08-10 10:12:50 198

原创 JDFZD1总结

T1桶排序加枚举,把每个数存入桶中,从1跑到最大的数的桶,再去翻数字倍数的桶中有没有记录从加法枚举到乘法枚举,最后找每个存数桶中的记录T2差分,校门口的树升级版,l[i]表示以点i为左端点的线段个数,r[i]表示以点i为右端点的线段个数,然后画一下图都能转化成同一种情况T3辣鸡并查集裸题

2017-08-10 09:53:46 349

原创 Luogu 1588(dfs)(false)

#include#include#include#include#include#includeusing namespace std;int minn=99999;int cnt,x,y,t;void search(int x,int y,int step){if(x==y){minn=min(minn,step);return;}

2017-07-31 22:00:04 207

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除