随笔分类 - OJ
摘要:(Find the Duplicate Number/寻找重复数)[https://leetcode cn.com/problems/find the duplicate number/] 描述 Given an array nums containing n + 1 integers where
阅读全文
摘要:"原题链接" 描述 相信大家都会做两个整数的 A+B 了,今天我们把它扩展到矩阵,如果给你两个 N M 的矩阵,你会做么? 输入描述 第一行一个数 C(1 0) { int n, m; Matrix a = new Matrix(); Matrix b = new Matrix(); Matrix
阅读全文
摘要:"原题链接" 描述 Ignatius被魔王抓走了,有一天魔王出差去了,这可是Ignatius逃亡的好机会. 魔王住在一个城堡里,城堡是一个A B C的立方体,可以被表示成A个B C的矩阵,刚开始Ignatius被关在(0,0,0)的位置,离开城堡的门在(A 1,B 1,C 1)的位置,现在知道魔王将
阅读全文
摘要:"原题链接" 描述 Since 1945, when the first nuclear bomb was exploded by the Manhattan Project team in the US, the number of nuclear weapons have soared acro
阅读全文
摘要:"原题链接" 描述 After 4 years' waiting, the game "Chinese Paladin 5" finally comes out. Tomato is a crazy fan, and luckily he got the first release. Now he
阅读全文
摘要:"原题链接" 描述 The Gorelians are a warlike race that travel the universe conquering new worlds as a form of recreation. Given their violent, fun loving nat
阅读全文
摘要:"原题链接" 描述 One day , Kiki wants to visit one of her friends. As she is liable to carsickness , she wants to arrive at her friend’s home as soon as poss
阅读全文
摘要:"原题链接" 描述 Arbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same cur
阅读全文
摘要:"原题链接" 描述 给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距离及其花费,如果最短距离有多条路线,则输出花费最少的。 输入 输入n,m,点的编号是1~n,然后是m行,每行4个数 a,b,d,p,表示a和b之间有一条边,且其长度为d,花费为p。最后一
阅读全文
摘要:"原题链接" 描述 经过锦囊相助,海东集团终于度过了危机,从此,HDU的发展就一直顺风顺水,到了2050年,集团已经相当规模了,据说进入了钱江肉丝经济开发区500强。这时候,XHD夫妇也退居了二线,并在风景秀美的诸暨市浬浦镇陶姚村买了个房子,开始安度晚年了。 这样住了一段时间,徐总对当地的交通还是不
阅读全文
摘要:"原题链接" 描述 1967年,美国著名的社会学家斯坦利·米尔格兰姆提出了一个名为“小世界现象(small world phenomenon)”的著名假说,大意是说,任何2个素不相识的人中间最多只隔着6个人,即只用6个人就可以将他们联系在一起,因此他的理论也被称为“六度分离”理论(six degre
阅读全文
摘要:"原题链接" 描述 在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗? 输入 输入包括多组数据。每组数据第一行是两个整数N、M(N defin
阅读全文
摘要:"原题链接" 描述 某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。 现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。 输入 本题目
阅读全文
摘要:"原题链接" 描述 小鱼儿吐泡泡,嘟嘟嘟冒出来。小鱼儿会吐出两种泡泡:大泡泡"O",小泡泡"o"。 两个相邻的小泡泡会融成一个大泡泡,两个相邻的大泡泡会爆掉。 (是的你没看错,小气泡和大气泡不会产生任何变化的,原因我也不知道。) 注意:自左到右进行合并. 例如:ooOOoooO经过一段时间以后会变成
阅读全文
摘要:"原题链接" 描述 In chapter 4 of the game Trails in the Sky SC, Estelle Bright and her friends are crossing Mistwald to meet their final enemy, Lucciola. Mis
阅读全文
摘要:"" 描述 Lele now is thinking about a simple function f(x). If x = 10 f(x) = a0 f(x 1) + a1 f(x 2) + a2 f(x 3) + …… + a9 f(x 10); And ai(0 include define
阅读全文
摘要:"原题链接" 描述 Queues and Priority Queues are data structures which are known to most computer scientists. The Queue occurs often in our daily life. There
阅读全文
摘要:"原题链接" 描述 Given a n × n matrix A and a positive integer k, find the sum $S = A + A^{2} + A^{3} + … + A^{k}.$ 输入 The input contains exactly one test ca
阅读全文
摘要:"原题链接" 描述 A为一个方阵,则Tr A表示A的迹(就是主对角线上各项的和),现要求Tr(A^k)%9973。 输入 数据的第一行是一个T,表示有T组数据。 每组数据的第一行有n(2 define ll long long define maxn 10 using namespace std;
阅读全文
摘要:"原题链接" 描述 A hat’s word is a word in the dictionary that is the concatenation of exactly two other words in the dictionary. You are to find all the hat
阅读全文

浙公网安备 33010602011771号