原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2035 思路:(网上学来的,偏向数学的不咋懂/捂脸)每次乘法的时候都取后三位(可能有些含糊,直接看代码吧,一看就懂) source code: package hduoj; import java.uti ...
分类:
编程语言 时间:
2020-02-01 17:56:51
阅读次数:
120
http://acm.hdu.edu.cn/showproblem.php?pid=2018 #include <stdio.h> #include <cstring> #include <algorithm> #include <vector> #include <map> #include <a ...
分类:
其他好文 时间:
2020-02-01 16:38:13
阅读次数:
83
HDU 3613 Best Reward Manacher算法 题意 字符串,需要把这个字符串分成两段,并使得被分开的两段价值和最大。 一个串如果是回文,那么它的价值就是所有字符的价值和,否则价值为0。每个字母都有相应的价值,这个会给出。 解题思路 使用 ,我们可以算出每个点的回文串长度,然后我们枚 ...
分类:
编程语言 时间:
2020-02-01 16:34:05
阅读次数:
64
http://acm.hdu.edu.cn/showproblem.php?pid=2041 #include <stdio.h> #include <cstring> #include <algorithm> #include <vector> #include <map> #include <a ...
分类:
其他好文 时间:
2020-02-01 16:25:41
阅读次数:
77
#include<iostream> using namespace std; const int N=1010; int p[N]; int find(int x) { if(p[x]!=x) p[x]=find(p[x]); return p[x]; } int main() { int t; ...
分类:
其他好文 时间:
2020-02-01 16:18:08
阅读次数:
47
http://acm.hdu.edu.cn/showproblem.php?pid=2044 #include <stdio.h> #include <cstring> #include <algorithm> #include <vector> #include <map> #include <a ...
分类:
其他好文 时间:
2020-02-01 16:17:05
阅读次数:
64
0. vs 查看预编译后的代码 1. # 和 ## #define P(A) { printf(" the square of %s is %d\n", #A, A * A); } #define Q(B) { printf(" the square of "#B" is %d\n" , B * B ...
分类:
其他好文 时间:
2020-02-01 16:16:27
阅读次数:
68
HDU 4513吉哥系列故事——完美队形II Manacher 题意 吉哥又想出了一个新的完美队形游戏! 假设有n个人按顺序站在他的面前,他们的身高分别是h[1], h[2] ... h[n],吉哥希望从中挑出一些人,让这些人形成一个新的队形,新的队形若满足以下三点要求,则就是新的完美队形: 1. ...
分类:
其他好文 时间:
2020-02-01 16:14:07
阅读次数:
45
"题目链接" Problem Description There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a bl ...
分类:
其他好文 时间:
2020-02-01 12:47:27
阅读次数:
85
HDU-1312-DFS Written by Void-Walker 2020-02-01 09:09:25 1.题目传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1312 2.题目大意: 有一个矩形房间,房间里有红砖块(‘#’)和黑砖块(‘.’)组成 ...
分类:
其他好文 时间:
2020-02-01 10:59:54
阅读次数:
98