Educational Codeforces Round 141 解题报告 \(\text{By DaiRuiChen007}\) \(\text{Contest Link}\) A. Make it Beautiful 所有 \(\{a_i\}\) 相等显然不行,把最大的 \(a_i\) 放最前面,只要第二个和第一个不同就可以随便排了 我这里是用出现次数进行分层,对于出现次数 \(\ge 1,\ge 2,\ge 3,\cdots\) 的值分别逆序排列 时间复杂度 \(\Theta(n\log…
呜呜周日的时候手感一直很好 代码一般都是一遍过编译一遍过样例 做CF的时候前三题也都是一遍过Pretest没想着去检查... 期间姐姐提醒说有Announcement也自信不去看 呜呜然后就FST了 呜呜然后rating-55(果然呜呜 TAT A. Cutting Banner   A large banner with word CODEFORCES was ordered for the 1000-th onsite round of Codeforcesω that takes plac…
我是比赛地址 A:Phone Numbers $Description$:给你一串数字,问你能组成多少开头为8的11位电话号码. $Sol$:统计8的数量,与$n$%11作比较. #include<cstdio> #include<algorithm> #include<cstring> using namespace std; int n,len,cnt,ans; ]; int main() { scanf("%d",&n); scanf(…
感觉今天早上虽然没有睡醒但是效率还是挺高的... Pas和C++换着写... 544A. Set of Strings   You are given a string q. A sequence of k strings s1, s2, ..., sk is called beautiful, if the concatenation of these strings is string q(formally, s1 + s2 + ... + sk = q) and the first cha…
感觉这次的题目顺序很不合理啊... A. Combination Lock   Scrooge McDuck keeps his most treasured savings in a home safe with a combination lock. Each time he wants to put there the treasures that he's earned fair and square, he has to open the lock. The combination l…
比赛链接 A 题意 给一个数组 \(a\) ,要求重排列以后 \(a[i] \neq a[1,i-1]\) ,其中 \(a[1,i-1]\) 是前 \(i-1\) 项和. 如果无解则输出 NO :否则,给出一个合法的重排列后的 \(a\) . 题解 知识点:贪心. 显然先从大到小排序. 若 \(a_1 = a_2\) ,则需要用其他一个数字替换 \(a_1\) ,若此时 \(a[1] = a[n]\) 则没有数字换无解:否则可以交换 \(a_1,a_n\) . 否则,直接输出即可. 时间复杂度…
[Educational Codeforces Round 16]E. Generate a String 试题描述 zscoder wants to generate an input file for some programming competition problem. His input is a string consisting of n letters 'a'. He is too lazy to write a generator so he will manually ge…
[Educational Codeforces Round 16]D. Two Arithmetic Progressions 试题描述 You are given two arithmetic progressions: a1k + b1 and a2l + b2. Find the number of integers x such that L ≤ x ≤ R andx = a1k' + b1 = a2l' + b2, for some integers k', l' ≥ 0. 输入 Th…
[Educational Codeforces Round 16]C. Magic Odd Square 试题描述 Find an n × n matrix with different numbers from 1 to n2, so the sum in each row, column and both main diagonals are odd. 输入 The only line contains odd integer n (1 ≤ n ≤ 49). 输出 Print n lines…
[Educational Codeforces Round 16]B. Optimal Point on a Line 试题描述 You are given n points on a line with their coordinates xi. Find the point x so the sum of distances to the given points is minimal. 输入 The first line contains integer n (1 ≤ n ≤ 3·105)…