摘要: 在函数中当作pass使用 def f(): ... 在numpy中的使用: 当作索引的省略 b = np.arange(12).reshape(2, 3, 2) print(b) """ [[[ 0 1] [ 2 3] [ 4 5]] [[ 6 7] [ 8 9] [10 11]]] """ pri 阅读全文
posted @ 2024-01-06 22:14 Angels_of_Death 阅读(49) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define endl "\n" using namespace std; typedef long long LL; co 阅读全文
posted @ 2022-03-06 23:53 Angels_of_Death 阅读(30) 评论(0) 推荐(0)
摘要: 状态表示$f[i][j][l][sum]$ 从前$i$个选,且第$i$个数为$j$,加上j后的递减序列的长度为$l$,以及当前所有数的总和为$sum$的方案数 状态转移 \[ if (j >= k) \quad f[i][j][1][sum + j] = (f[i][j][1][sum + j] + 阅读全文
posted @ 2022-03-06 23:22 Angels_of_Death 阅读(54) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define endl "\n" #define IT set<node>::iterator using namespac 阅读全文
posted @ 2022-03-04 23:38 Angels_of_Death 阅读(32) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define endl "\n" #define LL long long using namespace std; con 阅读全文
posted @ 2022-03-01 23:09 Angels_of_Death 阅读(47) 评论(0) 推荐(0)
摘要: 带权并查集 #include <bits/stdc++.h> #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define endl "\n" #define LL long long using namespace st 阅读全文
posted @ 2022-02-28 23:31 Angels_of_Death 阅读(36) 评论(0) 推荐(0)
摘要: 题目等价于计算$M^{k^{N}} \ mod \ P$ 由费马小定理$M^{p-1} \equiv 1(mod \ P)$ 原式等于$M^{q(p-1)+r} mod \ P$其中$r=K^N mod(P-1)$ #include <bits/stdc++.h> #define IOS ios:: 阅读全文
posted @ 2022-02-28 23:03 Angels_of_Death 阅读(30) 评论(0) 推荐(0)
摘要: 并查集 $p[i]$表示当前要插入的位置第一个可用位置 $a[i]$表示当前位置的值 #include <bits/stdc++.h> #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define endl "\n" #d 阅读全文
posted @ 2022-02-28 22:58 Angels_of_Death 阅读(28) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> #define x first #define y second #define LL long long #define PII pair<int, int> using namespace std; const int N = 510; int 阅读全文
posted @ 2022-02-26 08:00 Angels_of_Death 阅读(32) 评论(0) 推荐(0)
摘要: 特判$X \geq 10^9$的情况 剩下情况暴力枚举 #include <bits/stdc++.h> #define LL long long using namespace std; LL n; int main() { scanf("%lld", &n); if (n >= 1e10) { 阅读全文
posted @ 2022-02-24 22:30 Angels_of_Death 阅读(32) 评论(0) 推荐(0)