字符串统计 题目分析: 录入字符串,判断数字有多少个,累加保存。 代码: #include<iostream> using namespace std; int main() { char a[100001]; int n; while (cin >> n&&n) { while (n--) { g ...
分类:
其他好文 时间:
2020-02-08 09:29:13
阅读次数:
51
多项式求和 题目分析: 一道经典的入门算法题,利用for循环以及-1的累乘,进行计算,代码如下 代码: #include<iostream> using namespace std; int main(){ int i, n; int t = 1; int cnt; double sum, num; ...
分类:
其他好文 时间:
2020-02-08 09:18:56
阅读次数:
48
#include<iostream> #include<algorithm> #include<cstring> using namespace std; const int maxn=110010; char t[maxn],s[maxn*3]; int p[maxn*3],lens; void ...
分类:
其他好文 时间:
2020-02-08 00:45:03
阅读次数:
77
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2085import java.util.Scanner;public class 核反应堆2085 { public static void main(String[] args) { Scanner inp ...
分类:
其他好文 时间:
2020-02-08 00:20:25
阅读次数:
62
hdu4773:http://acm.hdu.edu.cn/showproblem.php?pid=4773 题意:给你两个相离的圆,以及一个点,求所有和这两个圆相切,并且经过该点的圆。 我们先画出满足题意的圆,然后把这三个圆反演,给定的两个圆因为不经过p点,反演后是两个圆,然后ans圆经过p点,所 ...
分类:
其他好文 时间:
2020-02-06 18:07:21
阅读次数:
56
此博客链接:https://www.cnblogs.com/ping2yingshi/p/12268487.html 1。发工资 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2021 Problem Description 作为杭电的老师,最盼望的日 ...
分类:
其他好文 时间:
2020-02-06 15:02:22
阅读次数:
97
Problem Description Input include include include using namespace std; vector desk; int main(){ int n, m; while (~scanf ("%d %d", &n, &m)){ desk.clear ...
分类:
其他好文 时间:
2020-02-05 21:49:21
阅读次数:
66
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2047 思路:先是列出了四个,但是没发现规律,然后开始画递归树,在其中找到了规律,算出递归式为f(n) = 2*[f(n-1)+f(n-2)] 递归树分析如下(有点潦草,看不懂可以留言,大致模型为嵌套): ...
分类:
编程语言 时间:
2020-02-04 20:18:33
阅读次数:
85
Switch Game 原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2053Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem ...
分类:
其他好文 时间:
2020-02-04 15:40:35
阅读次数:
71
You are given a positive integer n, please count how many positive integers k satisfy kk≤nkk≤n. InputThere are no more than 50 test cases. Each case o ...
分类:
其他好文 时间:
2020-02-04 12:22:03
阅读次数:
55