跳到正文

Gloria_F

864725

⎛⎝≥⏝⏝≤⎛⎝ 在那之前 你要多想__

在洛谷打开
资料、奖项与版本

资料

编号
864725
抓取
代码
display: none;

皎月半洒花

说句闲话:研究珂学的最好方法是

终章 即将来到---

AFO ing

缺省源

C++
//#include "bits/stdc++.h"
//#include "algorithm"
#include "iostream"
#include "cstring"
#include "cstdio"
#include "cmath"
#define endl "\n"
#define il inline
#define ilv inline void
#define inf 0x3f3f3f3f
#define mem(a, b) memset(a, b, sizeof a);
#define bug cout << endl << " .....here!...." << endl;
typedef unsigned long long ull;
typedef long long ll;
typedef char cahr;
using namespace std;

int main() {
//	freopen("P.in","r",stdin);
//	freopen("P.out","w",stdout);

	return 0;
}// by Gloria_F
C++
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
#include "ext/rope"
#include "iostream"
#include "algorithm"
#include "cstring"
#include "random"
#include "cstdio"
#include "vector"
#include "stack"
#include "cmath"
#include "queue"
#include "map"
#include "set"
#define CLOSE ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define isd(c) ('0' <= (c) && (c) <= '9')
#define isa(c) ('a' <= (c) && (c) <= 'z')
#define isA(c) ('A' <= (c) && (c) <= 'Z')
#define mem(a, b) memset(a, b, sizeof a);
#define N 200005
#define M 2000005
#define mod 1000000007
#define inf 0x3f3f3f3f
#define infll 0x3f3f3f3f3f3f3f3f
#define PI acos(-1)
#define endl "\n"
#define pii pair<int, int>
#define F first
#define S second
#define bug cout << endl << " .....here!...." << endl;
#define il inline
#define ilv inline void
//#pragma GCC optimize("O3")
typedef long long ll;
typedef unsigned long long ull;
typedef char cahr;
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;

int main() {
//	freopen("P.in","r",stdin);
//	freopen("P.out","w",stdout);
	CLOSE
	
	
	return 0;
}




// by Gloria_F
共 1 篇
  1. 个人记录

    nth_element()用法详解

    nth_element() 是 C++ 库中的函数模板,用于对序列进行部分重排。其核心功能是找到第 n 小的元素(默认升序)并将其移动到第 n 个位置,同时确保该位置之前的元素都比它小,之后的元素都比它大(自定义规则下逻辑相反)。 主要要点如下: 语法格式:支持默认升序排序和自定义比较规则 comp 两种形式,参数包含起始迭代器 first、目标位置迭代器 nth 和结束迭代器 last。 适用条件:仅适用于支持随机访问迭代器的容器(如 vector、deque、array);元素类型需支持相应的比较运算符;若存储自定义类对象,该类需提供移动构造函数和移动赋值运算符。 使用示例:文中通过代码演示了如何在 std::vector 中分别使用默认升序和自定义降序规则调用该函数。

    4 赞