上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 56 下一页
摘要: #include<opencv2/core/core.hpp> #include<opencv2/imgproc/imgproc.hpp> #include<opencv2/highgui/highgui.hpp> #include<opencv2/opencv.hpp> #include<bits 阅读全文
posted @ 2020-09-06 10:42 WeiAR 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 先把 1,10,100,1000,...这些数拿出来那么还剩下2^n-n个数,子集个数为2^(2^n-n),if k:对于任何一个子集,base都可以用唯一的方案凑出来else !k:会出现一个空集的情况,要-1另外用扩展欧拉公式降幂的时候,主要使用条件 #include <bits/stdc++. 阅读全文
posted @ 2020-08-23 09:51 WeiAR 阅读(116) 评论(0) 推荐(0) 编辑
摘要: CodeForces - 715B 先判断impossible的情况1. 0边全赋值为1,此时最短路>L2. 0边全赋值为inf,此时最短路<L 我们按读入顺序对0边进行排列,然后我们二分找到第一个必经0边,假设它在0边中的下标是第i个,那么1~i的0边为1,i+1~cnt的0边为inf(就是这些边 阅读全文
posted @ 2020-08-22 09:57 WeiAR 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 为什么欧拉图要用栈存然后逆着输出41 21 33 44 1考虑这样一组样例,你就可以发现,如果是第一种方式输出为1 2 3 4 1显然是不对的,第二种是对的主要的影响还是在欧拉路和欧拉回路上 阅读全文
posted @ 2020-08-14 17:37 WeiAR 阅读(152) 评论(0) 推荐(0) 编辑
摘要: The Flee Plan of Groundhogdfs相向而行就距离-3,时间+1背道而驰就距离-1,时间+1注意土拨鼠可以不走,特判就好 #include <bits/stdc++.h> #define inf 2333333333333333 #define N 1000010 #defin 阅读全文
posted @ 2020-08-08 15:42 WeiAR 阅读(285) 评论(0) 推荐(0) 编辑
摘要: https://ac.nowcoder.com/acm/contest/5674/F 做法:伪单调队列按值升序排序,如果够m了就更新答案同时pop队首 #include <bits/stdc++.h> #define inf 2333333333333333 #define N 3000010 #d 阅读全文
posted @ 2020-08-08 14:56 WeiAR 阅读(183) 评论(0) 推荐(0) 编辑
摘要: Groundhog and 2-Power Representation 牛客多校A python + 栈乱搞 ans=0 c=list(input()) n=int(len(c)) c.insert(0,'s') k=[] ans=[] tot=int(0) def ksm(a,b): r=int 阅读全文
posted @ 2020-08-08 13:36 WeiAR 阅读(175) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <cstdio> #include <queue> #include <algorithm> #include <cmath> #include <cstring> #define inf 2147483647 #define N 10000 阅读全文
posted @ 2020-08-07 14:25 WeiAR 阅读(129) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <cstdio> #include <queue> #include <algorithm> #include <cmath> #include <cstring> #define inf 2147483647 #define N 10000 阅读全文
posted @ 2020-08-07 11:07 WeiAR 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 第一次做的时候没有优化到底,T了 我竟然蠢蠢地去枚举质数了 #include <iostream> #include <cstdio> #include <queue> #include <algorithm> #include <cmath> #include <cstring> #define 阅读全文
posted @ 2020-08-06 22:03 WeiAR 阅读(80) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 56 下一页