12 2016 档案
摘要:http://codeforces.com/contest/583/problem/D 原题:You are given an array of positive integers a1, a2, ..., an × T of length n × T. We know that for any i
阅读全文
摘要:const LL mod = 1e9 + 7; LL fac[maxn]; LL mypow(LL val, LL n){ LL ans = 1; while (n){ if (n & 1) ans = ans * val % mod; n >>= 1; val = val * val % mod; } retur...
阅读全文
摘要:http://codeforces.com/contest/612/problem/D 题目大意:给你n个区间,这n个区间会有相交的部分,如果一个区间相交的部分>=k,那么就把这个区间记录下来。且要求所记录的区间个数尽量少(换句话说就是区间尽量大),问有几个这样的区间,并且输出这样的区间。 思路一:
阅读全文
摘要:http://codeforces.com/contest/742/problem/C 题目大意:从x出发,从x->f[x] - > f[f[x]] -> f[f[f[x]]] -> ..... -> y的步数需要t步,然后再从y出发回到x的步数也需要t步。问需要找到一个最小的t,使得任何一个x经过
阅读全文
摘要:http://codeforces.com/contest/742/problem/D 题目大意:有n个人,每个人有重量wi和魅力值bi。然后又有m对朋友关系,朋友关系是传递的,如果a和b是朋友,b和c是朋友,那么a和c就是朋友。现在,把所有能作为朋友的人放在一个集合里面。你现在要开一个party,
阅读全文