<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>构造 on 111qqz's blog</title><link>https://111qqz.com/en/tags/%E6%9E%84%E9%80%A0/</link><description>Recent content in 构造 on 111qqz's blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>© 2015-2026 111qqz</copyright><lastBuildDate>Tue, 10 Oct 2017 10:19:55 +0000</lastBuildDate><atom:link href="https://111qqz.com/en/tags/%E6%9E%84%E9%80%A0/index.xml" rel="self" type="application/rss+xml"/><item><title>hdu 5950 Recursive sequence (构造矩阵，快速幂)</title><link>https://111qqz.com/en/post/acm-icpc/2017/2017-10-10-hdu-5950/</link><pubDate>Tue, 10 Oct 2017 10:19:55 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2017/2017-10-10-hdu-5950/</guid><description>&lt;p&gt;&lt;a href="http://acm.split.hdu.edu.cn/showproblem.php?pid=5950" target="_blank" rel="noreferrer"&gt;题目链接&lt;/a&gt;&lt;/p&gt;

&lt;h1 class="relative group"&gt;题意：
 &lt;div id="题意" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#%e9%a2%98%e6%84%8f" aria-label="Anchor"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h1&gt;
&lt;p&gt;给f[1],f[2],n,f[i] = 2*f[i-2] + f[i-1] + i^4,求f[n]的值。&lt;/p&gt;</description></item><item><title>UVA - 10518 How Many Calls? (构造矩阵，快速幂)</title><link>https://111qqz.com/en/post/acm-icpc/2017/2017-10-01-uva-10518/</link><pubDate>Sun, 01 Oct 2017 11:10:16 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2017/2017-10-01-uva-10518/</guid><description>&lt;p&gt;&lt;a href="https://vjudge.net/contest/188289#problem/O" target="_blank" rel="noreferrer"&gt;题目链接&lt;/a&gt;&lt;/p&gt;

&lt;h1 class="relative group"&gt;题意：
 &lt;div id="题意" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#%e9%a2%98%e6%84%8f" aria-label="Anchor"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h1&gt;
&lt;p&gt;求f[n] = f[n-1] + f[n-2] + 1，在b(10000)进制下的最后一位数字的十进制表示。&lt;/p&gt;</description></item><item><title>hdu 4686 Arc of Dream (构造矩阵，快速幂)</title><link>https://111qqz.com/en/post/acm-icpc/2017/2017-10-01-hdu-4686/</link><pubDate>Sun, 01 Oct 2017 06:33:48 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2017/2017-10-01-hdu-4686/</guid><description>&lt;p&gt;&lt;a href="http://acm.hdu.edu.cn/showproblem.php?pid=4686" target="_blank" rel="noreferrer"&gt;hdu4686题目链接&lt;/a&gt;&lt;/p&gt;

&lt;h1 class="relative group"&gt;题意：
 &lt;div id="题意" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#%e9%a2%98%e6%84%8f" aria-label="Anchor"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h1&gt;
&lt;p&gt;An Arc of Dream is a curve defined by following function:&lt;/p&gt;</description></item><item><title>hdu 4990 Reading comprehension (构造矩阵，快速幂)</title><link>https://111qqz.com/en/post/acm-icpc/2017/2017-09-30-hdu-4990/</link><pubDate>Sat, 30 Sep 2017 11:38:05 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2017/2017-09-30-hdu-4990/</guid><description>&lt;p&gt;&lt;a href="http://acm.hdu.edu.cn/showproblem.php?pid=4990" target="_blank" rel="noreferrer"&gt;题目链接&lt;/a&gt;&lt;/p&gt;

&lt;h1 class="relative group"&gt;题意：
 &lt;div id="题意" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#%e9%a2%98%e6%84%8f" aria-label="Anchor"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h1&gt;
&lt;p&gt;给出了一段程序，程序实际算的是f[n] = (f[n-1] + n%2)%m的值，其中f[1]=1,给出n,m(1E9)，问f[n]&lt;/p&gt;</description></item><item><title>今日头条笔试题_或与加(打表,构造)</title><link>https://111qqz.com/en/post/acm-icpc/2017/2017-03-30-bytedance-2017-interview-03/</link><pubDate>Thu, 30 Mar 2017 03:04:06 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2017/2017-03-30-bytedance-2017-interview-03/</guid><description>&lt;p&gt;给定 x, k ，求满足 x + y = x | y 的第 k 小的正整数 y 。 | 是二进制的或(or)运算，例如 3 | 5 = 7。&lt;/p&gt;</description></item><item><title>codeforces #381 div 2 C. Alyona and mex (构造)</title><link>https://111qqz.com/en/post/acm-icpc/2016/2016-11-28-cf740c/</link><pubDate>Mon, 28 Nov 2016 07:03:51 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2016/2016-11-28-cf740c/</guid><description>&lt;p&gt;&lt;a href="http://codeforces.com/contest/740/problem/C" target="_blank" rel="noreferrer"&gt;题目链接&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;题意：&lt;/p&gt;
&lt;p&gt;m个区间，要求构造一个长度为n的数组，满足m个区间中，每个区间的mex值中的最小值最大。&lt;/p&gt;</description></item><item><title>codeforces 496 C Removing Columns (构造)</title><link>https://111qqz.com/en/post/acm-icpc/2016/2016-10-04-cf496c/</link><pubDate>Tue, 04 Oct 2016 11:37:22 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2016/2016-10-04-cf496c/</guid><description>&lt;p&gt;&lt;a href="http://codeforces.com/problemset/problem/496/C" target="_blank" rel="noreferrer"&gt;题目链接&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;题意：给一个n*m的由小写字母组成的table.要求从上往下每一行字典序不严格递增。问最少删除几列才能满足。&lt;/p&gt;</description></item><item><title>codeforces 509 B. Painting Pebbles （构造）</title><link>https://111qqz.com/en/post/acm-icpc/2016/2016-10-03-cf509b/</link><pubDate>Mon, 03 Oct 2016 19:09:23 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2016/2016-10-03-cf509b/</guid><description>&lt;p&gt;&lt;a href="http://codeforces.com/problemset/problem/509/B" target="_blank" rel="noreferrer"&gt;题目链接&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;题意：n堆石子，每堆a[i]个，k种颜色。给每个石子涂色，要求对于每种颜色，任意两堆中该颜色石子的个数最多差一个。问是否有解，有解输出一组方案。&lt;/p&gt;</description></item><item><title>codeforces 468 A. 24 Game (构造)</title><link>https://111qqz.com/en/post/acm-icpc/2016/2016-10-02-cf468a/</link><pubDate>Sun, 02 Oct 2016 17:14:48 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2016/2016-10-02-cf468a/</guid><description>&lt;p&gt;&lt;a href="http://codeforces.com/problemset/problem/468/A" target="_blank" rel="noreferrer"&gt;题目链接&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;题意：给出n，有1..n n个数，可以选择两个数进行加，减，乘，三种操作，操做完得到一个数放回。 n-1次操作后只剩下一个数。现在要求剩下的数为24.问方法。&lt;/p&gt;</description></item><item><title>codeforces 679A A. Bear and Prime 100 (交互题，构造)</title><link>https://111qqz.com/en/post/acm-icpc/2016/2016-10-02-cf679a/</link><pubDate>Sun, 02 Oct 2016 12:58:24 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2016/2016-10-02-cf679a/</guid><description>&lt;p&gt;&lt;a href="http://codeforces.com/problemset/problem/679/A" target="_blank" rel="noreferrer"&gt;题目链接&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;题意：存在一个[2..100]之间的数，每次可以询问一个数是否是该数的因子，返回yes或者no,最多询问20次。每次要输出询问的数，以及最后要输出这个数是否是质数。&lt;/p&gt;</description></item><item><title>codeforces 623 A. Graph and String (构造)</title><link>https://111qqz.com/en/post/acm-icpc/2016/2016-09-02-cf623a/</link><pubDate>Fri, 02 Sep 2016 08:48:37 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2016/2016-09-02-cf623a/</guid><description>&lt;p&gt;题目链接：&lt;a href="http://codeforces.com/problemset/problem/623/A" target="_blank" rel="noreferrer"&gt;题目链接&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;题意：给出一个无向图，该图是通过仅包含‘a’ &amp;lsquo;b&amp;rsquo; &amp;lsquo;c&amp;rsquo;三个字母，以规则“i,j之间有边，当且仅当s[i]和s[j]相同，或者s[i]和s[j]在字母表中相邻”（也就是只有&amp;rsquo;a&amp;rsquo;和&amp;rsquo;c&amp;rsquo;是没有边相连的）得到的，现在问能否还原这个字符串，如果能，输出任意一个解。&lt;/p&gt;</description></item><item><title>codeforces #368 div 2 C. Pythagorean Triples (构造，数学)</title><link>https://111qqz.com/en/post/acm-icpc/2016/2016-08-21-cf707c/</link><pubDate>Sun, 21 Aug 2016 10:45:59 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2016/2016-08-21-cf707c/</guid><description>&lt;p&gt;&lt;a href="http://www.codeforces.com/contest/707/problem/C" target="_blank" rel="noreferrer"&gt;题目链接&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;题意：给出一个数，问包含这个数三个数组成的勾股数，输出另外两个数。&lt;/p&gt;</description></item><item><title>codeforces 652 B. z-sort (简单构造)</title><link>https://111qqz.com/en/post/acm-icpc/2016/2016-03-31-cf652b/</link><pubDate>Thu, 31 Mar 2016 06:11:36 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2016/2016-03-31-cf652b/</guid><description>&lt;p&gt;&lt;a href="http://codeforces.com/problemset/problem/652/B" target="_blank" rel="noreferrer"&gt;题目链接&lt;/a&gt;
题意：给出n个元素的序列，问能否得到一个新的序列，使得奇数位置非递减排列，偶数位数非递增排列。
思路：感觉一定可以啊。。。排序以后直接构造。。。&lt;/p&gt;</description></item><item><title>codeforces #342 div 2 D. Finals in arithmetic</title><link>https://111qqz.com/en/post/acm-icpc/2016/2016-02-08-cf625d/</link><pubDate>Mon, 08 Feb 2016 12:28:22 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2016/2016-02-08-cf625d/</guid><description>&lt;p&gt;&lt;a href="http://codeforces.com/contest/625/problem/D" target="_blank" rel="noreferrer"&gt;http://codeforces.com/contest/625/problem/D&lt;/a&gt;
题意：问能否找到一个s,满足s+s的反转=k
思路：如果是回文数。。。那么显然满足。除以2就可以得到答案。&lt;/p&gt;</description></item><item><title>codeforces #342 div 2 C. K-special Tables</title><link>https://111qqz.com/en/post/acm-icpc/2016/2016-02-07-cf625c/</link><pubDate>Sun, 07 Feb 2016 11:32:04 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2016/2016-02-07-cf625c/</guid><description>&lt;p&gt;&lt;a href="http://codeforces.com/contest/625/problem/C" target="_blank" rel="noreferrer"&gt;http://codeforces.com/contest/625/problem/C&lt;/a&gt;
题意：构造一个矩阵。。满足三个条件。。。
思路：简单构造。。。看代码把。。。。&lt;/p&gt;</description></item><item><title>uva 10785 The Mad Numerologist</title><link>https://111qqz.com/en/post/acm-icpc/2016/2016-01-27-uva10785/</link><pubDate>Wed, 27 Jan 2016 14:13:44 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2016/2016-01-27-uva10785/</guid><description>&lt;p&gt;&lt;a href="https://uva.onlinejudge.org/index.php?option=com_onlinejudge&amp;amp;Itemid;=8&amp;amp;page;=show_problem&amp;amp;problem;=1726" target="_blank" rel="noreferrer"&gt;https://uva.onlinejudge.org/index.php?option=com_onlinejudge&amp;Itemid;=8&amp;page;=show_problem&amp;problem;=1726&lt;/a&gt;
题意：给出26个大写字母的权值，要求构造一个长度为n（n不超过210）的字符串。并且满足奇数位置只能放元音字母，偶数位置只能放辅音字母，且每个元音字母最多放21次，每个辅音字母最多放5次，要求构造的字符串的权值之和最小，在权值最小的前提下字典序最小。&lt;/p&gt;</description></item><item><title>codeforces 22 C. System Administrator</title><link>https://111qqz.com/en/post/acm-icpc/2015/2015-12-30-cf22c/</link><pubDate>Wed, 30 Dec 2015 13:47:31 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2015/2015-12-30-cf22c/</guid><description>&lt;p&gt;&lt;a href="http://codeforces.com/contest/22/problem/C" target="_blank" rel="noreferrer"&gt;http://codeforces.com/contest/22/problem/C&lt;/a&gt;
题意：要求用n个点m条边构造一个不允许有重边的图，满足当去掉点v的时候，剩下的n-1个不联通。如果有答案输出任意，没答案输出-1.
思路：首先如果n个点要联通。。至少有n-1条边，此时为一棵树。但是是不是边越多越好呢？显然是不可以的。满足去掉一个点使得n-1个点不联通的情况为，存在一个点u只和v相连，不和任意任何其他点相连，那么当去掉v点，u点就变成不可到达了。边数最多的情况就是，除了v点以外的n-1个点，每个点的度都是n-2(去掉自身以及u点还有n-2个点)，，那么除去u点以外的n-1个点的度数就是（n-1）&lt;em&gt;(n-2)，边数则为(n-1)&lt;/em&gt;(n-2)/2，再加一条连接u的边，&lt;strong&gt;所以图的最大边数为(n-1)*(n-2)/2+1，最小为n-1.&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>codeforces 600 C. Make Palindrome</title><link>https://111qqz.com/en/post/acm-icpc/2015/2015-12-08-cf600c/</link><pubDate>Tue, 08 Dec 2015 09:44:29 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2015/2015-12-08-cf600c/</guid><description>&lt;p&gt;&lt;a href="http://codeforces.com/problemset/problem/600/C" target="_blank" rel="noreferrer"&gt;http://codeforces.com/problemset/problem/600/C&lt;/a&gt;
题意：给定一个字符串。要求用最少的变换得到一个回文串。且在变换次数相同时要字典序最小的。输出变换后的字符串。
思路：对不能构成会文串有影响的是出现奇数次的字母。所以我们先统计每个字母出现的次数。然后按照出现奇数次的字母的个数分奇偶分别搞。偶数的话直接把后面一半变成前面一半。奇数的话，也是这样。输出的时候按照字母从a扫到z，如果有就输出一半。然后再倒着扫一遍。 输出另一半。这样可以保证是字典序最小。&lt;strong&gt;需要注意的是奇数的时候的输出情况。不要忘记中间那个字母。&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>codeforces 377 A maze</title><link>https://111qqz.com/en/post/acm-icpc/2015/2015-12-05-cf377a/</link><pubDate>Sat, 05 Dec 2015 06:34:40 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2015/2015-12-05-cf377a/</guid><description>&lt;p&gt;&lt;a href="http://codeforces.com/contest/377/problem/A" target="_blank" rel="noreferrer"&gt;http://codeforces.com/contest/377/problem/A&lt;/a&gt;
题意：给定一个n*m的maze. ‘.’代表空，‘#’代表墙。要求构造一种方案，使得将k个空格填成墙壁后不影响当前的连通性（即没有被填充的空格之间可以相互到达）
思路：一开始想从上往下从左往右构造。错误的认为四个角一定是可以变成墙的。&lt;/p&gt;</description></item><item><title>poj 1305 (毕达哥拉斯三元组，构造勾股数)</title><link>https://111qqz.com/en/post/acm-icpc/2015/2015-08-22-poj1305/</link><pubDate>Sat, 22 Aug 2015 06:18:00 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2015/2015-08-22-poj1305/</guid><description>&lt;p&gt;题意是说，能构造多少本元勾股数和勾股数，要求构造的数&amp;lt;=n&lt;/p&gt;</description></item><item><title>codeforces 534 A. Exam</title><link>https://111qqz.com/en/post/acm-icpc/2015/2015-04-13-cf534a/</link><pubDate>Mon, 13 Apr 2015 02:55:00 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2015/2015-04-13-cf534a/</guid><description>&lt;p&gt;A. Exam&lt;/p&gt;
&lt;p&gt;time limit per test&lt;/p&gt;
&lt;p&gt;1 second&lt;/p&gt;
&lt;p&gt;memory limit per test&lt;/p&gt;
&lt;p&gt;256 megabytes&lt;/p&gt;
&lt;p&gt;input&lt;/p&gt;
&lt;p&gt;standard input&lt;/p&gt;
&lt;p&gt;output&lt;/p&gt;
&lt;p&gt;standard output&lt;/p&gt;
&lt;p&gt;An exam for &lt;em&gt;n&lt;/em&gt; students will take place in a long and narrow room, so the students will sit in a line in some order. The teacher suspects that students with adjacent numbers (&lt;em&gt;i&lt;/em&gt; and &lt;em&gt;i&lt;/em&gt; + 1) always studied side by side and became friends and if they take an exam sitting next to each other, they will help each other for sure.&lt;/p&gt;</description></item><item><title>codeforces 482 A. Diverse Permutation（构造）</title><link>https://111qqz.com/en/post/acm-icpc/2015/2015-04-08-cf482/</link><pubDate>Wed, 08 Apr 2015 11:32:00 +0000</pubDate><guid>https://111qqz.com/en/post/acm-icpc/2015/2015-04-08-cf482/</guid><description>&lt;p&gt;C - C&lt;/p&gt;
&lt;p&gt;**Time Limit:**1000MS **Memory Limit:**262144KB &lt;strong&gt;64bit IO Format:&lt;/strong&gt;%I64d &amp;amp; %I64u&lt;/p&gt;
&lt;p&gt;Submit &lt;a href="http://acm.hust.edu.cn/vjudge/contest/view.action?cid=74251#status//C/0" target="_blank" rel="noreferrer"&gt;Status&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Description&lt;/p&gt;
&lt;p&gt;Permutation_p_ is an ordered set of integers _p_1,   &lt;em&gt;p_2,   &amp;hellip;,   &lt;em&gt;p__n&lt;/em&gt;, consisting of &lt;em&gt;n&lt;/em&gt; distinct positive integers not larger than &lt;em&gt;n&lt;/em&gt;. We&amp;rsquo;ll denote as_n&lt;/em&gt; the length of permutation _p_1,   _p_2,   &amp;hellip;,   &lt;em&gt;p__n&lt;/em&gt;.&lt;/p&gt;</description></item></channel></rss>