摘要: canvas的使用 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title 阅读全文
posted @ 2020-09-24 20:51 特立独行的猪猪 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 1.奇怪的越界问题 a*b%mod 依然可能会越界 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int inf = 0x3f3f3f3f; const int mod = 1e9+7; int ma 阅读全文
posted @ 2020-09-11 17:33 特立独行的猪猪 阅读(93) 评论(0) 推荐(0) 编辑
摘要: Nim游戏解法(L.Bouton定理) (a,b,c)为必败状态 == abc=0 如13128 = 9 (!= 0) 所以先手胜 怎样才能胜?给对手一个必败状态,如13取走剩下4,则4128 = 0,对手必败了 阅读全文
posted @ 2020-09-09 20:45 特立独行的猪猪 阅读(108) 评论(0) 推荐(0) 编辑
摘要: ![](https://img2020.cnblogs.com/blog/2079413/202009/2079413-20200909181533097-1669576513.png) 阅读全文
posted @ 2020-09-09 18:15 特立独行的猪猪 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 基本性质 00 = 11 = 0 01 = 10 = 1 x0 = x 且 xx = 0 交换律:xy = yx 结合律:(xy)z = x(yz) 自反性:xyy = x [交换两个数] int swap(int &a,int &b) { a = a^b; b = a^b; a = a^b; } 阅读全文
posted @ 2020-09-06 18:34 特立独行的猪猪 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 牛客裸题 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int inf = 0x3f3f3f3f; const int maxn = 1e5+5; inline int ls(int p){retur 阅读全文
posted @ 2020-09-05 09:17 特立独行的猪猪 阅读(88) 评论(0) 推荐(0) 编辑
摘要: [递推关系的建立] [矩阵快速幂模板] #include<bits/stdc++.h> using namespace std; typedef long long ll; const int inf = 0x3f3f3f3f; const int mod = 1e9+7; const int N 阅读全文
posted @ 2020-09-02 19:57 特立独行的猪猪 阅读(155) 评论(0) 推荐(0) 编辑
摘要: // ans为第一个符合条件的答案 while l<=r : mid = (l+r) // 2 if ck(mid)==False : l = mid+1 else: ans = mid r = mid-1 print(ans) // ans为最后一个符合条件的答案 while l<=r : mid 阅读全文
posted @ 2020-08-17 23:33 特立独行的猪猪 阅读(65) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<cstring> #include<cstdio> #include<vector> #include<queue> #include<ctime> #include<algorithm> using namespace std; typede 阅读全文
posted @ 2020-08-14 17:46 特立独行的猪猪 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 例题 n的范围是1e5,时间限定1s 如果使用vector+count(g.begin(),g.end(),x),时间复杂度应该是o(n*n) 因为vector是无序的,查找的复杂度应该是o(n) 如果使用set+set.count(val),复杂度o(n*logn) 因为set有序,使用二分查找 阅读全文
posted @ 2020-07-31 19:56 特立独行的猪猪 阅读(262) 评论(0) 推荐(0) 编辑