STL
AimerAimerAimer
我人很懒,什么都没写
展开
-
multiset Minimum Array CodeForces - 1157E
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <set> #define ll long long #define inf 0x3f3f3f3f using namespace std; const int N=2e5+5; int n,a[N],x; int main() { multiset<int&原创 2020-06-02 23:40:04 · 105 阅读 · 0 评论 -
STL (multiset) 18731 最接近的值
18731 最接近的值 时间限制:1000MS 代码长度限制:10KB 提交次数:0 通过次数:0 题型: 编程题 语言: 不限定 Description 查找特定的值是一种常见的操作,当数据量较大时,往往需要使用高效的结构和查找算法。 n个整数组成的序列,请输出所有元素左侧与它值最为接近的值,我们定义“最接近”为两数之差的绝对值最小。 例如序列 5 1 4 2,1最接近值为5,4最接近值为5,2最接近值为1。 特别的,第一个数的最接近值为它自身。 如果一个数左侧有两个不同的值,绝对值差都是最小。例如原创 2020-06-02 13:20:54 · 381 阅读 · 0 评论