![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法学习记录
Cantredo
此等萌新也只能划划水,仰望dalao的背影了....
展开
-
Codeforces Round 450 Div2 B.Jzzhu and Sequences
B. Jzzhu and Sequences time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Jzzhu has invented a kind of sequences, they meet the follo...原创 2018-11-29 23:26:34 · 202 阅读 · 0 评论 -
POJ 2299 Ultra QuickSort
Ultra-QuickSort | Time Limit: 7000MS | | Memory Limit: 65536K | | Total Submissions: 72479 | | Accepted: 27197 | Description In this problem, you have to analyze a particular sorting algorithm. T...原创 2018-11-01 22:49:35 · 209 阅读 · 0 评论 -
POJ 2387 Til the Cows Come Home
Til the Cows Come Home | Time Limit: 1000MS | | Memory Limit: 65536K | | Total Submissions: 76501 | | Accepted: 25456 | Description Bessie is out in the field and wan...原创 2018-10-30 23:05:21 · 244 阅读 · 0 评论 -
POJ 1562 Oil Deposits
Oil Deposits | Time Limit: 1000MS | | Memory Limit: 10000K | | Total Submissions: 21879 | | Accepted: 11397 | Description The GeoSurvComp geologic survey company is responsible for detecting under...原创 2018-10-31 22:56:33 · 211 阅读 · 0 评论 -
51Nod 1174 区间中最大的数
1174 区间中最大的数 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注 描述 给出一个有N个数的序列,编号0 - N - 1。进行Q次查询,查询编号i至j的所有数中,最大的数是多少。 例如: 1 7 6 3 1。i = 1, j = 3,对应的数为7 6 3,最大的数为7。(该问题也被称为RMQ问题) Input 第1行:1个数N,表示序列的长度。(2...原创 2018-10-18 23:08:25 · 152 阅读 · 0 评论 -
Codeforces Round #512 B.Vasya and Cornfield
title: ‘Codeforces Round #512 B.Vasya and Cornfield’ date: 2018-10-17 21:21:01 categories: tags: B. Vasya and Cornfield time limit per test1 second memory limit per test:256 megabytes input:stand...原创 2018-10-17 22:04:22 · 156 阅读 · 0 评论 -
P1579 哥德巴赫猜想(升级版)洛谷 (C++)(筛法选素数)
两层循环找到其中两个值,最后一个值由输入的num减去他们的和可得到,若都是质数则可以输出 筛法选素数可稍微优化判断素数的时间 代码如下 #include<stdio.h> #include<cstring> #include<algorithm> #include<vector> #include<map> #include<...原创 2018-09-21 22:10:09 · 454 阅读 · 0 评论 -
51Nod 1117 聪明的木匠
聪明的木匠 题目来源: 河北大学算法艺术协会 基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题 收藏 关注 描述 一位老木匠需要将一根长的木棒切成N段。每段的长度分别为L1,L2,…,LN(1 <= L1,L2,…,LN <= 1000,且均为整数)个长度单位。我们认为切割时仅在整数点处切且没有木材损失。 木匠发现,每一次切割花费的体力与该木棒的长...原创 2018-10-03 16:10:28 · 179 阅读 · 0 评论 -
P1177 【模板】快速排序 洛谷(c++)(模版)
快速排序模版,代码如下: #include <iostream> #include <algorithm> #include <string> #include <cstring> #include <vector> #define ll long long using namespace std ; pair<int,int&g...原创 2018-10-02 19:29:16 · 272 阅读 · 0 评论 -
[快速幂]a^b
问题 A: 【快速幂】a^b 时间限制: 1 Sec 内存限制: 128 MB 提交: 703 解决: 159 [提交] [状态] [讨论版] [命题人:admin] 题目描述 求 a 的 b 次方对 p 取模的值,其中 1≤a,b,p≤109 输入 三个用空格隔开的整数a,b和p。 输出 一个整数,表示ab mod p的值。 样例输入 2 3 9 样例输出 8 快速幂模板,代码如下: ...原创 2018-09-24 19:54:16 · 549 阅读 · 0 评论 -
经典排序算法(冒泡排序 Bubble Sort)注解及代码实现(c++、java)
冒泡排序1.简介:冒泡排序(Bubble Sort)是一种简单的排序算法,通过重复的两两比较两个元素,若大小顺序关系不正确,则交换两个元素的位置,符合要求的元素会慢慢“浮”到数组顶端或尾端,故名冒泡排序。2.算法思想: (1)两两比较相邻元素,若大小关系不合要求,交换两个数组元素。 (2)从开始的第一对相邻元素到最后一对相邻元素,两两比较交换完后最后一个数将会是最大的元素。...原创 2018-03-30 21:03:09 · 345 阅读 · 0 评论 -
模版以及数学知识总结 (c ++) (持续更新)
1.堆排序(建堆与堆的操作)#include <iostream> #include <algorithm> #include <string> #include <cstring> #include <vector> using namespace std ; void heapInsert(vector<int> &am...原创 2018-04-07 21:13:33 · 183 阅读 · 0 评论 -
HDU 1575 Tr A
Tr A **Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7631 Accepted Submission(s): 5575** Problem Description A为一个方阵,则Tr A表示A的迹(就是主对角线上各项的和...原创 2018-11-30 23:03:19 · 210 阅读 · 0 评论