摘要: 板子 处理模数运算的自定义数据类 点击查看代码 const int mod = 1e9+7; long long ext_gcd(long long a, long long b, long long &x, long long &y) { if (b == 0) { x = 1; y = 0; r 阅读全文
posted @ 2025-10-02 12:12 miao-jc 阅读(29) 评论(0) 推荐(0)
摘要: NTT固定模数 点击查看代码 #include <iostream> #include <vector> #include <algorithm> using namespace std; const int MOD = 998244353; const int G = 3; // 原根 // 快速 阅读全文
posted @ 2025-03-17 23:44 miao-jc 阅读(59) 评论(0) 推荐(0)
摘要: https://github.com/PeterH0323/Streamer-Sales 一些概念: API接口: Application Programming Interface 应用程序编程接口 API接口类似于餐厅的服务员。它规定了: 你要去哪个窗口点菜(URL地址,比如 /api/getD 阅读全文
posted @ 2026-05-10 15:45 miao-jc 阅读(3) 评论(0) 推荐(0)
摘要: 树状数组(Fenwick Tree / Binary Indexed Tree, BIT)是一种维护前缀和的数据结构,支持在 O(log n) 时间内进行单点更新和前缀查询。凭借其代码量小、常数极小的优势,它是竞赛和实际开发中的利器。以下是树状数组的常见用法及对应的C++实现。 0. 基础模板 核心 阅读全文
posted @ 2026-05-09 16:19 miao-jc 阅读(11) 评论(0) 推荐(0)
摘要: 在团体程序设计天梯赛中,字符串操作是高频考点。掌握 C++ 中常用的字符串处理函数能大大提高解题效率。下面按功能分类整理常用函数,涵盖 C 风格字符串(<cstring>) 和 C++ std::string(<string>) 两部分。 介绍 1. 输入输出 函数/方法 作用 示例 cin >> 阅读全文
posted @ 2026-03-29 13:34 miao-jc 阅读(77) 评论(0) 推荐(0)
摘要: constexpr int MAXN = 9999; // MAXN 是一位中最大的数字 constexpr int MAXSIZE = 10024; // MAXSIZE 是位数 constexpr int DLEN = 4; // DLEN 记录压几位 struct Big { int a[MA 阅读全文
posted @ 2025-11-14 20:23 miao-jc 阅读(9) 评论(0) 推荐(0)
摘要: 马拉车只能处理连续回文 #include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; // 标准马拉车:只找一个最长回文子串 string findLongestPa 阅读全文
posted @ 2025-11-12 23:05 miao-jc 阅读(13) 评论(0) 推荐(0)
摘要: mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 这行代码用于创建一个高质量的随机数生成器。让我详细解释每个部分: 完整代码示例 #include <iostream> #include <random> #in 阅读全文
posted @ 2025-11-05 22:11 miao-jc 阅读(61) 评论(0) 推荐(0)
摘要: F12 + (function(){ 'use strict'; $("#comment_form, #header, #leftmenu, #big_banner, #footer, #blog_post_info_block").remove(); $("#content").css('marg 阅读全文
posted @ 2025-10-31 18:02 miao-jc 阅读(3) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; #define int long long #define endl '\n' #define pii pair<int, int> const int mod = 998244353; const int 阅读全文
posted @ 2025-10-31 17:32 miao-jc 阅读(13) 评论(0) 推荐(0)
摘要: 1. 等差数列求和 // 首项a1,末项an,项数n ll arithmetic_sum(ll a1, ll an, ll n) { return n * (a1 + an) / 2; } // 首项a1,公差d,项数n ll arithmetic_sum(ll a1, ll d, ll n) { 阅读全文
posted @ 2025-10-31 17:27 miao-jc 阅读(79) 评论(0) 推荐(0)