自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 C++面试常见问题:手写String类

C++面试常见问题:手写String类

2022-11-04 17:02:47 326 1

原创 【23届秋招】0828-文远知行C++测试开发工程师笔试

【23届秋招】0828-文远知行C++测试开发工程师笔试

2022-08-28 21:54:14 1119 5

原创 信机acm新生赛 欧几里得距离

欧几里得距离Description在x轴上有n个城市,想从一个城市到另一个城市的路途实在太恼火了,为了减少路途消耗,决定在两城市之间修建一条单向的时空隧道,一城市到另一城市就可以无消耗的到达了,为了更加的节约时间,所以我们让任意两城市间都可以无消耗到达。修一条路的成本就是两点之间距离的平方,那么请问完成这个工程的成本是多少呢?答案对1e9+7(及1000000007)取模(取余)Input单组输入,第一行一个n(0<n<=100000)表示这个点的数量,第二行n个数表..

2021-01-05 11:21:42 266

原创 蛇形填数 c++ 面试题目

刷题,面试都遇到了好多关于蛇形填数的题,以前也做过,觉得没什么难度,只要自己仔细写的话都是没什么问题的,不过正经自己来写的话发现问题一大堆,于是今天进去写了一下。主体思路就是,定义一个dir方向数组依次为右下左上,以及top,down,right,left这四个边界,当到达边界时dir++,具体看代码吧!#include<bits/stdc++.h>#define ll l...

2020-03-19 21:38:52 395

原创 数独c++解决 dfs+减枝

刷华为的机试题(传送门:数独),刷到了一个关于数独的题目,以为数独还有什么特殊的解,自己写了个减枝的dfs过了83%的数据,但是好多同学都有同样的问题,估计使题目的问题把,这题有多解但是做法不同,就有不同的答案,但是答案都是正确的,然后test有只有一个这就很恼火,所以就假装我这是正确的吧。以前听说过数独但是一直没有深入学习过,今天借着刷题学习了一下关于数独的知识,想不到什么高效的解法,就...

2020-02-21 21:49:46 342

原创 power oj 2840: 伯陵防线 思维+树状数组

2840: 伯陵防线Time Limit: 1000 MS Memory Limit: 262144 KBTotal Submit: 9 Accepted: -4 Page View: 81Submit Status DiscussDescription为抵御巫妖王——阿尔萨斯·米奈希尔的入侵,Wangshu在洛兰深处的召唤师峡谷一侧设立了一道伯陵防线。这道防线从南到北依次排开...

2019-01-30 15:23:35 359

原创 power oj 2839: 假装这是签到题 二分

2839: 假装这是签到题 Time Limit: 2000 MS Memory Limit: 262144 KBTotal Submit: 39 Accepted: 9 Page View: 153Submit Status DiscussDescription对于线性方程组求是一个十分有趣的而又实用的技能,一般解线性方程组的方法有五种分别为:第一种 消元法 ,此法 最为简...

2019-01-30 14:57:23 349 1

原创 Ubuntu18.04下安装MySQL,以及mysql workbench的画ER图及导入数据库(多图)

Ubuntu 安装MySQL:在csdn上搜如何在Ubuntu 上安装MySQL一定会冒出sudo apt install mysql-server这样的东西,这个东西一点没错,但是如果你按照这样做的话会出大问题,比如:mysql -u root -p是无法链接到数据库的,报28000错误,用mysql  wrokbench也会报28000错误。这样的命令行装当然没问题,...

2019-01-15 11:48:20 1529

原创 codeforces1101D.GCD Counting 数论+DP+dfs

D. GCD Countingtime limit per test4.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a tree consisting of nn vertices. A number is wri...

2019-01-13 11:18:31 618

原创 Ubuntu18.04下安装配置VScode以及VS的使用总结

不知道为什么,我的Ubuntu18.04用codeblock异常的难受我一起之下就把它给卸载了,发现在Ubuntu上只有Pycharm,win10上只有codeblock,Dev-c++真的难受。突然有一天看博客有那些ide好用,就意外的发现啦VScode这个东西,心血来潮就一安装了一下,本以为只需要分分重结果硬是安装了一个白天。下载及安装:在博客上有很多种方法常见的就是四个命...

2019-01-09 21:14:00 17443 1

原创 Python搭建自己的ip代理池学习总结

    刚刚学习了爬虫入门爬取小说,觉得那是不够的,很多时候你仅仅伪装成浏览器是解决不了问题的,还需要解决别人封你的ip的问题,所以我又学习了如何爬虫是更换自己的ip,想要有足够的ip来供你更换,一定得先搭建你的ip代理池,那么我们就先搭建自己的ip代理池。   什么是ip代理池,就是很多代理ip地址放到一起足够让你去更换,那么我们从哪里去获取足够多的ip呢,当然很多前人已经帮我们解决问题了我...

2019-01-09 09:20:01 1126 1

原创 Python爬虫+requests+伪装浏览器 爬取小说入门总结

前言:      Python越来越流行,跟着时代的进程,我也不用全身心的投入训练,我也来玩玩Python,想着以后工作应该不会有windows的所以我就去安装了Ubuntu 和win10的双系统,这个现在网上到处都是教程我就不细说了,按着教程来就是,百度是个万能的东西,至于pycharm也一样的。我的配置:Ubuntu16.04+pycharm2018.3(Professional)。...

2019-01-07 17:32:06 5560 2

原创 codeforces 1091D New Year and the Permutation Concatenation 组合数

D. New Year and the Permutation Concatenationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLet nn be an integer. Consider all ...

2018-12-31 11:47:08 525

原创 ZOJ 4062(2018ICPC青岛E) Plants vs. Zombies 思维+二分答案

Plants vs. ZombiesTime Limit: 2 Seconds      Memory Limit: 65536 KBBaoBao and DreamGrid are playing the game Plants vs. Zombies. In the game, DreamGrid grows plants to defend his garden against ...

2018-12-22 10:58:54 495 4

原创 codeforces1090D 思维题

D. Similar Arraystime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard outputVasya had an array of nn integers, each element of the array was...

2018-12-10 16:00:22 414

原创 codeforce 1076D Edge Deletion 最短路+搜索+dij标记在队

D. Edge Deletiontime limit per test2.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an undirected connected weighted graph consistin...

2018-11-15 15:52:46 210

原创 HDU 6230 Palindrome Manacher+树状数组

Alice like strings, especially long strings. For each string, she has a special evaluation system to judge how elegant the string is. She defines that a string S[1..3n−2](n≥2)S[1..3n−2](n≥2) is one-an...

2018-10-09 21:05:02 236 1

原创 UVALive - 6976 //ZOJ 3826 hash+二分查找

In Marjar University, students in College of Computer Science will learn EON (Edward Object Notation), which is a hierarchical data format that uses human-readable text to transmit data objects consis...

2018-10-02 17:10:50 221

原创 2018南京网络赛 G+Lpl and Energy-saving Lamps 线段树预处理

During tea-drinking, princess, amongst other things, asked why has such a good-natured and cute Dragon imprisoned Lpl in the Castle? Dragon smiled enigmatically and answered that it is a big secret. A...

2018-09-02 16:40:28 275

原创 2018南京网络赛 E.AC Challenge 状压dp

 1000ms 128536KAC ChallengeDlsj is competing in a contest with n(0&lt;n≤20)n (0 &lt; n \le 20)n(0&lt;n≤20) problems. And he knows the answer of all of these problems.However, he can submit iii...

2018-09-02 14:48:56 213

原创 codeforces 1029D Concatenated Multiples 预处理+二分

D. Concatenated Multiplestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array aa , consisting of nn positive i...

2018-08-29 10:41:22 390 2

原创 HDU 6424 Rikka with Time Complexity sb数学题

Rikka with Time ComplexityCalculating and comparing time complexity for algorithms are the most important necessary skills for CS students.This semester, Rikka applies for the assistant of course "...

2018-08-22 10:37:11 297

原创 HDU 6398 Pizza Hub 模拟,分内讨论

Pizza Hub Time Limit: 3000/3000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 765    Accepted Submission(s): 166Special Judge   Problem Descripti...

2018-08-21 19:48:05 520

原创 HDU 6406 Taotao Picks Apples 预处理+二分

Taotao Picks ApplesThere is an apple tree in front of Taotao's house. When autumn comes, nn apples on the tree ripen, and Taotao will go to pick these apples.When Taotao picks apples, Taotao scans ...

2018-08-17 10:58:50 185

原创 power oj 2826: 有趣的游戏 spfa+暴力判环(或tarjan缩点)

2826: 有趣的游戏Time Limit: 2000 MS Memory Limit: 9000 KBTotal Submit: 72 Accepted: 1 Page View: 181Submit Status DiscussDescription一天wangshu迷上了一个十分有趣的游戏,名为sdfsfgdsfsdfsdfse,在在游戏里你需要从一个起始补给点开始去寻...

2018-08-15 09:36:33 216

原创 HDU 6395 Sequence 分段矩阵快速幂

题目连接题意:就是求这个数列的前的第n项的值并mod1e9+7。比赛的时候都知道是矩阵快速幂,但是就是不知道后面的向下取整怎么处理,后来看到题解说的是分段矩阵快速幂才恍然大悟。 思路:整个题就是这个后面的那个向下取整不好处理,我的思路是把后面那个看成一个反比例函数 当n在某一定区间内时en是一定的,在前面n比较小的时候变化是比较大的,当n越来越大时en变化越来越小,所以我们把en相...

2018-08-14 14:20:57 159

原创 HDU 6315 Naive Operations 线段树+lazy标记

Naive OperationsTime Limit: 6000/3000 MS (Java/Others)    Memory Limit: 502768/502768 K (Java/Others)Total Submission(s): 2951    Accepted Submission(s): 1303 Problem DescriptionIn a galaxy fa...

2018-08-08 10:33:13 141

原创 hdu 6333 Problem B. Harvest of Apples 莫队+组合数

Problem B. Harvest of ApplesTime Limit: 4000/2000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 2712    Accepted Submission(s): 1062 Problem Description...

2018-08-04 11:00:07 140

原创 牛客多校第一场 D.Two Graphs 暴力全排列+hash图去重

链接:https://www.nowcoder.com/acm/contest/139/D来源:牛客网 题目描述Two undirected simple graphs and where are isomorphic when there exists a bijection on V satisfying  if and only if {x, y} ∈ E2.Given...

2018-07-22 16:16:39 140

原创 codeforces 494(Div3) 1003 F.Abbreviation hash+暴力

F. Abbreviationtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a text consisting of nn space-separated words. There...

2018-07-18 10:25:50 432

原创 codeforces 1005F dfs+bfs+思维

F. Berland and the Shortest Pathstime limit per test5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are nn cities in Berland. Some pairs of cities are connecte...

2018-07-12 11:41:43 427

原创 codeforces 999D 贪心+二分查找

D. Equalize the Remainderstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array consisting of nn integers a1,a2,…,ana1,a2,…,an, a...

2018-06-25 20:24:17 723

原创 牛顿迭代法求平方根及其推广

    一天晚上,本蒟蒻没有写代码,在水群,群里的奆佬说他在面试的时候HR叫他写一个求平方根的代码,这哥们写了一个十分大众的二分,结果那个HR说;”你写的太简单了“!!!,我凸(艹皿艹 ),不就是二分吗?还有其他骚操作?群里的其他奆佬就问:“牛顿迭代法?”,哇~~~开眼界了,今天闲来无事就去看了看,发现数学是真的奇妙。      其他的废话就不扯了,感谢这位叫马同学的奆佬的博客让我浅显的明白了牛顿...

2018-05-06 17:44:41 601

原创 power oj 2610 hash——强大而又温柔的暴力

判断回文串 Time Limit: 2000 MS Memory Limit: 4096 KB Total Submit: 298 Accepted: 50 Page View: 525Submit Status Discuss Description 某天吃饭的时候,FM有了一个帅气idea,其实是个傻逼题?题意很简单,...

2018-05-06 09:54:55 665

原创 poj 3461 hash——温柔的暴力

OulipoTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 46519 Accepted: 18533DescriptionThe French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. H...

2018-05-01 10:34:31 290

原创 51node 1163 贪心

1163 最高的奖励 基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题 有N个任务,每个任务有一个最晚结束时间以及一个对应的奖励。在结束时间之前完成该任务,就可以获得对应的奖励。完成每一个任务所需的时间都是1个单...

2018-04-17 16:46:25 147

原创 poj 1459 多源多汇最大流模板题 Dinic

Power NetworkTime Limit: 2000MS Memory Limit: 32768KTotal Submissions: 29855 Accepted: 15447DescriptionA power network consists of nodes (power stations, consumers and dispatchers) connected by power ...

2018-03-31 11:53:46 477

原创 poj 1273 最大流(三种方法)

Drainage DitchesTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 82153 Accepted: 31914DescriptionEvery time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch....

2018-03-29 15:26:39 313 1

原创 hdu 6242 随机数+克莱姆法则

Geometry Problem                            Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)                                                            Total Submi...

2018-03-17 09:46:45 341

原创 Codeforces dfs

  D. Sleepy Gametime limit per test2 secondsmemory limit per test256 megabytesPetya and Vasya arranged a game. The game runs by the following rules. Players have a directed graph consisting of n verti...

2018-03-09 21:12:58 322

空空如也

空空如也

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

TA关注的人

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