摘要: D - Neighbor Distance set模拟 #include<bits/stdc++.h> using namespace std; #define endl '\n' #define yes cout << "Yes" << endl #define no cout << "No" < 阅读全文
posted @ 2025-11-19 14:25 arin876 阅读(9) 评论(0) 推荐(0)
摘要: D - Robot Customize 头部最多m/2,对于头部做背包,最初是全放在身体上,一步一步换代价 #include<bits/stdc++.h> using namespace std; #define endl '\n' #define yes cout << "Yes" << endl 阅读全文
posted @ 2025-11-11 08:09 arin876 阅读(12) 评论(0) 推荐(0)
摘要: B4080 [语言月赛 202412] 聪明猪猪大赛 签到 P10114 [LMXOI Round 1] Size 诈骗qaq,值域个数是sqrt(n)级别的,暴力 #include<bits/stdc++.h> using namespace std; #define endl '\n' #def 阅读全文
posted @ 2025-11-05 21:54 arin876 阅读(6) 评论(0) 推荐(0)
摘要: Maximum Subarray Sum 将所有的0位置填-1e18,就不用分段求最大值m k<m,不行,怎么加都可以取当前的一段达到m k==m,就这样就可以 k>m,可以这样构造 找到最左边的0,前缀和后缀最大加上他是k即可,别的再怎么加也达不到k #include<bits/stdc++.h> 阅读全文
posted @ 2025-11-01 12:15 arin876 阅读(2) 评论(0) 推荐(0)
摘要: D - Santa Claus 2 map<int,set> E - Snowflake Tree 开始想到枚举中心点,x=度数,y=min儿子度数-1,其余全要删除,删除越少留下越多,留下1+x+xy,删n-(1+x+xy) 样例1告诉我们可以删除某个子树,这样还是y=min儿子度数-1,就排序, 阅读全文
posted @ 2025-10-29 22:57 arin876 阅读(5) 评论(0) 推荐(0)
摘要: D - 2x2 Erasing 2 状压 E - Cut in Half 暴力,O(nlogK) #include<bits/stdc++.h> using namespace std; #define endl '\n' #define yes cout << "Yes" << endl #def 阅读全文
posted @ 2025-10-29 22:48 arin876 阅读(5) 评论(0) 推荐(0)
摘要: D - Gravity 每一行消除,得等所有在这一行消除的都落到这一行 每一列也是按顺序消除 #include<bits/stdc++.h> using namespace std; #define endl '\n' #define yes cout << "Yes" << endl #defin 阅读全文
posted @ 2025-10-19 13:08 arin876 阅读(9) 评论(0) 推荐(0)
摘要: 开始训练 ↓ 初始化模型、优化器、调度器 ↓ 循环每个epoch ↓ 循环每个batch(支持梯度累积) ↓ 混合精度前向传播 + 多损失计算 ↓ 梯度累积检查 → 未满:继续累积 ↓ 已满: 梯度裁剪 + 参数更新 + 学习率调整 ↓ 定期验证 + 早停检查 ↓ 保存最佳模型 + 训练日志 ↓ 早 阅读全文
posted @ 2025-10-12 21:23 arin876 阅读(10) 评论(0) 推荐(0)
摘要: D - Pigeon Swap 想到并查集,挂在哪个点上 其实也用不上并查集 #include<bits/stdc++.h> using namespace std; #define endl '\n' #define yes cout << "Yes" << endl #define no cou 阅读全文
posted @ 2025-10-11 14:27 arin876 阅读(6) 评论(0) 推荐(0)
摘要: E - Min of Restricted Sum 构造a[1~n] 所以每一位独立, 对于每一位来说,就是边权为0或者1,点权0或者1,同一个连通块中只要确定一个,其余就确定 了,dfs也就两种,第一个点取0或1,取最小的加上即可 #include<bits/stdc++.h> using nam 阅读全文
posted @ 2025-10-11 02:10 arin876 阅读(6) 评论(0) 推荐(0)