当前位置: 首页 > news >正文

缺省源

自用,你不见得会用。

快读:

点击查看代码
#define getc() getchar_unlocked()
#define putc(a) putchar_unlocked(a)
#define en_ putc('\n')
#define e_ putc(' ')template<class T> inline T in() { T n = 0; char p = getc();while (p < '-') p = getc();bool f = p == '-' ? p = getc() : 0;do n = n * 10 + (p ^ 48), p = getc();while (isdigit(p));return f ? -n : n;
}
template<class T> inline T in(T &a) { return a = in<T>(); }template<class T> inline void out(T n) {if(n < 0) putc('-'), n = -n;if(n > 9) out(n / 10);putc(n % 10 + '0');
}

不取模

点击查看代码
// code by 樓影沫瞬_Hz17
#include <bits/stdc++.h>
using namespace std;#define getc() getchar_unlocked()
#define putc(a) putchar_unlocked(a)
#define en_ putc('\n')
#define e_ putc(' ')#define int long long
using pii = pair<int, int>;template<class T> inline T in() { T n = 0; char p = getc();while (p < '-') p = getc();bool f = p == '-' ? p = getc() : 0;do n = n * 10 + (p ^ 48), p = getc();while (isdigit(p));return f ? -n : n;
}
template<class T> inline T in(T &a) { return a = in<T>(); }template<class T> inline void out(T n) {if(n < 0) putc('-'), n = -n;if(n > 9) out(n / 10);putc(n % 10 + '0');
}template<class T1, class T2> T1 max(T1 a, T2 b) { return a > b ? a : a = b;}
template<class T1, class T2> T1 min(T1 a, T2 b) { return a < b ? a : a = b;}constexpr int N = 2e5 + 10;signed main() {#ifndef ONLINE_JUDGEfreopen("i", "r", stdin);freopen("o", "w", stdout);#endif}   
// 星間~ 干渉~ 融解~ 輪迴~ 邂逅~ 再生~ ララバイ~

取模:

点击查看代码
// code by 樓影沫瞬_Hz17
#include <bits/stdc++.h>
using namespace std;#define getc() getchar_unlocked()
#define putc(a) putchar_unlocked(a)
#define en_ putc('\n')
#define e_ putc(' ')template <int MOD> struct modint {int val;static int norm(const int& x) { return x < 0 ? x + MOD : x; }static constexpr int get_mod() { return MOD; }modint inv() const {assert(val);int a = val, b = MOD, u = 1, v = 0, t;while (b > 0) t = a / b, swap(a -= t * b, b), swap(u -= t * v, v);assert(b == 0);return modint(u);}modint() : val(0) {}modint(const int& m) : val(norm(m)) {}modint(const long long& m) : val(norm(m % MOD)) {}template<typename T> modint(const T m) : val(norm((long long)m % MOD)) {}template<class T> operator T() const { return val; }modint operator-() const { return modint(norm(-val)); }bool operator==(const modint& o) { return val == o.val; }bool operator<(const modint& o) { return val < o.val; }bool operator>(const modint& o) { return val > o.val; }bool operator<=(const modint& o) { return val <= o.val; }bool operator>=(const modint& o) { return val >= o.val; }modint& operator+=(const modint& o) { return val = (1ll * val + o.val) % MOD, *this; }modint& operator-=(const modint& o) { return val = norm(1ll * val - o.val), *this; }modint& operator*=(const modint& o) { return val = static_cast<int>(1ll * val * o.val % MOD), *this; }modint& operator/=(const modint& o) { return *this *= o.inv(); }modint& operator%=(const modint& o) { return val %= o.val, *this; }modint& operator^=(const modint& o) { return val ^= o.val, *this; }modint& operator>>=(const modint& o) { return val >>= o.val, *this; }modint& operator<<=(const modint& o) { return val <<= o.val, *this; }modint operator-(const modint& o) const { return modint(*this) -= o; }modint operator+(const modint& o) const { return modint(*this) += o; }modint operator*(const modint& o) const { return modint(*this) *= o; }modint operator/(const modint& o) const { return modint(*this) /= o; }modint operator%(const modint& o) const { return modint(*this) %= o; }modint operator^(const modint& o) const { return modint(*this) ^= o; }modint operator>>(const modint& o) const { return modint(*this) >>= o; }modint operator<<(const modint& o) const { return modint(*this) <<= o; }friend std::istream& operator>>(std::istream& is, modint& a) {long long v;return is >> v, a.val = norm(v % MOD), is;}friend std::ostream& operator<<(std::ostream& os, const modint& a) { return os << a.val; }friend std::string tostring(const modint& a) { return std::to_string(a.val); }
};
using mint = modint<1000000009>;
using pii = pair<int, int>;template<class T> inline T in() { T n = 0; char p = getc();while (p < '-') p = getc();bool f = p == '-' ? p = getc() : 0;do n = n * 10 + (p ^ 48), p = getc();while (isdigit(p));return f ? -n : n;
}
template<class T> inline T in(T &a) { return a = in<T>(); }template<class T> inline void out(T n) {if(n < 0) putc('-'), n = -n;if(n > 9) out(n / 10);putc(n % 10 + '0');
}template<class T1, class T2> T1 max(T1 a, T2 b) { return a > b ? a : a = b;}
template<class T1, class T2> T1 min(T1 a, T2 b) { return a < b ? a : a = b;}const int N = 2.5e4 + 10, mod = 1000000009;signed main() {#ifndef ONLINE_JUDGEfreopen("i", "r", stdin);freopen("o", "w", stdout);#endif}   
// 星間~ 干渉~ 融解~ 輪迴~ 邂逅~ 再生~ ララバイ~
http://www.wxhsa.cn/company.asp?id=6037

相关文章:

  • 97. 交错字符串
  • MODint(自动取模)
  • BFD实验
  • 2025.9.16——卷1阅读程序1、2
  • 用Context Offloading解决AI Agent上下文污染,提升推理准确性
  • HCIP-BFD
  • MISC相关
  • VRRP实验
  • 在 Windows 10 上安装 FFmpeg 8.0
  • 25/9/15(补)
  • [Paper Reading] DINOv3
  • 25/9/16
  • JavaDay5
  • 揭秘Mobile Me数据挖掘:从WebDAV探测到隐藏文件发现
  • 25/9/14(补)
  • 【IEEE出版、往届会后4个月EI检索】第二届计算机视觉、图像处理与计算摄影国际学术会议(CVIP 2025)
  • 洛谷 P10936 导弹防御塔 题解
  • P13694 [CEOI 2025] Splits 题解
  • VSCode + Python 开发踩坑:虚拟环境不在项目根目录导致包无法识别该怎么办
  • 图像与视频编码
  • Python爬虫实战:研究Pandas,构建地理信息资料采集和分析便捷的系统
  • 初赛复习
  • 用户帐户控制(UAC)
  • fg/bg/jobs/kill命令--linux
  • 【OC】单例模式 - 教程
  • ios电脑系统和windows系统
  • HCIP-VRRP
  • JSON Schema 校验是什么?面试时怎么说?
  • 【征文启动】IvorySQL PostgreSQL 迁移实战经验征集:分享你的技术沉淀,赢取专属好礼!
  • MCP的天气预报的使用