http://codeforces.com/contest/612/problem/D】的更多相关文章

D. The Union of k-Segments time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output You are given n segments on the coordinate axis Ox and the number k. The point is satisfied if it belongs to at l…
http://codeforces.com/contest/325/problem/B B. Stadium and Games time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Daniel is organizing a football tournament. He has come up with the followin…
E. Ehab's REAL Number Theory Problem 数论+图论 求最小环 题目大意: 给你一个n大小的数列,数列里的每一个元素满足以下要求: 数据范围是:\(1<=a_i<=10^6\) \(a_i\) 最多只有7个因数 题目要求在这个数列找到一个最短的子数列,子数列的所有的数相乘是一个完全平方数. 题解: 这个题对于 \(x^{3}\) 应该等价于 \(x\) ,其实就是可以除去 \(a_i\)中的所有的平方项,显而易见,这个并不影响答案. 因为 \(a_i\) 最多只…
比赛时虽然贪了心,不过后面没想到怎么处理和set的排序方法忘了- -,其实是和优先队列的仿函数一样的... 比赛后用set pair过了... #include <bits/stdc++.h> using namespace std; #define ll long long const int N = 200005; const ll mod = 1e9 + 7; const double eps = 1e-12; ll a[N]; struct node1 { ll d, dm, pos;…
D. Vika and Segments time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vika has an infinite sheet of squared paper. Initially all squares are white. She introduced a two-dimensional coordina…
B. Tavas and Malekas time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Tavas is a strange creature. Usually "zzz" comes out of people's mouth while sleeping, but string s of length n co…
C. Tavas and Karafs time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Karafs is some kind of vegetable in shape of an 1 × h rectangle. Tavaspolis people love Karafs and they use Karafs in al…
A. Binary Blocks time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given an image, that can be represented with a 2-d n by m grid of pixels. Each pixel of the image is either on or o…
E. Strictly Positive Matrix time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have matrix a of size n × n. Let's number the rows of the matrix from 1 to n from top to bottom, let's number…
C. Number Transformation time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Little Petya likes positive integers a lot. Recently his mom has presented him a positive integer a. There's only o…