![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
acm
minghan13
啊哦
展开
-
二维平面几何模板(kuangbin)
#define _CRT_SECURE_NO_WARNINGS #include "bits/stdc++.h" using namespace std; typedef long long ll; const double inf = 1e20; const double eps = 1e-8; const double pi = acos(-1.0); const int maxp = 1010; //判断正负 int sgn(double x) { if (fabs(x) < eps) re原创 2021-08-28 11:20:14 · 238 阅读 · 0 评论 -
多重背包二进制优化
#include "bits/stdc++.h" using namespace std; const int maxn = 25000; int N, V; int w[maxn], v[maxn], dp[maxn]; int main(){ cin >> N >> V; int cnt = 0; for (int i = 1; i <= N; i++){ int wi, vi, s; cin >> wi >> vi >>原创 2021-04-07 23:21:05 · 161 阅读 · 0 评论 -
快速幂+快速乘模板
#include "bits/stdc++.h" using namespace std; typedef long long ll; inline ll ksc(ll x, ll y, ll mod) { return (x * y - (ll)((long double)x / mod * y) * mod + mod) % mod; } inline ll ksm(ll x, ll y, ll mod) { ll ans = 1; while (y) { if (y) ans = ksc(原创 2021-03-20 13:30:58 · 73 阅读 · 0 评论 -
acm博弈论基础
一、Bash Game(巴什博弈) 一堆n个物品,两个人轮流从中取出1~m个,最后取光者胜(不能继续取的人输)。 1,分析:首先n一定可以表示为:n = k * (m + 1) + r (0 <= r <= m); 2,代码: if (n % (m + 1)) return false; else return true; 二、Wythoff Game(威佐夫博弈) 有两堆各若干物品,两个人轮流从任意一堆中至少取出一个或者从两堆中取出同样多的物品,规定每次至少取一个,至多不限,最后取光者原创 2021-01-31 17:28:43 · 160 阅读 · 0 评论