随笔分类 -  codeforces/Gym

上一页 1 ··· 5 6 7 8 9
摘要:就是先看排列p,必须满足其是一个环,才满足题意。就处理出有几个环,然后把它们合起来,答案就是多少。 然后再看序列b,自己稍微画一画就会发现,如果有偶数个1肯定是不行哒,否则,它就会再置换一圈回到它自己的位置的时候,正反面的情况和最初始相同,这样怎么转都没法在每个位置烤两面。 所以两部分的答案加起来就 阅读全文
posted @ 2017-01-23 09:25 AutSky_JadeK 阅读(210) 评论(0) 推荐(0)
摘要:algoritm.in / algoritm.out Even though he isn't a student of computer science, Por Costel the pig has started to study Graph Theory. Today he's learni 阅读全文
posted @ 2017-01-21 23:26 AutSky_JadeK 阅读(529) 评论(0) 推荐(0)
摘要:D. Ability To Convert time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Alexander is learni 阅读全文
posted @ 2017-01-20 02:12 AutSky_JadeK 阅读(196) 评论(0) 推荐(0)
摘要:C. Unfair Poll time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output On the Literature lesson S 阅读全文
posted @ 2017-01-20 02:08 AutSky_JadeK 阅读(175) 评论(0) 推荐(0)
摘要:semipal.in / semipal.out Por Costel the pig, our programmer in-training, has recently returned from the Petrozaporksk training camp. There, he learned 阅读全文
posted @ 2017-01-20 02:02 AutSky_JadeK 阅读(388) 评论(0) 推荐(0)
摘要:semipal.in / semipal.out Por Costel the pig, our programmer in-training, has recently returned from the Petrozaporksk training camp. There, he learned 阅读全文
posted @ 2017-01-20 02:01 AutSky_JadeK 阅读(388) 评论(0) 推荐(0)
摘要:perechi3.in / perechi3.out We don't know how Por Costel the pig arrived at FMI's dance party. All we know is that he did. The dance floor is hot becau 阅读全文
posted @ 2017-01-20 01:58 AutSky_JadeK 阅读(301) 评论(0) 推荐(0)
摘要:meciul.in / meciul.out Oberyn Martell and Gregor Clegane are dueling in a trial by combat. The fight is extremely important, as the life of Tyrion Lan 阅读全文
posted @ 2017-01-20 01:54 AutSky_JadeK 阅读(306) 评论(0) 推荐(0)
摘要:azerah.in / azerah.out Por Costel the Pig has received a royal invitation to the palace of the Egg-Emperor of Programming, Azerah. Azerah had heard of 阅读全文
posted @ 2017-01-20 01:50 AutSky_JadeK 阅读(295) 评论(0) 推荐(0)
摘要:http://codeforces.com/problemset/problem/755/D 每次新画一条对角线的时候,考虑其跨越了几条原有的对角线。 可以用树状数组区间修改点查询来维护多边形的顶点。答案每次增加 新对角线的左端点在多少个区间内+右端点在多少个区间内+1,每次把新画的对角线所覆盖的较 阅读全文
posted @ 2017-01-17 01:12 AutSky_JadeK 阅读(250) 评论(0) 推荐(0)
摘要:Consider a directed graph G of N nodes and all edges (u→v) such that u < v. It is clear that this graph doesn’t contain any cycles. Your task is to fi 阅读全文
posted @ 2017-01-15 22:20 AutSky_JadeK 阅读(182) 评论(0) 推荐(0)
摘要:f(i,j,S)表示到(i,j),且经由的路径上的颜色集合为S的价值的最小值,从上方和左方转移过来即可。 要注意,内存不足,需要滚动数组优化,即使用了map,还是需要。 路径输出的时候,可以再跑一遍dp,这样就不用再开一个大数组了。 我的写法比较菜。卡了常数 阅读全文
posted @ 2017-01-15 21:43 AutSky_JadeK 阅读(166) 评论(0) 推荐(0)
摘要:Hasan and Bahosain want to buy a new video game, they want to share the expenses. Hasan has a set of N coins and Bahosain has a set of M coins. The vi 阅读全文
posted @ 2017-01-15 21:37 AutSky_JadeK 阅读(297) 评论(0) 推荐(0)
摘要:题意:给定n个物品,每个物品对于A和B来说具有不同的价值,记为ai,bi,两人交替取,A先手,A总是贪心地取当前剩下的物品中,对于他价值最高的,如果有多个,则任取一个。问B在最坏情况下,能取到的物品的对他的价值和最大是多少。 先把物品以ai为第一关键字,bi为第二关键字排序。这样A每次必定从最左端取 阅读全文
posted @ 2017-01-15 21:29 AutSky_JadeK 阅读(180) 评论(0) 推荐(0)
摘要:期望计算的套路: 1、定义:算出所有测试值的和,除以测试次数。 2、定义:算出所有值出现的概率与其乘积之和。 3、用前一步的期望,加上两者的期望距离,递推出来。 题意: 一个树,dfs遍历子树的顺序是随机的。所对应的子树的dfs序也会不同。输出每个节点的dfs序的期望 思路: 分析一颗子树: 当前已 阅读全文
posted @ 2016-07-18 11:07 AutSky_JadeK 阅读(294) 评论(0) 推荐(0)
摘要:bunDescription因为体育老师很喜欢等差数列,所以他要求学生们站队必须按身高站成等差数列。但是有些班级的学生无论如何也无法排成等差数列,于是体育老师从食堂买来了两种神奇的面包。吃一个第一种面包可以使身高增 1,吃一个第二种面包可以使身高减 1。你的任务是,对于某个班级,帮助老师安排哪些同学... 阅读全文
posted @ 2015-03-15 15:15 AutSky_JadeK 阅读(188) 评论(0) 推荐(0)
摘要:乘除都在150以内,分解质因数后发现只有35个,建立35个树状数组/线段树,做区间加、区间查询,最后快速幂起来。#include#includeusing namespace std;#define N 50001typedef long long ll;ll Quick_Pow(ll a,ll p... 阅读全文
posted @ 2015-03-14 19:25 AutSky_JadeK 阅读(380) 评论(0) 推荐(0)

上一页 1 ··· 5 6 7 8 9
TVアニメ「Charlotte(シャーロット)」公式サイト TVアニメ「Charlotte(シャーロット)」公式サイト