Description Drazil created a following problem about putting  ×  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 tiles should c…
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…
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…
传送门 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…
题目链接:http://codeforces.com/problemset/problem/516/B 一个n*m的方格,'*'不能填.给你很多个1*2的尖括号,问你是否能用唯一填法填满方格. 类似topsort,'.'与上下左右的'.',的相连.从度为1的点作为突破口. //#pragma comment(linker, "/STACK:102400000, 102400000") #include <algorithm> #include <iostream>…
https://vjudge.net/problem/CodeForces-516B 题意 在一个n*m图中放1*2或者2*1的长方形,问是否存在唯一的方法填满图中的‘.’ 分析 如果要有唯一的方案,那么必定存在度为一的点,因为只有这样,把这一格以及它相邻的涂掉的方案才唯一,然后可能产生新的度为一的可行点,不断更新,bfs寻找这样的点.最后检测一遍是否还有‘.'存在即可. #include<iostream> #include<cmath> #include<cstring&…
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…
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…
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…
https://codeforces.com/contest/1330/problem/E 有一个高度为h的大顶堆:有2h -1个不同的正整数,下标从1到2h−1,1<i<2h, a[i]<a[⌊i/2⌋]. 现在我们要降低堆的高度,为h,有2g-1个整数,那么我们要删掉2h-2g个数: 选择索引 i 删除,删除方法如下: 被删除的节点值为0,代表该节点不存在. 所以操作后,2g-1个元素的下标在[1,2g-1]范围内:使得剩余元素的总和最小,并且输出调用删除函数时删除的节点下标. 人话…