ACM算法日常
文章平均质量分 60
夺金之路
向前走别回头
在读学生一枚。
展开
-
字符串篇
ACM算法题集https://blog.csdn.net/weixin_39778570/article/details/83187443KMPTrieAC自动机回文自动机后缀数组原创 2020-01-06 14:58:19 · 511 阅读 · 0 评论 -
字节跳动2018校招算法方向(第二批)
算法题集:https://blog.csdn.net/weixin_39778570/article/details/83187443第一题[编程题]用户喜好时间限制:C/C++ 3秒,其他语言6秒空间限制:C/C++ 256M,其他语言512M为了不断优化推荐效果,今日头条每天要存储和处理海量数据。假设有这样一种场景:我们对用户按照它们的注册时间先后来标号,对于一类文章,每个用户都...原创 2019-12-15 20:44:40 · 847 阅读 · 0 评论 -
字节跳动2018校招大数据方向(第一批)
ACM题集:https://blog.csdn.net/weixin_39778570/article/details/83187443第三题链接:https://www.nowcoder.com/questionTerminal/f76b7bc64e554edaa53d8e0d84f921c5来源:牛客网[编程题]编程题3热度指数:1104时间限制:C/C++ 1秒,其他语言2秒空间...原创 2019-12-12 21:48:05 · 1426 阅读 · 0 评论 -
字节跳动2018校招测试开发方向(第一批)
ACM题集:https://blog.csdn.net/weixin_39778570/article/details/83187443第一题P为给定的二维平面整数点集。定义 P 中某点x,如果x满足 P 中任意点都不在 x 的右上方区域内(横纵坐标都大于x),则称其为“最大的”。求出所有“最大的”点的集合。(所有点的横坐标和纵坐标都不重复, 坐标轴范围在[0, 1e9) 内)如下图:实心...原创 2019-12-11 23:22:04 · 822 阅读 · 1 评论 -
字节跳动2019春招研发部分编程题汇总
ACM题集:https://blog.csdn.net/weixin_39778570/article/details/83187443第一题[编程题]万万没想到之聪明的编辑时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32M,其他语言64M我叫王大锤,是一家出版社的编辑。我负责校对投稿来的英文稿件,这份工作非常烦人,因为每天都要去修正无数的拼写错误。但是,优秀的人总...原创 2019-12-11 16:11:09 · 1898 阅读 · 0 评论 -
面试刷题笔记
Java学习大纲(持续更新):https://blog.csdn.net/weixin_39778570/article/details/94667501更多IT学习资源:https://blog.csdn.net/weixin_39778570/article/details/100052454算法学习:https://blog.csdn.net/weixin_39778570/articl...原创 2019-11-18 00:34:59 · 566 阅读 · 0 评论 -
CF Educational67
Codeforce题解,教育场67,ACM原创 2019-10-19 13:58:06 · 344 阅读 · 0 评论 -
ACM学习之路
如何学习ACM。ACM题解报告。蓝桥杯怎么准备。备考ACM。更新中...原创 2018-10-19 20:17:48 · 7406 阅读 · 0 评论 -
深度优先搜索DFS(洛谷)
ACM题集:https://blog.csdn.net/weixin_39778570/article/details/83187443P1219 八皇后题目:https://www.luogu.org/problemnew/show/P1219题意:N皇后问题求解个数,部分输出解法:回溯搜索每一行放置在哪一列就行#include<bits/stdc++.h>#define...原创 2018-11-04 15:38:42 · 1432 阅读 · 0 评论 -
剪枝常用技巧
ACM题集:https://blog.csdn.net/weixin_39778570/article/details/83187443剪枝常见方法:1、优先搜索顺序,从大到小搜索,数独优先搜索最少可能填充2、排除等效冗余 poj10113、可行性剪枝条 数字三角形 数独 很早就知道这样下去不可能的4、最优性剪枝,如果当前花费已经超过当前搜索最优解,那么无论之后采取多么优秀的策略到达递...原创 2018-11-04 17:24:17 · 2812 阅读 · 0 评论 -
POJ 2299 Ultra-QuickSort(求逆序对)
树状树组求逆序对,归并排序求逆序对原创 2018-10-16 20:30:18 · 251 阅读 · 0 评论 -
if else(新手村)
洛谷新手村,if else原创 2018-10-17 00:26:30 · 332 阅读 · 0 评论 -
线性数据结构(洛谷)
P1996 约瑟夫问题P1115 最大子段和P1739 表达式括号匹配P1160 队列安排P1449 后缀表达式原创 2018-11-03 20:37:03 · 469 阅读 · 0 评论 -
树形数据结构(洛谷)
P1087 FBI树P1030 求先序排列P1305 新二叉树原创 2018-11-03 21:21:04 · 624 阅读 · 0 评论 -
广度优先搜索BFS(洛谷)
P1162 填涂颜色P1032 字串变换P1141 01迷宫P1126 机器人搬重物P1443 马的遍历原创 2018-11-04 16:13:31 · 1055 阅读 · 0 评论 -
带有技巧的搜索(洛谷,数独二进制优先找枚举顺序,旅行商(写了状压DP),数字三角(利用杨辉三角的系数),滑雪(记忆化))
P1118 [USACO06FEB]数字三角形`Backward Digit Su`…P1434 [SHOI2002]滑雪P1433 吃奶酪P1074 靶形数独原创 2018-11-04 17:17:51 · 476 阅读 · 0 评论 -
贪心法(洛谷普及场1)
ACM题集,洛谷,贪心入门原创 2018-10-27 15:40:03 · 629 阅读 · 0 评论 -
贪心法(洛谷普及场2)
P1080 国王游戏P1031 均分纸牌P1233 木棍加工P2123 皇后游戏如何学习贪心,贪心入门题原创 2018-10-27 16:11:31 · 306 阅读 · 0 评论 -
poj 3190(Stall Reservations,左右堆)
ACM题集:https://blog.csdn.net/weixin_39778570/article/details/83187443题目链接:http://poj.org/problem?id=3190题意:给定n个闭区间,要让这n个区间拼成m段,(拼的的意思是可以间隔,但不能重叠,如[1,2],[5,6]能拼一起[1,3],[3,4]不能拼一起),要求使得m最小,并输出每个区间属于第几...原创 2018-10-27 16:28:48 · 356 阅读 · 0 评论 -
poj 2054 (Color a Tree)
贪心,树上的贪心,点的均匀权值贪心合并原创 2018-10-27 17:28:09 · 394 阅读 · 0 评论 -
poj 3069 Saruman's Army (贪心,最少几个定长区间覆盖点集)
ACM题集:https://blog.csdn.net/weixin_39778570/article/details/83187443题目链接:http://poj.org/problem?id=3069题意:n个军人,定义设备的监控范围为R,设备被携带在军人身上,问最少有多少个设备能监控所有人题解每个设备就是一个区间,问最少要有多少个区间才能把点覆盖完每次选择能覆盖到左边的最远的点...原创 2018-10-27 17:34:00 · 369 阅读 · 0 评论 -
poj3253 Fence Repair (贪心求线段分块花费最少)
ACM题集:https://blog.csdn.net/weixin_39778570/article/details/83187443题目:http://poj.org/problem?id=3253题意:把一块木板切成指定的n段,一共切n-1段,每切一段的花费是木板的长度,安培切木板的顺序使得花费最少,输出最小值题解:类似于合并石头,这里是分木板,把一个木板长度L,分为L1,L2的花...原创 2018-10-27 17:43:35 · 646 阅读 · 0 评论 -
排序(洛谷,更新ing)
洛谷,排序,快速排序,3路快速排序,归并排序,排序去重,结构体排序,字符串排序原创 2018-10-15 21:26:11 · 616 阅读 · 0 评论 -
HDU 6441 - Find Integer - [费马大定理][2018CCPC网络选拔赛第4题]
原文链接:http://www.cnblogs.com/dilthey/p/9577477.html a^2 = (a^2/2)*2 (偶数) a^2 = (a^2)*1 (奇数)#include<bits/stdc++.h> #define ll long long#define pf(a) printf("%d\n", a)#defi...原创 2018-09-08 18:17:50 · 326 阅读 · 0 评论 -
Median of Two Sorted Arrays(求中位数)
题目链接 题目大意:从俩个排序好的数组里找到这两个数组的中位数,时间复杂度为 O(log (m+n)),m,n为两数组长度There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall r...原创 2018-06-20 12:15:09 · 278 阅读 · 0 评论 -
二分查找
二分查找快速入门,分巧克力原创 2018-06-27 18:12:02 · 10740 阅读 · 0 评论 -
hiho 1692 第k小分数(实数上的二分答案)
hiho 1692 第k小分数,二分法,多重递增函数构成解空间原创 2018-10-14 23:45:07 · 663 阅读 · 0 评论 -
枚举与优化套路
hihoCoder的1494题hihoCoder #1505题:小Hi和小Ho的礼物。#1686 : 互补二元组#1745 : 最大顺子题目连接:#1514 : 偶像的条件 #1607 : H星人社交网络题目链接:#1534 : Array Partition原创 2018-06-13 13:20:16 · 2229 阅读 · 3 评论 -
2018 icpc网络赛-Nanjing 题解 J 题
原文链接:https://kuangbin.github.io/2018/09/01/2018-ACM-ICPC-Nanjing-online-J/ A square-free integer is an integer which is indivisible by any square number except 11. For example, 6 = 2 \cdot 36=2⋅3 is ...转载 2018-09-02 01:42:32 · 922 阅读 · 0 评论 -
2018 icpc网络赛-Nanjing 题解 L. Magical Girl Haze
题目链接:https://nanti.jisuanke.com/t/31001 There are NN cities in the country, and MM directional roads from uu to v(1\le u, v\le n)v(1≤u,v≤n). Every road has a distance c_ic i . Haze is a Magic...原创 2018-09-02 23:32:58 · 396 阅读 · 0 评论 -
2018 icpc网络赛-Nanjing 题解 A An Olympian Math Problem
题目链接:https://nanti.jisuanke.com/t/30990 1000ms 65536K Alice, a student of grade 66, is thinking about an Olympian Math problem, but she feels so despair that she cries. And her classmate, Bob, has...原创 2018-09-02 23:59:13 · 383 阅读 · 0 评论 -
"红色病毒"问题 hdu 2065
Problem Description 医学界发现的新病毒因其蔓延速度和Internet上传播的”红色病毒”不相上下,被称为”红色病毒”,经研究发现,该病毒及其变种的DNA的一条单链中,胞嘧啶,腺嘧啶均是成对出现的。 现在有一长度为N的字符串,满足一下条件: (1) 字符串仅由A,B,C,D四个字母组成; (2) A出现偶数次(也可以不出现); (3) C出现偶数次(也可以不出现); ...原创 2018-08-31 14:43:20 · 409 阅读 · 0 评论 -
HDU 2000 ASCII码排序
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2000 roblem Description 输入三个字符后,按各字符的ASCII码从小到大的顺序输出这三个字符。Input 输入数据有多组,每组占一行,有三个字符组成,之间无空格。Output 对于每组输入数据,输出一行,字符中间用一个空格分开。Sample Input qwe ...原创 2018-09-08 14:21:34 · 98 阅读 · 0 评论 -
HDU 2001 两点间距离
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2001 输入两点坐标(X1,Y1),(X2,Y2),计算并输出两点间的距离。Input 输入数据有多组,每组占一行,由4个实数组成,分别表示x1,y1,x2,y2,数据之间用空格隔开。Output 对于每组输入数据,输出一行,结果保留两位小数。Sample Input 0 0 0 1...原创 2018-09-08 14:22:46 · 179 阅读 · 0 评论 -
HUD 2002 球体积
Problem Description 根据输入的半径值,计算球的体积。Input 输入数据有多组,每组占一行,每行包括一个实数,表示球的半径。Output 输出对应的球的体积,对于每组输入数据,输出一行,计算结果保留三位小数。Sample Input 1 1.5Sample Output 4.189 14.137#include<iostream>...原创 2018-09-08 14:23:54 · 168 阅读 · 0 评论 -
HDU 2003 求绝对值
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2003 Problem Description 求实数的绝对值。Input 输入数据有多组,每组占一行,每行包含一个实数。Output 对于每组输入数据,输出它的绝对值,要求每组数据输出一行,结果保留两位小数。Sample Input 123 -234.00Sample Ou...原创 2018-09-08 14:25:19 · 149 阅读 · 0 评论 -
HDU 2004 - 2020
2004 等级判断#include&amp;lt;iostream&amp;gt;#include&amp;lt;cstdio&amp;gt;using namespace std;double a;int main(){ while(scanf(&quot;%lf&quot;, &amp;amp;a)!=EOF){ if(90&原创 2018-09-08 14:48:41 · 1011 阅读 · 0 评论 -
HDU 2021-2040
2021 发工资咯:#include&lt;bits/stdc++.h&gt;using namespace std;#define LL long long#define REP(i,n) for(int i=0; i&lt;n; i++)#define REPP(i,n) for(int i=1; i&lt;=n; i++)#define P pair&lt;int,...原创 2018-09-08 15:16:25 · 368 阅读 · 0 评论 -
HDU 2041-2060
2041 超级楼梯 简单的递推注意初始条件#include&amp;lt;bits/stdc++.h&amp;gt;using namespace std;#define ll long long#define P pair&amp;lt;int, int&amp;gt;int dp[100];void init(){ dp[1] = 1; // 刚开始在第一级 dp原创 2018-09-08 15:46:27 · 361 阅读 · 0 评论 -
HDU 2061-2080
2061 Treasure the new start, freshmen!#include&amp;lt;bits/stdc++.h&amp;gt;#define fo(i,j,n) for(int i=j; i&amp;lt;=n; ++i)int t,n;double ans, crd, sco, c_sum, cs_sum;char s[40];int main(){ scan...原创 2018-09-08 16:47:10 · 428 阅读 · 0 评论