Live2d Test Env

随笔分类 -  OJ---HDU

摘要:Zero has an old printer that doesn't work well sometimes. As it is antique, he still like to use it to print articles. But it is too old to work for a 阅读全文
posted @ 2017-11-10 15:29 nimphy 阅读(274) 评论(0) 推荐(0)
摘要:There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees 阅读全文
posted @ 2017-11-02 23:10 nimphy 阅读(199) 评论(0) 推荐(0)
摘要:A wqb-number, or B-number for short, is a non-negative integer whose decimal form contains the sub- string "13" and can be divided by 13. For example, 阅读全文
posted @ 2017-11-01 11:18 nimphy 阅读(188) 评论(0) 推荐(0)
摘要:The counter-terrorists found a time bomb in the dust. But this time the terrorists improve on the time bomb. The number sequence of the time bomb coun 阅读全文
posted @ 2017-11-01 10:46 nimphy 阅读(277) 评论(0) 推荐(0)
摘要:春天到了, HDU校园里开满了花, 姹紫嫣红, 非常美丽. 葱头是个爱花的人, 看着校花校草竞相开放, 漫步校园, 心情也变得舒畅. 为了多看看这迷人的校园, 葱头决定, 每次上课都走不同的路线去教室, 但是由于时间问题, 每次只能经过k个地方, 比方说, 这次葱头决定经过2个地方, 那他可以先去问 阅读全文
posted @ 2017-10-29 13:38 nimphy 阅读(179) 评论(0) 推荐(0)
摘要:Queues and Priority Queues are data structures which are known to most computer scientists. The Queue occurs often in our daily life. There are many p 阅读全文
posted @ 2017-10-28 22:20 nimphy 阅读(204) 评论(0) 推荐(0)
摘要:A为一个方阵,则Tr A表示A的迹(就是主对角线上各项的和),现要求Tr(A^k)%9973。 Input数据的第一行是一个T,表示有T组数据。 每组数据的第一行有n(2 <= n <= 10)和k(2 <= k < 10^9)两个数据。接下来有n行,每行有n个数据,每个数据的范围是[0,9],表示 阅读全文
posted @ 2017-10-28 13:10 nimphy 阅读(272) 评论(0) 推荐(0)
摘要:众所周知,HDU的考研教室是没有空调的,于是就苦了不少不去图书馆的考研仔们。Lele也是其中一个。而某教室旁边又摆着两个未装上的空调,更是引起人们无限YY。 一个炎热的下午,Lele照例在教室睡觉的时候,竟然做起了空调教室的美梦。 Lele梦到学校某天终于大发慈悲给某个教室安上了一个空调。而且建造了 阅读全文
posted @ 2017-10-25 20:20 nimphy 阅读(388) 评论(0) 推荐(0)
摘要:Steam is a digital distribution platform developed by Valve Corporation offering digital rights management (DRM), multiplayer gaming and social networ 阅读全文
posted @ 2017-10-25 09:04 nimphy 阅读(186) 评论(1) 推荐(0)
摘要:指针我一般都会出错,所以还是自己写数组版本。 In the modern time, Search engine came into the life of everybody like Google, Baidu, etc. Wiskey also wants to bring this feat 阅读全文
posted @ 2017-10-24 22:52 nimphy 阅读(205) 评论(1) 推荐(0)
摘要:注意一:卡map的时间,但是好好写+运气还是可以卡过,哇。。。求人品爆发 注意二:去前导0,毕竟‘0’也有ASCII码 阅读全文
posted @ 2017-10-23 20:39 nimphy 阅读(182) 评论(0) 推荐(0)
摘要:所谓马拉车,和老汉推车毫无关系!!! manacher用于处理对称问题,主要是针对回文串,如:tattarrattat(牛津英语词典中最长的回文单词) HDU3068 ,用char,而不要用string,不然会超s。View Code HDU3294 View Code HDU4513 View C 阅读全文
posted @ 2017-10-23 13:19 nimphy 阅读(268) 评论(0) 推荐(0)
摘要:Consider equations having the following form: a*x1^2+b*x2^2+c*x3^2+d*x4^2=0 a, b, c, d are integers from the interval [-50,50] and any of them cannot 阅读全文
posted @ 2017-10-22 20:20 nimphy 阅读(365) 评论(0) 推荐(0)
摘要:Given a permutation P of 1 to N, YY wants to know whether there exists such three elements P[i 1], P[i 2], P[i 3] that P[i 1]-P[i 2]=P[i 2]-P[i 3], 1< 阅读全文
posted @ 2017-10-22 19:43 nimphy 阅读(265) 评论(0) 推荐(0)
摘要:N planets are connected by M bidirectional channels that allow instant transportation. It's always possible to travel between any two planets through 阅读全文
posted @ 2017-10-19 18:16 nimphy 阅读(486) 评论(0) 推荐(0)
摘要:There are some locations in a park, and some of them are connected by roads. The park manger needs to build some railways along the roads, and he woul 阅读全文
posted @ 2017-10-19 18:15 nimphy 阅读(243) 评论(0) 推荐(0)
摘要:#include #include #include #include #include using namespace std; int T,trie[110010][10],n,cnt; int f[110010]; char c[12]; bool flag; void _insert() { int L=strlen(c+1),tmp=0; for(int i=1;i... 阅读全文
posted @ 2017-10-18 07:05 nimphy 阅读(152) 评论(0) 推荐(0)
摘要:暴力出奇迹,我就知道没取余那么正当,肯定有什么奇淫怪巧,果然5分钟A掉。 阅读全文
posted @ 2017-10-17 19:54 nimphy 阅读(291) 评论(0) 推荐(0)
摘要:昨天睡得太晚,今天又在看新算法,明天事情也多,烦,所以今天刷刷水题就过去了。 叫我用线段树,我反而搞不来 阅读全文
posted @ 2017-10-17 19:28 nimphy 阅读(193) 评论(0) 推荐(0)
摘要:肯定会想到树的直径: 如果直径够长,就在直径(1+8)上面找路径,ans=k。 如果不够长,肯定会在有点分叉点(如3,4,5)回溯,然后我们把路径拉直,把其中一条的作为主线(有机化学,ORZ),主线是线走一遍,而分支走两遍,所以要想答案越小,主线就要求越长,也就是树的直径d,ans=d+(k-d)* 阅读全文
posted @ 2017-10-17 14:02 nimphy 阅读(268) 评论(0) 推荐(0)