上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 31 下一页
摘要: Xor路 (xor.pas/c/cpp)128MB1s 给定一棵有N个点和N-1条边的树,请你求出树中的最长路径,以及总共有多少条最长路径。 这里路径长度是用xor定义的,即若经过的边的权值为a1, a2, a3,...,an,则这条路径的总权值为 a1 xor a2 xor a3 ... xor 阅读全文
posted @ 2017-08-09 19:50 友人Aqwq 阅读(232) 评论(0) 推荐(0) 编辑
摘要: D. The Bakery time limit per test 2.5 seconds memory limit per test 256 megabytes input standard input output standard output D. The Bakery time limit 阅读全文
posted @ 2017-08-09 16:33 友人Aqwq 阅读(177) 评论(0) 推荐(0) 编辑
摘要: Description 作为体育委员,C君负责这次运动会仪仗队的训练。仪仗队是由学生组成的N * N的方阵,为了保证队伍在行进中整齐划一,C君会跟在仪仗队的左后方,根据其视线所及的学生人数来判断队伍是否整齐(如下图)。 现在,C君希望你告诉他队伍整齐时能看到的学生人数。 作为体育委员,C君负责这次运 阅读全文
posted @ 2017-08-08 21:03 友人Aqwq 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 长路 (path.pas/c/cpp) 1s 128MB 给出一个连通图,通过每条边i都有一个解锁的代价ci,通过每条边之前必须解锁,但是一旦解锁之后就可以随意通过了。主人公从1号点出发,要访问其他所有点至少一次。但主人公还有一个神奇的技能就是,他可以把一条边的解锁代价变成0,但是技能只能用一次。问 阅读全文
posted @ 2017-08-08 19:30 友人Aqwq 阅读(200) 评论(0) 推荐(0) 编辑
摘要: Chef has an array A = (A1, A2, ..., AN), which has N integers in it initially. Chef found that for i ≥ 1, if Ai > 0, Ai+1 > 0, and Ai+2 exists, then h 阅读全文
posted @ 2017-08-07 20:56 友人Aqwq 阅读(711) 评论(4) 推荐(0) 编辑
摘要: Palindromic Game Problem Code: PALINGAM Palindromic Game Problem Code: PALINGAM Palindromic Game Problem Code: PALINGAM There are two players A, B pla 阅读全文
posted @ 2017-08-07 20:49 友人Aqwq 阅读(220) 评论(0) 推荐(0) 编辑
摘要: Greedy Candidates Problem Code: GCAC Greedy Candidates Problem Code: GCAC Greedy Candidates Problem Code: GCAC The placements/recruitment season is go 阅读全文
posted @ 2017-08-07 20:28 友人Aqwq 阅读(201) 评论(0) 推荐(0) 编辑
摘要: dp只会看规律 SRM 10 描述 平面上有n个点(xi,yi),用最少个数的底边在x轴上且面积为S的矩形覆盖这些点(在边界上也算覆盖) 输入格式 第一行两个整数n,S接下来n行每行两个整数xi,yi,表示点的坐标 输出格式 一行,一个整数,表示答案 样例输入 样例输出 数据范围与约定 n=3,1组 阅读全文
posted @ 2017-08-07 15:25 友人Aqwq 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 数学上来先打表 SRM 10 描述 给出 n个点(不同点之间有区别),求出满足下列条件的连边(双向边)方案:1.每条边连接两个不同的点,每两个点之间至多有一条边2.不存在三个点a,b,c使三个点间两两可以互相到达且两两之间最短距离相等3.边的长度均为1 输入格式 一行,一个整数n 输出格式 一行,一 阅读全文
posted @ 2017-08-06 11:19 友人Aqwq 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 贪心只能过样例 SRM 10 描述 给出n个数a[i](1<=a[i]<=n),问最多能把这些数分成几组,使得每个数a[i]所在的组至少有a[i]个数 输入格式 第一行一个整数n,接下来n行每行一个整数分别是a[1],a[2],...,a[n] 输出格式 一行,输出答案,一个整数 样例输入 5 2 阅读全文
posted @ 2017-08-06 08:25 友人Aqwq 阅读(158) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 31 下一页