- 博客(278)
- 资源 (1)
- 收藏
- 关注

原创 【重大通知】本博客停止更新
优快云吃相越来越难看了,所以决定转战博客园博文也已经同步到博客园,本博客以后随缘更新 (也许不会更新了)博客园地址:https://www.cnblogs.com/Friends-A/...
2019-08-11 13:05:05
482

原创 Sublime Text3:插件+快捷键+环境变量设置+C/C++编译环境
环境变量配置如果电脑里之前下载过Codeblocks或者Dev,找到文件根目录,打开MinGw(或者MinGw64),点开bin目录,将bin文件夹的目录复制下来(以Codeblocks为例,将文件目录D:\CodeBlocks\MinGW\bin复制下来)如果之前电脑上没有任何编译器,并且没有MinGw文件夹,可以去官网下载MinGw,百度都有安装教程和需要安装那些包,我不多说了然后...
2018-08-08 15:55:56
8817
2

原创 头文件板子
#include <stdio.h>#include <string.h>#include <iostream>#include <algorithm>#include <math.h>#include <limits.h>#include <map>#include <stack&a
2018-07-12 13:47:11
292

原创 模板整理(持续更新)
目录数论数据结构博弈论递归实现n!图论(待补充)数组/字符串类DP类1~n全排列(递归实现)1~n全排列(利用STL)DFS模板判断1~1e9之内的数是不是素数Warshall算法求传递闭包(O(n^3))数论快速幂取模int Pow(int a,int b,int c){ int res=1; while(b>0) {...
2018-03-24 15:49:11
876
原创 HDU 1052:Tian Ji -- The Horse Racing(贪心)
Tian Ji -- The Horse RacingTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 41290 Accepted Submission(s): 12427Problem DescriptionHe...
2019-08-02 20:23:39
327
原创 51Nod 1264:线段相交(计算几何)
51Nod 1264:线段相交Decision给出平面上两条线段的两个端点,判断这两条线段是否相交(有一个公共点或有部分重合认为相交)。 如果相交,输出"Yes",否则输出"No"。Input第1行:一个数T,表示输入的测试数量(1 <= T <= 1000)第2 - T + 1行:每行8个数,x1,y1,x2,y2,x3,y3,x4,y4。(-10^8 <= xi, ...
2019-06-25 20:24:38
261
原创 黑龙江大学程序设计竞赛(重现赛)B:Help Me(数学)
链接:https://ac.nowcoder.com/acm/contest/877/B来源:牛客网有一天Miss Quan出了一个题,给出一个长度为的数组Miss Quan说给我计算下这个权值等于多少,然后随手写了一个式子,把她的小伙伴们都给惊呆了,这是什么鬼…比如N=2,Value=(a2−a1)2+(a3−a1)2+(a3−a2)2N=2,Value=(a_2-a_1)^2+(...
2019-04-25 19:03:51
310
原创 Java用sort实现对数组的降序排序
在调用Arrays.sort()对数组进行排序时,默认是升序排序的,如果想让数组降序排序,有下面两种方法:利用Collections的reverseOrderimport java.util.*;public class Main { public static void main(String[] args) {// 注意这里是Integer,不是int ...
2019-04-23 20:28:09
13231
1
原创 ZOJ 3785:What day is that day?(数论)
What day is that day?Time Limit: 2 Seconds Memory Limit: 65536 KBIt’s Saturday today, what day is it after 11+22+33+...+NN1^1 + 2^2 + 3^3 + ... + N^N11+22+33+...+NN days?InputThere are mult...
2019-04-21 17:53:59
265
原创 ZOJ 3778:Talented Chef(贪心?思维)
Talented ChefTime Limit: 2 Seconds Memory Limit: 65536 KBAs we all know, Coach Gao is a talented chef, because he is able to cook M dishes in the same time. Tonight he is going to have a hear...
2019-04-21 17:30:19
243
原创 ZOJ 3960:What Kind of Friends Are You?
What Kind of Friends Are You?Time Limit: 1 Second Memory Limit: 65536 KBJapari Park is a large zoo home to extant species, endangered species, extinct species, cryptids and some legendary cre...
2019-04-12 22:35:22
346
原创 ZOJ 3870:Team Formation(位运算&思维)
Team FormationTime Limit: 2 Seconds Memory Limit: 131072 KBFor an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team from N students of his u...
2019-04-09 20:39:47
210
原创 ZOJ 3872: Beauty of Array(思维)
Beauty of ArrayTime Limit: 2 Seconds Memory Limit: 65536 KBEdward has an array A with N integers. He defines the beauty of an array as the summation of all distinct integers in the array. Now...
2019-04-09 19:05:31
153
原创 Codeforces 189A:Cut Ribbon(完全背包,DP)
time limit per test : 1 secondmemory limit per test : 256 megabytesinput : standard inputoutput : standard outputPolycarpus has a ribbon, its length is nnn. He wants to cut the ribbon in a way t...
2019-04-01 20:12:59
376
原创 第九届河南理工大学算法程序设计大赛 正式赛L:最优规划(最小生成树)
单测试点时限: 1.0 秒内存限制: 512 MB有很多城市之间已经建立了路径,但是有些城市之间没有路径联通。为了联通所有的城市,现在需要添加一些路径,为了节约,需要满足添加总路径是最短的。输入第一行 333 个整数 n,m,sn, m, sn,m,s, 分别表示城市的数量、已经存在的路的数量、可修的路的数量。之后的 mmm 行,每行 333 个整数 x,y,dx, y, dx,y,d...
2019-03-31 22:11:17
168
原创 第九届河南理工大学算法程序设计大赛 正式赛(部分题解)
A题目链接:https://hpuoj.com/contest/16/problem/A/Solve:签到题,输出187187187即可B题目链接:https://hpuoj.com/contest/16/problem/B/Solve:按照每四位二进制转变成一位十六进制,从后往前模拟,注意前导零,注意输出的字母是小写Code:代码连接戳这里C题目链接:https://h...
2019-03-31 22:04:43
855
原创 Codeforces 339B:Xenia and Ringroad(水题)
time limit per test : 2 secondsmemory limit per test : 256 megabytesinput : standard inputoutput : standard outputXenia lives in a city that has nnn houses built along the main ringroad. The rin...
2019-03-26 16:40:05
281
原创 Codeforces1132A——Regular Bracket Sequence(水题)
Regular Bracket Sequencetime limit per test:1 secondmemory limit per test:256 megabytesinput:standard inputoutput:standard outputA string is called bracket sequence if it does not contain any c...
2019-03-15 11:21:37
446
原创 Codeforces 1113C: Sasha and a Bit of Relax(位运算|异或)
time limit per test: 1 secondmemory limit per test: 256 megabytesinput: standard inputoutput: standard outputSasha likes programming. Once, during a very long contest, Sasha decided that he was a b...
2019-02-17 22:12:36
395
原创 Codeforces 1073D:Berland Fair(模拟)
time limit per test: 2 secondsmemory limit per test: 256 megabytesinput: standard inputoutput: standard outputXXI Berland Annual Fair is coming really soon! Traditionally fair consists of nnn booth...
2019-02-15 22:51:55
255
原创 Codeforces 1073C:Vasya and Robot(二分)
C. Vasya and Robottime limit per test: 1 secondmemory limit per test: 256 megabytesinput: standard inputoutput: standard outputVasya has got a robot which is situated on an infinite Cartesian plan...
2019-02-15 22:28:45
330
原创 Codeforces 919D:Substring(拓扑排序+DP)
D. Substringtime limit: per test3 secondsmemory limit: per test256 megabytesinputstandard: inputoutputstandard: outputYou are given a graph with nnn nodes and mmm directed edges. One lowercase l...
2019-02-14 16:59:41
414
原创 Hexo添加Live2D看板娘+模型预览
文章目录添加和注意事项模型预览live2d-widget-model-chitoselive2d-widget-model-epsilon2_1live2d-widget-model-gflive2d-widget-model-haru_01live2d-widget-model-haru_02live2d-widget-model-harutolive2d-widget-model-hibiki...
2019-02-13 14:48:34
28499
原创 codevs 1300:文件排版(DP)
题目描述写电子邮件是有趣的,但不幸的是经常写不好看,主要是因为所有的行不一样长,你的上司想要发排版精美的电子邮件,你的任务是为他编写一个电子邮件排版程序。完成这个任务最简单的办法是在太短的行中的单词之间插入空格,但这并不是最好的方法,考虑如下例子:This is the example you areactually considering.假设我们想将第二行变得和第一行一样长,靠...
2019-02-10 20:12:23
501
原创 《机器学习实战》kNN算法及约会网站代码详解
使用kNN算法进行分类的原理是:从训练集中选出离待分类点最近的kkk个点,在这kkk个点中所占比重最大的分类即为该点所在的分类。通常kkk不超过202020kNN算法步骤:计算数据集中的点与待分类点之间的距离按照距离升序排序选出距离最小的kkk个点计算这kkk个点所在类别出现的频率(次数)返回出现频率最高的点的类别代码的实现:首先导入numpy模块和operator模块,建立一...
2019-02-10 15:22:34
1022
1
原创 牛客练习赛39 B:选点(二叉树遍历+LIS)
链接:https://ac.nowcoder.com/acm/contest/368/B来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld题目描述有一棵n个节点的二叉树,1为根节点,每个节点有一个值wiw_iwi。现在要选出尽量多的点。对于任意一棵子树,都要满足:如果选了根节...
2019-02-08 22:01:43
280
原创 洛谷 P1439 【模板】最长公共子序列(DP,LIS?)
题目描述给出1-n的两个排列P1和P2,求它们的最长公共子序列。输入输出格式输入格式:第一行是一个数n,接下来两行,每行为n个数,为自然数1-n的一个排列。输出格式:一个数,即最长公共子序列的长度输入输出样例输入样例#1:5 3 2 1 4 51 2 3 4 5输出样例#1:3说明【数据规模】对于50%的数据,n≤1000对于100%的数据,n≤100000...
2019-02-08 16:48:30
315
原创 HDU 1024:Max Sum Plus Plus(DP)
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 39886 Accepted Submission(s): 14338Problem DescriptionNow I think you have got an AC in Ign...
2019-02-07 21:42:07
194
原创 洛谷 P1434 [SHOI2002]滑雪(DP,记忆化搜索)
题目描述Michael喜欢滑雪。这并不奇怪,因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道在一个区域中最长的滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子:1 2 3 4 516 17 18 19 615 24 25 20 714 2...
2019-02-06 21:59:16
534
原创 菜鸡的2018年度总结
公元201820182018年已经正式过去了。过去的一年,发生了很多事情,也经历了很多,得到了很多。在这里写一下总结流水账,并为201920192019定一些小目标吧~四月一日,在新乡河南科技学院参加了蓝桥杯省赛,ACM生涯的第一场校级以上的比赛,并拿到了二等奖五月二十日、二十一日,在西北工业大学和LF、THJ参加了区域赛邀请赛,第一次参加与全国性质的ACM比赛,虽然是邀请赛,虽然...
2019-02-05 21:17:26
256
原创 洛谷1052——过河(DP+状态压缩)
题目描述在河上有一座独木桥,一只青蛙想沿着独木桥从河的一侧跳到另一侧。在桥上有一些石子,青蛙很讨厌踩在这些石子上。由于桥的长度和青蛙一次跳过的距离都是正整数,我们可以把独木桥上青蛙可能到达的点看成数轴上的一串整点:0,1,…,L0,1,…,L0,1,…,L(其中LLL是桥的长度)。坐标为000的点表示桥的起点,坐标为LLL的点表示桥的终点。青蛙从桥的起点开始,不停的向终点方向跳跃。一次跳跃的距离...
2019-02-03 19:59:24
543
转载 mod4最优路径问题(转载)
原文链接:https://blog.youkuaiyun.com/ACdreamers/article/details/18501855mod4最优路径问题如下图: 从1到4找出一条路径,要求路径的总长度mod4的余数最小。分析:一条从1到4的最优路径,在它走到2或3时mod4的余数不一定最小。也就是说,最优策略的子策略不一定最优,所以本问题不满足最优化原理,那么也就不能用动态规划来解决...
2019-02-03 11:01:28
410
原创 POJ 3126:Prime Path(素数+BFS)
The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices.— It is a matter of secu...
2019-02-01 13:15:10
310
原创 NYOJ-15:括号匹配(二)
内存限制:64MB 时间限制:1000ms 特判: No通过数:54 提交数:158 难度:6题目描述:给你一个字符串,里面只包含"(",")","[","]"四种符号,请问你需要至少添加多少个括号才能使这些括号匹配起来。如:[]是匹配的([])[]是匹配的((]是不匹配的([)]是不匹配的输入描述:第一行输入一个正整数N,表示测试数据组数(N<=10)每组测试数据都只...
2019-01-21 16:35:47
333
原创 Codeforces 1105C: Ayoub and Lost Array(递推)
time limit per test: 1 secondmemory limit per test: 256 megabytesinput: standard inputoutput: standard outputAyoub had an array aaa of integers of size nnn and this array had two interesting pro...
2019-01-21 11:43:10
530
原创 Codeforces 1105B:Zuhair and Strings(字符串水题)
time limit per test: 1 secondmemory limit per test: 256 megabytesinput: standard inputoutput: standard outputGiven a string sss of length nnn and integer k (1≤k≤n)k\ (1≤k≤n)k (1≤k≤n). ...
2019-01-21 11:28:00
769
hexo的live2d看板娘
2019-02-13
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人