摘要: Description For their physical fitness program, N (2 ≤ N ≤ 1,000,000) cows have decided to run a relay race using the T (2 ≤ T ≤ 100) cow trails throu 阅读全文
posted @ 2017-08-15 14:28 NaVi_Awson 阅读(341) 评论(0) 推荐(0) 编辑
摘要: Description Air Bovinia operates flights connecting the N farms that the cows live on (1 <= N <= 20,000). As with any airline, K of these farms have b 阅读全文
posted @ 2017-08-15 14:20 NaVi_Awson 阅读(360) 评论(0) 推荐(0) 编辑
摘要: Description 水叮当得到了一块五颜六色的格子形地毯作为生日礼物,更加特别的是,地毯上格子的颜色还能随着踩踏而改变。为了讨好她的偶像虹猫,水叮当决定在地毯上跳一支轻盈的舞来卖萌~~~ 地毯上的格子有N行N列,每个格子用一个0~5之间的数字代表它的颜色。水叮当可以随意选择一个0~5之间的颜色, 阅读全文
posted @ 2017-08-14 21:27 NaVi_Awson 阅读(246) 评论(2) 推荐(0) 编辑
摘要: Description 司令部的将军们打算在N*M的网格地图上部署他们的炮兵部队。一个N*M的地图由N行M列组成,地图的每一格可能是山地(用“H” 表示),也可能是平原(用“P”表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部署炮兵部队);一支炮兵部队在地图上的攻击范围如图 阅读全文
posted @ 2017-08-14 20:04 NaVi_Awson 阅读(220) 评论(0) 推荐(0) 编辑
摘要: Description 给出一个正整数序列 a,长度为 n,cyb 不喜欢完美,他要删掉一些数(也可以不删,即删掉0个),但是他不会乱删,他希望删去以后,能将 a 分成 2 个集合,使得两个非空集合的数的和相同,现在他希望你能帮他算出删数的方案数。 Input 第一行 n 个正整数 以下有 n行,每 阅读全文
posted @ 2017-08-14 16:24 NaVi_Awson 阅读(308) 评论(0) 推荐(0) 编辑
摘要: Description An addition chain for n is an integer sequence with the following four properties: a0 = 1 am = n a0 < a1 < a2 < ... < am-1 < am For each k 阅读全文
posted @ 2017-08-13 16:33 NaVi_Awson 阅读(213) 评论(1) 推荐(0) 编辑
摘要: Description Jimmy experiences a lot of stress at work these days, especially since his accident made working difficult. To relax after a hard day, he 阅读全文
posted @ 2017-08-13 12:40 NaVi_Awson 阅读(248) 评论(0) 推荐(0) 编辑
摘要: Description Input Output Sample Input Sample Output HINT 题解 由于题目要求我们求严格递增的数列,即: $$A[i]>A[i-1],1<i<=N$$ 我们不妨令B[i]=A[i]-i,那么我们容易得到 $$B[i]>=B[i-1],1<i<=N 阅读全文
posted @ 2017-08-12 21:43 NaVi_Awson 阅读(295) 评论(0) 推荐(0) 编辑
摘要: Description Input Output Sample Input Sample Output HINT 题解 莫队。加个标记数组维护该数在区间中出现了几次,再加个变量统计有几个数是重复的。 阅读全文
posted @ 2017-08-12 19:40 NaVi_Awson 阅读(166) 评论(0) 推荐(0) 编辑
摘要: Description 作为体育委员,C君负责这次运动会仪仗队的训练。仪仗队是由学生组成的N * N的方阵,为了保证队伍在行进中整齐划一,C君会跟在仪仗队的左后方,根据其视线所及的学生人数来判断队伍是否整齐(如下图)。现在,C君希望你告诉他队伍整齐时能看到的学生人数。 作为体育委员,C君负责这次运动 阅读全文
posted @ 2017-08-07 11:21 NaVi_Awson 阅读(197) 评论(0) 推荐(0) 编辑
摘要: Description 给定整数N,求1<=x,y<=N且Gcd(x,y)为素数的 数对(x,y)有多少对. 给定整数N,求1<=x,y<=N且Gcd(x,y)为素数的 数对(x,y)有多少对. Input 一个整数N 一个整数N Output 如题 如题 Sample Input 4 Sample 阅读全文
posted @ 2017-08-06 13:38 NaVi_Awson 阅读(233) 评论(0) 推荐(0) 编辑
摘要: Description 对于任何正整数x,其约数的个数记作g(x)。例如g(1)=1、g(6)=4。 如果某个正整数x满足:g(x)>g(i) 0<i<x,则称x为反质数。例如,整数1,2,4,6等都是反质数。 现在给定一个数N,你能求出不超过N的最大的反质数么? 对于任何正整数x,其约数的个数记作 阅读全文
posted @ 2017-08-05 17:24 NaVi_Awson 阅读(361) 评论(0) 推荐(0) 编辑
摘要: Description Description Stan has n sticks of various length. He throws them one at a time on the floor in a random way. After finishing throwing, Stan 阅读全文
posted @ 2017-08-03 10:07 NaVi_Awson 阅读(181) 评论(0) 推荐(0) 编辑
摘要: Description 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 t 阅读全文
posted @ 2017-08-02 10:36 NaVi_Awson 阅读(301) 评论(0) 推荐(1) 编辑
摘要: Description Description You are to find the length of the shortest path through a chamber containing obstructing walls. The chamber will always have s 阅读全文
posted @ 2017-08-01 20:14 NaVi_Awson 阅读(171) 评论(0) 推荐(1) 编辑