
STL
stl
yjr-1100
( ´・ω・)ノ(._.`),关注我,一起学习
展开
-
CodeForces - 1325B CopyCopyCopyCopyCopy (排序+unique去重)
CodeForces - 1325B CopyCopyCopyCopyCopy 题目分析: 这个题就是找 不重复的元素有多少个,排序+去重就好了,这里主要想学一个STL 的去重函数 AC代码: #include<iostream> #include<cmath> #include <cstring> #include<stdio.h> #...原创 2020-03-15 16:12:21 · 393 阅读 · 0 评论 -
CodeForces - 1324D Pair of Topics (分治+排序)
CodeForces - 1324D Pair of Topics 题目大意: 这题大意ai+aj>bi+bj全在这个式子上,就问你满足的组合有几种, 题目分析: 整理一下,得到(ai-bi)+(aj-bj)>0 ,所以现在我们就只用做个差,然后找有几种组合就好了, 开始比较笨,tle了一发,后来才知道要分治一下,我们给做差后的数组排个序,每次找到比自己大的第一个数的下标,...原创 2020-03-15 15:54:39 · 475 阅读 · 0 评论 -
洛谷 P1012——拼数 (STL string 类的学习)
#include<iostream> #include<cmath> #include <algorithm> #include <cstring> using namespace std; string a[100]; bool cmp(string &a,string &b) { return a+b>b+a;//自...原创 2020-03-15 07:45:16 · 325 阅读 · 0 评论 -
C/C++ HDU1896 Stones (优先队列)
HDU1896 Stones 题目: Because of the wrong status of the bicycle, Sempr begin to walk east to west every morning and walk back every evening.Walking may cause a little tired, so Sempr always play som...原创 2019-12-06 21:10:22 · 468 阅读 · 0 评论 -
C/C++ priority_queue的自定义比较方式
此文章转载自AAMahone的博客 经常需要用优先队列来进行一些算法的优化,于是今天对优先队列的排序方式做一个小结: 首先,先看代码(小堆栈): #include<queue> #include<vector> #include<iostream> using namespace std; struct node { int x, y; no...转载 2019-12-06 20:41:14 · 1818 阅读 · 0 评论 -
Codeforces 583C GCD Tabl
Codeforces 583C GCD Tabl 题目 The GCD table G of size n × n for an array of positive integers a of length n is defined by formula Let us remind you that the greatest common divisor (GCD) of two positi...原创 2019-12-05 21:37:14 · 246 阅读 · 1 评论