B. Art Union time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A well-known art union called "Kalevich is Alive!" manufactures objects d'art (pictures). The union consists of n painters…
B. Art Union time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A well-known art union called "Kalevich is Alive!" manufactures objects d'art (pictures). The union consists of n painters…
题意:有\(n\)个画家,\(m\)幅画,每个画家负责\(m\)幅画,只有前一个画家画完时,后面一个画家才能接着画,一个画家画完某幅画的任务后,可以开始画下一幅画的任务,问每幅画最后一个任务完成时的时间. 题解:这题可以用dp来写,当某个画家开始他的任务时,他的上一幅画的任务必须完成,并且他的前一个画家必须完成他的任务,我们用\(dp[i][j]\)表示第\(j\)个画家完成第\(i\)幅画任务时的时间,因为如果要合法的话,前面的两个条件都必须要满足,所以我们取两个状态的最大值,从而写出状态转移…
B. Art Union time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A well-known art union called "Kalevich is Alive!" manufactures objects d'art (pictures). The union consists of n painters…
A. Guess a number! time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A TV show called "Guess a number!" is gathering popularity. The whole Berland, the old and the young, are watching th…
Codeforces Codeforces Round #484 (Div. 2) D. Shark 题目连接: http://codeforces.com/contest/982/problem/D Description For long time scientists study the behavior of sharks. Sharks, as many other species, alternate short movements in a certain location and…
题目传送门 /* 题意:两点之间有不同颜色的线连通,问两点间单一颜色连通的路径有几条 DFS:暴力每个颜色,以u走到v为结束标志,累加条数 注意:无向图 */ #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #include <string> #include <vector> using namespace std; ; co…
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate it n = int(raw_input()) s = "" a = ["I hate that ","I love that ", "I hate it","I love it"] for i in ran…
Codeforces Round #354 (Div. 2) Problems     # Name     A Nicholas and Permutation standard input/output 1 s, 256 MB    x3384 B Pyramid of Glasses standard input/output 1 s, 256 MB    x1462 C Vasya and String standard input/output 1 s, 256 MB    x1393…
直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输出”#Color”,如果只有”G”,”B”,”W”就输出”#Black&White”. #include <cstdio> #include <cstring> using namespace std; const int maxn = 200; const int INF =…