上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 22 下一页

2021年2月26日

摘要: http://47.104.209.207/problem/old1063 字符串处理,直接依据定义输出字符串。 1 #include <iostream> 2 #include <cstring> 3 #include <algorithm> 4 5 using namespace std; 6 阅读全文
posted @ 2021-02-26 22:47 greenofyu 阅读(44) 评论(0) 推荐(0)

2021年2月24日

摘要: http://47.104.209.207/problem/old1061 可以证明直接将头部的字母固定,而后从尾部找与其相同的字母并不会使结果变差。 对于第i个字母,假设与之匹配的为k,他应该放置的位置是n-i-1,那么ans=k-(n-i-1) 如果第i个字母放于其他的位置上,对于第i个字母对, 阅读全文
posted @ 2021-02-24 16:02 greenofyu 阅读(74) 评论(0) 推荐(0)
摘要: http://47.104.209.207/problem/old1060 计算出相交矩阵的左下和右上两个顶点。 1 #include<cmath> 2 #include<iostream> 3 #include<queue> 4 #include<vector> 5 #include<algori 阅读全文
posted @ 2021-02-24 15:27 greenofyu 阅读(63) 评论(0) 推荐(0)
摘要: http://47.104.209.207/problem/old1059 直接用矩阵乘法的性质,注意0次方的时候是变成单位矩阵。 1 #include<cmath> 2 #include<iostream> 3 #include<queue> 4 #include<vector> 5 #inclu 阅读全文
posted @ 2021-02-24 12:09 greenofyu 阅读(66) 评论(0) 推荐(0)
摘要: http://47.104.209.207/problem/old1058 先用筛法筛出所有质数,然后对每个数进行质因数分解。 1 #include<cmath> 2 #include<iostream> 3 #include<queue> 4 #include<vector> 5 #include 阅读全文
posted @ 2021-02-24 11:56 greenofyu 阅读(61) 评论(0) 推荐(0)

2021年2月23日

摘要: http://47.104.209.207/problem/old1007 直接按位与。 1 #include<iostream> 2 #include<queue> 3 #include<vector> 4 #include<algorithm> 5 using namespace std; 6 阅读全文
posted @ 2021-02-23 22:59 greenofyu 阅读(30) 评论(0) 推荐(0)
摘要: http://47.104.209.207/problem/old1072 需要用到高精度乘法(高精度数乘以int)。 1 #include<iostream> 2 #include<queue> 3 #include<vector> 4 #include<algorithm> 5 using na 阅读全文
posted @ 2021-02-23 22:51 greenofyu 阅读(51) 评论(0) 推荐(0)
摘要: http://47.104.209.207/problem/old1071 直接用模板就好,反过来方便些。 1 #include<iostream> 2 #include<queue> 3 #include<vector> 4 #include<algorithm> 5 using namespac 阅读全文
posted @ 2021-02-23 22:33 greenofyu 阅读(51) 评论(0) 推荐(0)
摘要: http://47.104.209.207/problem/old1070 问Huffman树的费用,直接用堆解决。 1 #include<iostream> 2 #include<queue> 3 4 using namespace std; 5 6 int main(){ 7 int n; 8 阅读全文
posted @ 2021-02-23 22:25 greenofyu 阅读(54) 评论(0) 推荐(0)
摘要: http://47.104.209.207/problem/old1069 先dfs黑皇后然后dfs白皇后,因为麻烦所以直接暴力check当前位置是否合法。 1 #include<iostream> 2 const int N=20; 3 4 using namespace std; 5 int s 阅读全文
posted @ 2021-02-23 22:20 greenofyu 阅读(66) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 22 下一页