C. Drazil and Factorial time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Drazil is playing a math game with Varda. Let's define  for positive integer x as a product of factorials of its dig…
题目链接:http://codeforces.com/contest/515/problem/C 给出一个公式例如:F(135) = 1! * 3! * 5!; 现在给你一个有n位的数字a,让你求这样一个x,满足x中没有0和1,F(a) = F(x),然后就是x要最大. 当x的位数比a多或者从高位开始x的数某一位要大于a的某一位,然后第二种显然是不可能的,所以我们寻找如何把a变长的方法. 例如数字 4! = 1 * 2 * 3 * 4 =3! * 2 * 2 =3! * 2! * 2! 所以当a…
C. Drazil and Park 题目连接: http://codeforces.com/contest/516/problem/C Description Drazil is a monkey. He lives in a circular park. There are n trees around the park. The distance between the i-th tree and (i + 1)-st trees is di, the distance between t…
B. Drazil and Tiles 题目连接: http://codeforces.com/contest/516/problem/B Description Drazil created a following problem about putting 1 × 2 tiles into an n × m grid: "There is a grid with some cells that are empty and some cells that are occupied. You s…
题目链接:http://codeforces.com/problemset/problem/516/B 一个n*m的方格,'*'不能填.给你很多个1*2的尖括号,问你是否能用唯一填法填满方格. 类似topsort,'.'与上下左右的'.',的相连.从度为1的点作为突破口. //#pragma comment(linker, "/STACK:102400000, 102400000") #include <algorithm> #include <iostream>…
B. Drazil and Tiles   Drazil created a following problem about putting 1 × 2 tiles into an n × m grid: "There is a grid with some cells that are empty and some cells that are occupied. You should use 1 × 2 tiles to cover all empty cells and no two ti…
C - Drazil and Park 每个点有两个值Li 和 Bi,求Li + Rj (i < j) 的最大值,这个可以用线段树巧妙的维护.. #include<bits/stdc++.h> #define LL long long #define fi first #define se second #define mk make_pair #define PII pair<int, int> #define y1 skldjfskldjg #define y2 skld…
传送门 D. Drazil and Tiles time limit per test 2 seconds memory limit per test 256 megabytes Drazil created a following problem about putting 1 × 2 tiles into an n × m grid: "There is a grid with some cells that are empty and some cells that are occupie…
A. Drazil and Factorial 题目连接: http://codeforces.com/contest/516/problem/A Description Drazil is playing a math game with Varda. Let's define for positive integer x as a product of factorials of its digits. For example, . First, they choose a decimal…
A. Drazil and Date 无算法,判断(s - (a + b)) % 2是否为零,若零,表示在s步内还能走向其他的地方并且回来 否则,都是No #include <cstdio> #include <iostream> #include <cstring> #include <cmath> #include <algorithm> #include <string> #include <map> #includ…