Angel's Journey “Miyane!” This day Hana asks Miyako for help again. Hana plays the part of angel on the stage show of the cultural festival, and she is going to look for her human friend, Hinata. So she must find the shortest path to Hinata’s house.…
Travel There are nn planets in the MOT galaxy, and each planet has a unique number from 1 \sim n1∼n. Each planet is connected to other planets through some transmission channels. There are mm transmission channels in the galaxy. Each transmission cha…
Swap There is a sequence of numbers of length nn, and each number in the sequence is different. There are two operations: Swap the first half and the last half of the sequence (if nn is odd, the middle number does not change) Swap all the numbers in…
Tree Ming and Hong are playing a simple game called nim game. They have nn piles of stones numbered 11 to nn ,the ii-th pile of stones has a_iai​ stones. There are n - 1n−1 bidirectional roads in total. For any two piles, there is a unique path from…
Tasks It's too late now, but you still have too much work to do. There are nn tasks on your list. The ii-th task costs you t_iti​seconds. You want to go to bed TT seconds later. During the TT seconds, you can choose some tasks to do in order to finis…
题目链接:https://nanti.jisuanke.com/t/20                                         跳跃游戏二 给定一个非负整数数组,假定你的初始位置为数组第一个下标.数组中的每个元素代表你在那个位置能够跳跃的最大长度.你的目标是到达最后一个下标,并且使用最少的跳跃次数. 例如: A = [2,3,1,1,4],到达最后一个下标的最少跳跃次数为 2.(先跳跃 1 步,从下标 0 到 1,然后跳跃 3 步,到达最后一个下标.一共两次) 输入格式…
query Given a permutation pp of length nn, you are asked to answer mm queries, each query can be represented as a pair (l ,r )(l,r), you need to find the number of pair(i ,j)(i,j) such that l \le i < j \le rl≤i<j≤r and \min(p_i,p_j) = \gcd(p_i,p_j )…
题目链接:https://nanti.jisuanke.com/t/31434 小 D 是一位著名的车手,他热衷于在广场上飙车.每年儿童节过后,小 D 都会在广场上举行一场别样的车技大赛. 小 D 所在的广场可以看作一个 W×H 的网格,初始时小 D 位于左下角的 (1,1) 处,他的目的地是位于右上角的 (W,H). 每次移动时,小 D 会选择位于他右上方的一个方格,并移动到这个方格.由于车技的限制,每次移动小 D 的横坐标变化和纵坐标变化都不能超过 K. 也就是说,每次小 D 会在以当前位置…
计蒜客\(2019CSP\)比赛第二场 巧妙爆零这场比赛(我连背包都不会了\(QWQ\) \(T1\) \(Too\) \(Young\) 大学选课真的是一件很苦恼的事呢! \(Marco\):"我要两年毕业!我要选尽量多的学分!这些课统统选上!" 长者:"你啊,\(Too Young\)!你看看作业量,你做的完吗?" \(Marco\)(笑容逐渐消失\(.gif\)):"那可咋整啊?" 长者:"还能咋整?退课呗!" 已知 \…
鉴于我市拥堵的交通状况,市政交管部门经过听证决定在道路两侧安置自动停车收费系统.当车辆驶入车位,系统会通过配有的摄像头拍摄车辆画面,通过识别车牌上的数字.字母序列识别车牌,通过连接车管所车辆信息数据库确认车辆,进行扣费. 斗智斗勇的好戏一般从此处展开… 一些车主通过在停车时遮挡车牌上的一个或多个数字.字母序列,来阻碍识别系统的识别工作,以此逃避停车费用的缴纳. 车主这简直是用轻轻的一挡搞出来一个世界难题有木有?!管理是一方面,技术解决才是王道啊. 这么难的项目不得不交给计蒜客实验室了.D 神负责…