E. Hexagons 题目连接: http://codeforces.com/contest/615/problem/E Description Ayrat is looking for the perfect code. He decided to start his search from an infinite field tiled by hexagons. For convenience the coordinate system is introduced, take a look…
D. Multipliers 题目连接: http://codeforces.com/contest/615/problem/D Description Ayrat has number n, represented as it's prime factorization pi of size m, i.e. n = p1·p2·...·pm. Ayrat got secret information that that the product of all divisors of n take…
C. Running Track 题目连接: http://www.codeforces.com/contest/615/problem/C Description A boy named Ayrat lives on planet AMI-1511. Each inhabitant of this planet has a talent. Specifically, Ayrat loves running, moreover, just running is not enough for hi…
B. Longtail Hedgehog 题目连接: http://www.codeforces.com/contest/615/problem/B Description This Christmas Santa gave Masha a magic picture and a pencil. The picture consists of n points connected by m segments (they might cross in any way, that doesn't m…
A. Bulbs 题目连接: http://www.codeforces.com/contest/615/problem/A Description Vasya wants to turn on Christmas lights consisting of m bulbs. Initially, all bulbs are turned off. There are n buttons, each of them is connected to some set of bulbs. Vasya…
水 A- Bulbs #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e5 + 5; const int INF = 0x3f3f3f3f; bool vis[110]; int main(void) { memset (vis, false, sizeof (vis)); int n, m; scanf ("%d%d", &n, &m);…
D. Multipliers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Ayrat has number n, represented as it's prime factorization pi of size m, i.e. n = p1·p2·...·pm. Ayrat got secret information…
B. Longtail Hedgehog time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output This Christmas Santa gave Masha a magic picture and a pencil. The picture consists of n points connected by m segments…
B. Longtail Hedgehog   This Christmas Santa gave Masha a magic picture and a pencil. The picture consists of n points connected by m segments (they might cross in any way, that doesn't matter). No two segments connect the same pair of points, and no…
题目传送门 /* 题意:告诉起点终点,踩一次, '.'变成'X',再踩一次,冰块破碎,问是否能使终点冰破碎 DFS:如题解所说,分三种情况:1. 如果两点重合,只要往外走一步再走回来就行了:2. 若两点相邻, 那么要不就是踩一脚就破了或者踩一脚走开再走回来踩一脚破了:3. 普通的搜索看是否能到达, 若能还是要讨论终点踩几脚的问题:) DFS 耗时大,险些超时,可以用BFS来做 */ #include <cstdio> #include <algorithm> #include &l…