跳到正文

Eason_wu

367998

莫若以明 | 个人小站wuuoicn

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

资料

编号
367998
抓取

奖项

2025 CSP-S
一等奖

wuuoi https://www.luogu.com.cn/team/134382

写宝石 3月月赛

C++
#include<bits/stdc++.h>
using namespace std;
#define x first
#define y second
#define pb push_back
#define eb emplace_back
#define all(a) begin(a),end(a)
#define siz(x) ((int)size(x))
#define pt printf
#define db(...) fprintf(stderr,__VA_ARGS__)
#define fr(i,s,t) for(int i=(s);i<=(t);i++)
#define rf(i,s,t) for(int i=(s);i>=(t);i--)
#define IO(f1,f2) (f1!=""&&freopen(f1,"r",stdin),f2!=""&&freopen(f2,"w",stdout))
#ifdef DEBUG
#include "/home/wu/C/debug/d.cpp"
#else
#define assert(...) 0
#define Z(...) 0
#define ZZ(...) 0
#endif
typedef long long LL;
typedef double RL;
//typedef __int128 Int;
mt19937 gen(chrono::steady_clock::now().time_since_epoch().count());
template<typename T>bool tomax(T&x,const T&y){if(x<y)return x=y,true;return false;}
template<typename T>bool tomin(T&x,const T&y){if(x>y)return x=y,true;return false;}
inline void rd(auto&x,auto&...y){char ch;bool f=0;while(!isdigit(ch=getchar()))if(ch=='-')f=1;x=0;do{x=(x<<1)+(x<<3)+(ch^48);}while(isdigit(ch=getchar()));if(f)x=-x;if constexpr(sizeof...(y))rd(y...);}
inline void wt(auto&&x,auto&&...y){cout<<x;if constexpr(sizeof...(y))cout<<' ',wt(y...);}
inline void wtl(auto&&x,auto&&...y){cout<<x;if constexpr(sizeof...(y))cout<<' ',wtl(y...);else cout<<"\n";}

const int N=1e6+33;
int n,a[N];

void so(){}
signed main(){
	int T=1;
	rd(T);
	while(T--)so();
	return 0;
}
C++
#include<bits/stdc++.h>
#define fr(i,a,b) for(int i=(a);i<=(b);i++)
#define rf(i,a,b) for(int i=(a);i>=(b);i--)
#define eb emplace_back
#define pb push_back
#define pii pair<int,int>
#define siz(x) ((int)x.size())
#define all(x) x.begin(),x.end()
#define pc putchar
#define gc getchar
#define x first
#define y second
#define FILE(f1,f2) {freopen(f1,"r",stdin);freopen(f2,"w",stdout);}
#define Z(x...) cout<<"#"<<__LINE__<<":  ",db(#x,x)
#define ZZ(a,x,y) {cout<<"@"<<__LINE__<<":  "<<#a<<" = ";for(int i=(x);i<=(y);i++)cout<<a[i]<<" ";cout<<"\n";}
using namespace std;
void db(const char*s){cout<<"\n";}
template<typename T,typename...TT>void db(const char*s,T x,TT...y){cout<<"# ";while((*s)&&(*s!=','))cout<<(*s++);s++;cout<<" = ";cout<<x<<" ";db(s,y...);}


signed main(){
    return 0;
}
C++
#ifndef ONLINE_JUDGE
#define DF(T) void prt(T x){cout<<x;}
DF(int)DF(char)DF(string)
void prt(auto x);
void prt(pair<auto,auto> x){pc('{');prt(x.first);pc(',');prt(x.second);pc('}');}
void pp(auto x,auto y){pc('{');for(;x!=y;++x){prt(*x);pc(',');}printf("\b}");}
void pp(auto x,int y){prt(x,x+y);}
void prt(auto x){pp(begin(x),end(x));}
void pl(auto x,auto...y){prt(x);if constexpr(sizeof...(y))wtl(y...);else pc('\n');}
void ppl(auto x,auto xx,auto...y){prt(x);if constexpr(sizeof...(y))wtl(y...);else pc('\n');}
#define Z(x) cout<<#x<<":",pl(x)
#define ZZ(x) cout<<#x<<":",ppl(x)
#else
#define Z(...)
#define ZZ(...)
#endif

https://atcoder.jp/contests/abc307/tasks/abc307_g

如无必要,勿增实体

template.cpp d.cpp 模板(线段树)


板子 banzi 409

与其站在原地思考,不如一步一步地往前走吧,就算昨天的足迹会消失不见,哪怕通往明天的道路隐没在黑暗中,即便如此……也不要一味地回首过去,不要对未来悲观失望,只需尽情地感受当下。因为不管你如何反抗,时间总是会不断推着你前进

随机图片

共 3 篇
  1. 个人记录

    useful functions

    bool is_sorted(bg,ed) checks if the elements in bg,ed)is sorted in non-descending order. T max_element(bg,ed) and T min_element(bg,ed) retur…

  2. 科技·工程

    函数小测试

    该C++代码对比了普通函数、内联函数及三种Lambda表达式(无捕获、值捕获、引用捕获)的执行效率。通过一亿次迭代计算,结果发现: 值捕获Lambda在两种编译优化模式下均表现最优(优化模式162218微秒,未优化188360微秒),可能因变量直接复制避免了引用开销; 内联函数比普通函数更快(优化185060 vs 349812微秒),但性能仍低于值捕获Lambda; 无捕获Lambda性能最差(优化207817微秒,未优化369105微秒),可能因Lambda语法开销或参数传递机制; 引用捕获Lambda性能最不稳定(优化231876微秒,未优化234244微秒),可能因引用处理导致额外内存访问开销。 最终结果因volatile关键字导致计算值不可预测,但时间测试表明值捕获Lambda在效率上具有优势。

  3. 个人记录

    NOIP2023记

    t1 签到题,对每个串升序排序,求出前,后缀最大值的下标,forall1≤ i ≤ n将该串的降序排列与前后缀最小串比较即可。 t2 带权并查集,把每个数字 i 初始连到 n+i 然后模拟,连边,若冲突,将根节点设为0(unkown) 调了30min想到虚点 模拟即可。 t3 8…