wxy

输入输出加速

const char endl = '\n'; std::ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);

吴晓阳 吴晓阳 发布于 2024-10-24

编译优化

#pragma GCC optimize(3,"Ofast","inline") #pragma G++ optimize(3,"Ofast","inline")

吴晓阳 吴晓阳 发布于 2024-10-24

c++ lambda表达式

[capture list] (parameters) -> return_type { // 函数体 }; #include <iostream> #include <vector> #include <algorithm> struct Node { int v;

吴晓阳 吴晓阳 发布于 2024-10-20

快速幂

递归快速幂 //递归快速幂 int qpow(int a, int n) { if (n == 0) return 1; else if (n % 2 == 1) return qpow(a, n - 1) * a; else {

吴晓阳 吴晓阳 发布于 2024-01-02

四舍六入五成双

四舍六入五成双 #include<bits/stdc++.h> using namespace std; int main(){ printf("%.2f\n",9.825); //输出9.82 printf("%.2f\n",9.825001); //输出9.83 printf("%.2f\

吴晓阳 吴晓阳 发布于 2023-12-18

lower_bound & upper_bound

lower_bound & upper_bound #include<bits/stdc++.h> using namespace std; int main(){ vector<int> v={1,2,3,4,5}; auto p = lower_bound(v.begin(),v.end(

吴晓阳 吴晓阳 发布于 2023-12-18
吴晓阳 吴晓阳 发布于 2023-11-18

树的数据结构定义

#include&lt;bits/stdc++.h&gt;using namespace std;const int m = 10; //树的度typedef struct node Node;typedef node *tree;struct node{char data;

吴晓阳 吴晓阳 发布于 2023-05-23