0 kosf_

尚未进行身份认证

我要认证

暂无相关简介

等级
TA的排名 8w+

洛谷 P1522

题目链接:https://www.luogu.com.cn/problem/P1522思路这个题有些坑1 可能重连接后没有之前长 最长的还是以前的2 一个点也可能是一个区域代码#include<cstdio>#include<cstring>#include<cmath>#include<cstdlib>#include<cctype>#include<ctime>#include<iostream&gt

2020-05-11 23:43:28

[bfs] 蓝桥杯 九宫重排

题目链接:http://121.199.3.109/contest/2/problem/1001思路bfs从第一个图开始记录下每次跑过的路,看看有没有和第二个重合的代码#include<cstdio>#include<cstring>#include<cmath>#include<cstdlib>#include<cctype>#include<ctime>#include<iostream>#in

2020-05-11 22:06:31

cf 1330 C Dreamoon Likes Coloring

题目题目链接:https://codeforc.es/contest/1330/problem/C思路从后往前推 如果没有填的次数和没有填的长度一样 那么pi=n-suf[i]+1否则 pi=i代码#include<cstdio>#include<cstring>#include<cmath>#include<cstdlib>#...

2020-05-06 00:11:55

cf 1339C Powered Addition

题目题目链接:https://codeforc.es/contest/1339/problem/C思路每个数都可以用几个2^n表示 转换成二进制就是1存在的地方找出最大的差看看二进制位有多长就行了代码#include<cstdio>#include<cstring>#include<cmath>#include<cstdlib>#...

2020-05-05 16:07:34

cf 1339B

题目题目链接:https://codeforc.es/contest/1339/problem/B思路A B C D EA B C|D EC B A|D EC D B A E代码#include<cstdio>#include<cstring>#include<cmath>#include<cstdlib>#include&l...

2020-05-05 15:32:31

cf 1341D Nastya and Scoreboard

题目题目链接:https://codeforces.com/contest/1341/problem/D思路dp[i][j]表示到第i个数字时还剩j个棍子能拼给出的最大的数代码#include<cstdio>#include<cstring>#include<cmath>#include<cstdlib>#include<c...

2020-05-05 13:29:38

cf 1341C

题目https://codeforces.com/contest/1341/problem/C思路题目好长其实就是看看每次连续的数字的开头是不是小于上一次的开头代码#include<cstdio>#include<cstring>#include<cmath>#include<cstdlib>#include<cctype&...

2020-05-04 23:26:24

[线段树染色+离散化] *POJ2528*

题目思路线段树染色板子题主要是要离散化!代码#include<cstdio>#include<cstring>#include<cmath>#include<cstdlib>#include<cctype>#include<ctime>#include<iostream>#include&...

2020-05-01 12:34:41

[差分] cf 1343D

题目题目链接:https://codeforces.com/contest/1343/problem/D思路设l=min(a[i],a[n-i+1])+1,r=max(a[i],a[n-i+1])+k,sum=a[i]+a[n-i+1]最多加k个 那就说明如果定值在sum(2,l-1) 这个区间 两个数都要改如果定值在sum(r+1,2*k)两个数都要改在(l,r)内的时候如果不等...

2020-04-28 23:55:11

[树状数组] cf 1342D

题目思路一个一个边弄边加 算最多要多大的容器来存 然后挨个存进去就好了代码#include<cstdio>#include<cstring>#include<cmath>#include<cstdlib>#include<cctype>#include<ctime>#include<iostream...

2020-04-28 00:11:07

[poj] 归并排序求逆序对 2299

题目题目:https://vjudge.net/problem/POJ-2299思路求要换几个才能变成从小到大代码#include<cstdio>#include<cstring>#include<cmath>#include<cstdlib>#include<cctype>#include<ctime>...

2020-04-22 23:43:41

[求逆序对] luogu1966

题目题目:https://www.luogu.com.cn/problem/P1966思路① 要求(ai-bi)^2最小,就是让他们第一大和第一大在一起,第二大和第二大在一起…② 用a,b存输入的数,然后c d 来记数,有点类似离散化 其实又不是。sort之后c,d分别就是第一排、第二排里1 2 3 4大的数对应的位置。③ 然后题目变成了把c换成d最少要换多少次,其实就是求逆序对的事情...

2020-04-22 23:24:30

[归并排序] 求逆序对 luogu1908 比树状数组快

题目题目链接:https://www.luogu.com.cn/problem/P1908思路归并就是二分然后…哎呀我好懒的打代码#include<cstdio>#include<cstring>#include<cmath>#include<cstdlib>#include<cctype>#include<c...

2020-04-22 19:01:21

[树状数组] 求逆序对 洛谷p1908

题目链接:https://www.luogu.com.cn/problem/P1908思路树状数组记录n的个数,进来一个edit一次,就可以记录前面的啦~!代码#include<cstdio>#include<cstring>#include<cmath>#include<cstdlib>#include<cctype>...

2020-04-22 18:58:23

[dij堆优化] cf1076 D

题目题目一个无向图,各点到点1的最短距离为di,保证满足条件删除m-k条边之后使得到点1的距离仍为di的点数量最多的情况下,输出剩余的k条边的编号(输入顺序即编号)代码#include<cstdio>#include<cstring>#include<cmath>#include<cstdlib>#include<cctype...

2020-04-20 15:06:23

[bfs] cf 1037 D

题目思路记录一下每次bfs的数 对比一下就好了代码#include<cstdio>#include<cstring>#include<cmath>#include<cstdlib>#include<cctype>#include<ctime>#include<iostream>#includ...

2020-04-20 15:00:23

[最小生成树] 畅通工程

题目代码#include<cstdio>#include<cstring>#include<cmath>#include<cstdlib>#include<cctype>#include<ctime>#include<iostream>#include<string>#includ...

2020-04-20 14:57:49

[线段树] *单点修改 区间查询* 洛谷P4588

题目思路想了半天 这个和线段树什么关系!!!最后发现我就是猪猪害就是个板子题把每一个叶子节点的值赋值为1如果第m个是1 n 就把m这个点的值变为n如果是2 n 就把n点的值变为1代码#include<cstdio>#include<cstring>#include<cmath>#include<cstdlib>#incl...

2020-04-19 16:45:23

[递归]洛谷2404

题目回溯嘤嘤嘤我递归太差了代码#include<cstdio>#include<cstring>#include<cmath>#include<cstdlib>#include<cctype>#include<ctime>#include<iostream>#include<strin...

2020-04-18 00:19:23

[多到一的最短路] 反向建图 洛谷P1629

题目代码#include<cstdio>#include<cstring>#include<cmath>#include<cstdlib>#include<cctype>#include<ctime>#include<iostream>#include<string>#includ...

2020-04-17 22:55:35

查看更多

勋章 我的勋章
  • 持之以恒
    持之以恒
    授予每个自然月内发布4篇或4篇以上原创或翻译IT博文的用户。不积跬步无以至千里,不积小流无以成江海,程序人生的精彩需要坚持不懈地积累!
  • 勤写标兵Lv4
    勤写标兵Lv4
    授予每个自然周发布9篇以上(包括9篇)原创IT博文的用户。本勋章将于次周周三上午根据用户上周的博文发布情况由系统自动颁发。