• zoj 3620 Escape Time II

    时间:2023-12-23 15:50:08

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4744Escape Time IITime Limit: 2 Seconds      Memory Limit: 65536 KBThere is a fire in LTR ’...

  • ZOJ 1049 I Think I Need a Houseboat

    时间:2023-12-23 15:48:26

    原题链接题目大意:Fred想在Louisiana买一套房子,但是堤坝不牢固,每年都要被河水侵蚀50平方英里。题目给出他豪宅的坐标,要求他被迫移民搬迁的年份。解法:也没什么好说的,先求出两点间的距离,即半径,然后算出面积,在除以每年塌方的面积,向上取整即可。参考代码:#include <stdi...

  • ZOJ 3805--解题报告

    时间:2023-12-22 13:40:09

    题目相关:3805相关链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5337在二维的矩形上, 机器通过管道(pipe)连接(I型, L型),最终成为一个系统.其规则大致提炼如下: 1). 编号大的输出可以成为编号小的输入...

  • ZOJ3582:Back to the Past(概率DP)

    时间:2023-12-21 22:37:52

    Recently poet Mr. po encountered a serious problem, rumor said some of his early poems are written by others. This brought a lot of trouble to Mr. po,...

  • zoj 3647 智商题

    时间:2023-12-21 10:37:27

    此题就是求格点中三角形的个数。就是找出三点不共线的个数。n*m的矩形中有(n+1)*(m+1)个格点。选出三个点的总个数为:C((n+1)*(m+1),3).减掉共线的情况就是答案了。首先是水平和垂直共线的情况:C(n+1,3)*(m+1)+C(m+1,3)*(n+1);然后斜的共线的情况就是枚举矩...

  • ZOJ Problem Set - 1730 Crazy Tea Party

    时间:2023-12-20 18:49:55

    #include<cstdio>int main(){ int T,n; scanf("%d",&T); while(T--){ scanf("%d",&n); printf("%d\n",n/*(n/-)/+(n-n/)*(

  • ZOJ 3962 E.Seven Segment Display / The 14th Zhejiang Provincial Collegiate Programming Contest Sponsored by TuSimple E.数位dp

    时间:2023-12-20 14:16:16

    Seven Segment DisplayTime Limit: 1 Second      Memory Limit: 65536 KBA seven segment display, or seven segment indicator, is a form of electronic disp...

  • zoj 3962 Seven Segment Display 数位dp

    时间:2023-12-20 14:09:45

    非常好的一个题,可以比赛时想到的状态太奇葩,不方便转移,就一直没能AC。思路:dp(i, j)表示已经考虑了前i位,前i位的和为j的贡献。如果当前的选择一直是最大的选择,那么就必须从0~下一位的最大值之间选择,所以必须增加一个标记表示当前是否被限制。否则就可以从0~15中任选一个填充该位,这种情况就...

  • ZOJ - 3962 - Seven Segment Display-17省赛-数位DP

    时间:2023-12-20 14:01:25

    传送门:Seven Segment Display题意:求一个给定区间每个数字的消耗值的和;思路:数位DP,有点区间和的思想,还有就是这个十六进制,可以用%llx读,还是比较难的;还有就是到最大的 0xffffffff 后,会从新跳到0,这里要加上两段solve(ri)+solve(most)-so...

  • ZOJ 3962:Seven Segment Display(思维)

    时间:2023-12-20 14:01:15

    https://vjudge.net/problem/ZOJ-3962题意:有16种灯,每种灯的花费是灯管数目,代表0~F(十六进制),现在从x开始跳n-1秒,每一秒需要的花费是表示当前的数的花费之和,问n-1秒后这段时间的花费总共是多少。跳到FFFFFFFF之后会跳回00000000.思路:怀疑人...

  • ZOJ 3962 Seven Segment Display(数位DP)题解

    时间:2023-12-20 13:57:35

    题意:给一个16进制8位数,给定每个数字的贡献,问你贡献和。思路:数位DP,想了很久用什么表示状态,看题解说用和就行,其他的都算是比较正常的数位DP。代码:#include<iostream>#include<stdio.h>#include<cmath>#inc...

  • 2017浙江省赛 E - Seven Segment Display ZOJ - 3962

    时间:2023-12-20 13:56:49

    地址:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3962题目:A seven segment display, or seven segment indicator, is a form of electronic di...

  • ZOJ 3962 Seven Segment Display(数位DP)

    时间:2023-12-20 13:51:13

    题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3962题目大意:有t组数据。 给你一个n,和8位的十六进制数st,还有一张表格,里面有每一个数字的消耗。比如"5A8BEF67"的消耗为为5 + 6 + 7 + 5 ...

  • ZOJ 3962 Seven Segment Display 16进制的八位数加n。求加的过程中所有的花费。显示[0,F]有相应花费。

    时间:2023-12-20 13:36:56

    Seven Segment DisplayTime Limit: Seconds Memory Limit: KBA seven segment display, or seven segment indicator, is a form of electronic display d...

  • ZOJ 3781 Paint the Grid Reloaded(DFS连通块缩点+BFS求最短路)

    时间:2023-12-20 08:48:38

    题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5268题目大意:字符一样并且相邻的即为连通。每次可翻转一个连通块X(O)的颜色,问至少改变几次使得图上所有字符都相等。解题思路:1) dfs( 建图 ) ,因为翻转的时候...

  • [ZOJ3254] MON 9.2009Secret Code

    时间:2023-12-19 13:42:07

    A^x = D (mod P)0 <= x <= M, here M is a given integer.1 <= A, P < 2^31, 0 <= D < P, 1 <= M < 2^63-----------------------------...

  • zoj1109 水题(大神绕道) Language of FatMouse

    时间:2023-12-17 14:58:55

    Language of FatMouseTime Limit:10 Seconds      Memory Limit:32768 KBWe all know that FatMouse doesn't speak English. But now he has to be prepared sin...

  • ZOJ 2975 思维

    时间:2023-12-16 20:15:28

    题意 给出一个矩形 问在其中存在多少子矩形 其四个角上的字母是一样的一开始暴力写了一发 先枚举行数 再枚举两个列数 再向下枚举行数 判断能否 没有意外的超时了后来想了想 当我们已经确定两个列数的时候 向下寻找的时候 如果找到了tot条边与第一条边同字母 这些边可以组成(tot-1)*tot个矩形 使...

  • [ACM_水题] ZOJ 3712 [Hard to Play 300 100 50 最大最小]

    时间:2023-12-10 14:31:16

    MightyHorse is playing a music game called osu!.After playing for several months, MightyHorse discovered the way of calculating score in osu!:1. While...

  • zoj-3795-Grouping-tarjan确定最长的公路收缩

    时间:2023-12-09 11:58:54

    使用tarjan缩合点。然后,dfs寻找最长的公路。水体。。。#include<stdio.h>#include<string.h>#include<algorithm>#include<iostream>#include<vector>#...