【题解】CF1368C Even Picture】的更多相关文章

\(\color{purple}{Link}\) \(\text{Solution:}\) 这是一道构造题. 题目要求恰好有\(n\)个点的四周全都是灰色点,所以直接输正方形是不行了. 考虑\(k=1:\)则输出一个十字,且这个十字的左上角和右下角也涂色即可. 当\(k=2\)时,则在\(1\)的基础上把右上角三个再涂色即可. 最终所用点数:\(3n+4.\) #include<bits/stdc++.h> using namespace std; int n,k,cnt=7; int mai…
[题解]POJ2279 Mr.Young′s Picture Permutations dp 钦定从小往大放,然后直接dp. \(dp(t1,t2,t3,t4,t5)\)代表每一行多少人,判断边界就能dp. 然后你发现\(30^5\)开不下,但是你仔细观察由于它保证\(\sum < 30\)所以你只用开\(30^5 \div 5!\)就好了. 具体为什么我相信你会 //@winlere #include<iostream> #include<cstring> #include…
Problem Description Eddy begins to like painting pictures recently ,he is sure of himself to become a painter.Every day Eddy draws pictures in his small room, and he usually puts out his newest pictures to let his friends appreciate. but the result i…
Loli 考试的题目之一 题目地址 \(N^2\)做法 #include <cstdio> #include <cstring> #define re register #define GC getchar() #define Clean(X,K) memset(X,K,sizeof(X)) #include <iostream> #define LS (RT*2) #define RS (RT*2+1) #include <algorithm> #defi…
每日一题 day14 打卡 Analysis 五维dpf[a1,a2,a3,a4,a5]表示各排从左端起分别占了a1,a2,a3,a4,a5个人时合影方案数量然后我们枚举a1,a2,a3,a4,a5从0开始到N1,N2……N5若a1 < N1若a2 < N2&a1 > a2若a3 < N3&a2 > a3……(以此类推) #include<iostream> #include<cstdio> #include<cstring>…
这是一道超级水的模拟 + 简单搜索. 说说思路: 先找到中心点,就是自己和上下左右都为 * 的. 上下左右上的所有 * 都删掉,然后再看看有没有多余的 * 如果有输出 NO 否则输出 YES. 比如说有这样一个 \(n = 5\) 的图: \[\begin{matrix} .&.&.&.&*\\ .&.&*&.&.\\ .&*&*&*&*\\ .&.&*&.&.\\ .&…
[POJ1177]Picture 试题描述 A number of rectangular posters, photographs and other pictures of the same shape are pasted on a wall. Their sides are all vertical or horizontal. Each rectangle can be partially or totally covered by the others. The length of…
http://cdn.ac.nbutoj.com/Problem/view.xhtml?id=1541 When rain, nocLyt discovered a magical phenomenon that the rainwater always flow to the low-lying place. 我以后都在题解里放一小段题目,让人更容易搜到,有没有很有想法!(咦这样好像放全部的题目更容易被搜到啊)(不过那样好像比较乱啊) [] Rainwater 时间限制: ms 内存限制: K…
http://acm.hdu.edu.cn/showproblem.php?pid=1828 Picture Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2135    Accepted Submission(s): 1134 Problem Description A number of rectangular posters,…
今天老师(orz sansirowaltz)让我们做了很久之前的一场Codeforces Round #257 (Div. 1),这里给出A~C的题解,对应DIV2的C~E. A.Jzzhu and Chocolate time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Jzzhu has a big rectangular cho…