摘要: #include<bits/stdc++.h> using namespace std; const int inf = INT_MAX; void spfa(int v, vector<vector<pair<int, int>>& edge, int sources) { vector<int> 阅读全文
posted @ 2025-04-19 20:30 Qacter 阅读(6) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; const int inf=INT_MAX; void djs(int v,vector<vector<pair<int,int>>>&edge,int sources){ vector<int>dis(v,i 阅读全文
posted @ 2025-04-19 20:29 Qacter 阅读(4) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; #define YES cout<<"YES"<<endl; #define NO cout<<"NO"<<endl; #define endl '\n' #define io ios::sync_with_s 阅读全文
posted @ 2025-04-17 20:21 Qacter 阅读(10) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; #define YES cout<<"YES"<<endl; #define NO cout<<"NO"<<endl; #define endl '\n' #define io ios::sync_with_s 阅读全文
posted @ 2025-04-17 20:19 Qacter 阅读(10) 评论(0) 推荐(0)
摘要: 按位运算的一些属性: a|b = a⊕b + a&b a⊕(a&b) = (a|b)⊕b b⊕(a&b) = (a|b)⊕a (a&b)⊕(a|b) = a⊕b 加法: a+b = a|b + a&b a+b = a⊕b + 2(a&b) 减法: a-b = (a⊕(a&b))-((a|b)⊕a) 阅读全文
posted @ 2025-03-13 10:03 Qacter 阅读(18) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; #define int long long #define YES cout<<"YES"<<endl; #define NO cout<<"NO"<<endl; #define endl '\n' #defi 阅读全文
posted @ 2025-02-27 21:59 Qacter 阅读(20) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; #define int long long #define YES cout<<"YES"<<endl; #define NO cout<<"NO"<<endl; #define endl '\n' #defi 阅读全文
posted @ 2025-02-26 20:20 Qacter 阅读(18) 评论(0) 推荐(0)
摘要: #include <iostream> #include <vector> using namespace std; // 预处理组合数(适用于较小的数) const int mx = 5; int c[mx][mx]; auto init = []() { for (int i = 0; i < 阅读全文
posted @ 2025-02-25 22:01 Qacter 阅读(12) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; const int MOD = 1000000007; // 模数,通常是大素数 const int MAXN = 100000; // 设定最大值 long long fact[MAXN + 1]; // 阶乘数组 阅读全文
posted @ 2025-02-25 21:53 Qacter 阅读(28) 评论(0) 推荐(0)
摘要: const int MOD = 1000000007; // 模数,通常是大素数 const int MAXN = 100000; // 设定最大值 long long fact[MAXN + 1]; // 阶乘数组 long long inv_fact[MAXN + 1]; // 逆阶乘数组 // 阅读全文
posted @ 2025-01-19 13:49 Qacter 阅读(64) 评论(0) 推荐(0)