- 博客(8)
- 收藏
- 关注
原创 杭电HDU 1005 Number Sequence (找循环)
Number Sequence 题目:https://acm.hdu.edu.cn/showproblem.php?pid=1005 Problem Description A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7. Given A, B, and n, you are to calculate the value of f(n). Input
2021-07-28 19:52:11
113
原创 杭电HDU 1096 A+B for Input-Output Practice (VIII)(输出格式)
A+B for Input-Output Practice (VIII) 题目:https://acm.hdu.edu.cn/showproblem.php?pid=1096 Problem Description Your task is to calculate the sum of some integers. Input Input contains an integer N in the first line, and then N lines follow. Each line starts w
2021-07-28 18:07:02
164
原创 杭电HDU 1004 Let the Balloon Rise(map)
Let the Balloon Rise 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1004 Problem Description Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges’ favorite time is guessing the most popular problem. When
2021-06-24 22:53:24
258
2
原创 L1-059 敲笨钟 (20 分)
L1-059 敲笨钟 (20 分) 微博上有个自称“大笨钟V”的家伙,每天敲钟催促码农们爱惜身体早点睡觉。为了增加敲钟的趣味性,还会糟改几句古诗词。其糟改的方法为:去网上搜寻压“ong”韵的古诗词,把句尾的三个字换成“敲笨钟”。例如唐代诗人李贺有名句曰:“寻章摘句老雕虫,晓月当帘挂玉弓”,其中“虫”(chong)和“弓”(gong)都压了“ong”韵。于是这句诗就被糟改为“寻章摘句老雕虫,晓月当帘敲笨钟”。 现在给你一大堆古诗词句,要求你写个程序自动将压“ong”韵的句子糟改成“敲笨钟”。 输入格式: 输入
2021-03-15 14:43:44
166
原创 L1-046 整除光棍 (20 分)
L1-046 整除光棍 (20 分) 这里所谓的“光棍”,并不是指单身汪啦~ 说的是全部由1组成的数字,比如1、11、111、1111等。传说任何一个光棍都能被一个不以5结尾的奇数整除。比如,111111就可以被13整除。 现在,你的程序要读入一个整数x,这个整数一定是奇数并且不以5结尾。然后,经过计算,输出两个数字:第一个数字s,表示x乘以s是一个光棍,第二个数字n是这个光棍的位数。这样的解当然不是唯一的,题目要求你输出最小的解。 提示:一个显然的办法是逐渐增加光棍的位数,直到可以整除x为止。但难点在于,
2021-03-14 15:48:40
188
原创 L1-043 阅览室 (20 分)
L1-043 阅览室 (20 分) 天梯图书阅览室请你编写一个简单的图书借阅统计程序。当读者借书时,管理员输入书号并按下S键,程序开始计时;当读者还书时,管理员输入书号并按下E键,程序结束计时。书号为不超过1000的正整数。当管理员将0作为书号输入时,表示一天工作结束,你的程序应输出当天的读者借书次数和平均阅读时间。 注意:由于线路偶尔会有故障,可能出现不完整的纪录,即只有S没有E,或者只有E没有S的纪录,系统应能自动忽略这种无效纪录。另外,题目保证书号是书的唯一标识,同一本书在任何时间区间内只可能被一位读
2021-03-13 13:47:00
138
原创 1.2 水洼dfs
1.2 水洼dfs poj: http://poj.org/problem?id=2386 #include<iostream> using namespace std; #define maxn 105 int n,m; char field[maxn][maxn]; void dfs(int x,int y) { field[x][y]='.';//注意要改成. for(int i=-1;i<=1;i++){//八连通,八个方向都要dfs for(int j=-1;j&
2021-03-03 18:04:25
138
1
原创 1.1八皇后
八皇后(回溯法) #include<iostream> using namespace std; int count=0; int chess[8][8]={0}; int danger(int row,int col){ int i,j; for(i=0;i<8;i++){//判断列,只要出现1则不满足 if(chess[i][col]==1) return 0; } for(i=row,j=col;i>=0&&j>=0;i--,j--
2021-03-02 23:06:20
444
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人