摘要:
问题 D: Olympic Bus 时间限制: 1 Sec 内存限制: 128 MB 题目描述 There are N cities in JOI Kingdom, numbered from 1 to N. There are M bus lines connecting cities, numb 阅读全文
摘要:
```c++ ll pow_mod(ll a,ll b) { ll res = 1; while (b) { if (b & 1) res = res * a % mod; a = a * a % mod; b >>= 1; } return res; } ``` 阅读全文
摘要:
```#include using namespace std;const int maxn=1e5+10;int a[maxn];int n;int up(int n) { int i = n; while (i != 1 && a[i] a[i + 1]) { i++; } if (a[i] = 1; i--) { ... 阅读全文
摘要:
#include using namespace std; typedef long long ll; ll f[30][30][30]; ll n; int main() { while (~scanf("%lld",&n)) { f[0][1][1]=1; for (int i=1... 阅读全文
摘要:
#pragma GCC optimize(3,"Ofast","inline") #include <bits/stdc++.h> using namespace std; typedef long long ll; const ll maxn=1000005; int prime[maxn/10],phi[maxn]; bool vis[maxn]; int tot; inline int gc 阅读全文
摘要:
问题 A: 招待 题目描述 请了两位奆老来为自己种树,小X也稍稍有些不好意思了,于是他准备了一些零食和饮料来招待奆老们。然而,小X有强迫症,他希望自己和好基友们所有的零食和饮料的质量都要完全相同。由于小X是一个奆老,所以他看不起普通商店里卖的电子秤,他决定自己做一个。他的称重工具是一架由金子制成的天 阅读全文
摘要:
https://blog.csdn.net/qq_42555009/article/details/87253503 阅读全文
摘要:
题解 有n个花坛,要选s支花,每个花坛有f[i]支花,同一个花坛的花颜色相同,不同花坛的花颜色不同,问说可以有多少种组合。 2^n的状态,枚举某些花坛的花超过了,剩下的用隔板法计算个数,再加个容斥原理就行了 ————————————————————————————————————————————- 阅读全文